@ankhorage/zora 28.11.0 → 28.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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +2 -1
- package/dist/capabilities/index.js.map +3 -3
- package/dist/constants/authoring.d.ts +3 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +1 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
- package/dist/features/calendar/adapters/inbound/Calendar.js +91 -7
- package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
- package/dist/features/popover/popoverMeta.d.ts +1 -1
- package/dist/features/reader/meta.d.ts +2 -2
- package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
- package/dist/features/scanner/meta.d.ts +2 -2
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts.map +1 -1
- package/dist/features/time-grid/adapters/inbound/TimeGrid.js +45 -22
- package/dist/features/time-grid/adapters/inbound/TimeGrid.js.map +1 -1
- package/dist/types/color.d.ts +3 -3
- package/dist/types/color.d.ts.map +1 -1
- package/dist/types/color.js.map +1 -1
- package/dist/types/time-grid.d.ts +9 -0
- package/dist/types/time-grid.d.ts.map +1 -1
- package/dist/types/time-grid.js.map +1 -1
- package/package.json +4 -4
- package/src/constants/authoring.ts +1 -0
- package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +65 -4
- package/src/features/calendar/adapters/inbound/Calendar.tsx +172 -22
- package/src/features/time-grid/adapters/inbound/TimeGrid.tsx +64 -21
- package/src/types/color.ts +3 -3
- package/src/types/time-grid.ts +9 -0
- package/web-dist/chunks/{Accordion-j3esnt3f.js → Accordion-95003ycq.js} +139 -22
- package/web-dist/chunks/{Accordion-91qf4q27.js → Accordion-gb3mfjmx.js} +42 -19
- package/web-dist/components/calendar/Calendar.js +2 -2
- package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +3 -3
- package/web-dist/components/color-tone/ColorTone.types-0.d.ts +3 -3
- package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +1 -1
- package/web-dist/components/date-picker/DatePicker.js +2 -2
- package/web-dist/components/time-grid/TimeGrid.d.ts +1 -1
- package/web-dist/components/time-grid/TimeGrid.dependency-2.d.ts +13 -0
- package/web-dist/components/time-grid/TimeGrid.js +1 -1
- package/web-dist/components/time-grid/TimeGrid.types-0.d.ts +10 -0
- package/web-dist/manifest.json +6 -5
|
@@ -13,13 +13,14 @@ import {
|
|
|
13
13
|
} from "./Accordion-snk6nggm.js";
|
|
14
14
|
import {
|
|
15
15
|
TimeGrid2
|
|
16
|
-
} from "./Accordion-
|
|
16
|
+
} from "./Accordion-gb3mfjmx.js";
|
|
17
17
|
import {
|
|
18
18
|
Text2
|
|
19
19
|
} from "./Accordion-5x4cv0kv.js";
|
|
20
20
|
|
|
21
21
|
// src/features/calendar/adapters/inbound/Calendar.tsx
|
|
22
22
|
import React from "react";
|
|
23
|
+
import { useWindowDimensions, View as NativeView } from "react-native-web";
|
|
23
24
|
|
|
24
25
|
// src/features/calendar/application/createCalendarMonth.ts
|
|
25
26
|
function createCalendarMonth(month, weekStartsOn) {
|
|
@@ -72,6 +73,11 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
72
73
|
var GRID_COLUMNS = 7;
|
|
73
74
|
var GRID_ROWS = 6;
|
|
74
75
|
var MINUTES_PER_DAY = 24 * 60;
|
|
76
|
+
var TIME_AXIS_WIDTH = 56;
|
|
77
|
+
var TIME_GRID_HEADER_HEIGHT = 36;
|
|
78
|
+
var MINIMUM_DAY_WIDTH = 96;
|
|
79
|
+
var MINIMUM_TIME_GRID_HEIGHT = 360;
|
|
80
|
+
var MAXIMUM_TIME_GRID_HEIGHT = 720;
|
|
75
81
|
var Calendar2 = withZoraThemeScope(CalendarInner);
|
|
76
82
|
function CalendarInner(props) {
|
|
77
83
|
const {
|
|
@@ -290,26 +296,133 @@ function CalendarTimeView({
|
|
|
290
296
|
view,
|
|
291
297
|
weekStartsOn
|
|
292
298
|
}) {
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
variant: "caption",
|
|
309
|
-
children: formatDayLabel(parseCalendarDate(lane.id) ?? displayedDate, locale)
|
|
310
|
-
}),
|
|
299
|
+
const { height: windowHeight, width: windowWidth } = useWindowDimensions();
|
|
300
|
+
const [measuredWidth, setMeasuredWidth] = React.useState(0);
|
|
301
|
+
const dates = React.useMemo(() => view === "day" ? [displayedDate] : createWeek(displayedDate, weekStartsOn), [displayedDate, view, weekStartsOn]);
|
|
302
|
+
const width = measuredWidth || windowWidth || getBrowserViewportWidth();
|
|
303
|
+
const contentWidth = Math.max(width, TIME_AXIS_WIDTH + dates.length * MINIMUM_DAY_WIDTH);
|
|
304
|
+
const dayWidth = (contentWidth - TIME_AXIS_WIDTH) / dates.length;
|
|
305
|
+
const height = Math.max(MINIMUM_TIME_GRID_HEIGHT, Math.min(MAXIMUM_TIME_GRID_HEIGHT, windowHeight - 180));
|
|
306
|
+
const intervals = React.useMemo(() => createTimeGridIntervals(events, dates, timeZone), [dates, events, timeZone]);
|
|
307
|
+
const eventByIntervalId = React.useMemo(() => new Map(intervals.flatMap((interval) => {
|
|
308
|
+
const event = events.find((candidate) => interval.id.endsWith(`:${candidate.id}`));
|
|
309
|
+
return event ? [[interval.id, event]] : [];
|
|
310
|
+
})), [events, intervals]);
|
|
311
|
+
return /* @__PURE__ */ jsx(NativeView, {
|
|
312
|
+
onLayout: (event) => setMeasuredWidth(event.nativeEvent.layout.width),
|
|
313
|
+
style: { height, width: "100%" },
|
|
311
314
|
testID: withTestId(testID, view),
|
|
312
|
-
|
|
315
|
+
children: width > 0 ? /* @__PURE__ */ jsx(TimeGrid2, {
|
|
316
|
+
contentHeight: TIME_GRID_HEADER_HEIGHT + MINUTES_PER_DAY,
|
|
317
|
+
contentWidth,
|
|
318
|
+
height,
|
|
319
|
+
interactionPolicy,
|
|
320
|
+
intervals,
|
|
321
|
+
lanes: [
|
|
322
|
+
{ height: TIME_AXIS_WIDTH, id: "time-axis" },
|
|
323
|
+
...dates.map((date) => ({ height: dayWidth, id: formatCalendarDate2(date) }))
|
|
324
|
+
],
|
|
325
|
+
onIntervalPress: (interval) => {
|
|
326
|
+
const event = eventByIntervalId.get(interval.id);
|
|
327
|
+
if (event)
|
|
328
|
+
activateEvent(event.id);
|
|
329
|
+
},
|
|
330
|
+
orientation: "vertical",
|
|
331
|
+
overscanPixels: 0,
|
|
332
|
+
renderInterval: (interval) => /* @__PURE__ */ jsx(View2, {
|
|
333
|
+
bg: "subtle",
|
|
334
|
+
borderColor: "primary",
|
|
335
|
+
borderWidth: 1,
|
|
336
|
+
gap: "xxs",
|
|
337
|
+
p: "xs",
|
|
338
|
+
radius: "s",
|
|
339
|
+
children: /* @__PURE__ */ jsx(Text2, {
|
|
340
|
+
numberOfLines: 1,
|
|
341
|
+
variant: "caption",
|
|
342
|
+
weight: "semiBold",
|
|
343
|
+
children: eventByIntervalId.get(interval.id)?.title
|
|
344
|
+
})
|
|
345
|
+
}),
|
|
346
|
+
renderWorldLayer: (layer) => /* @__PURE__ */ jsx(CalendarTimeGridGeometry, {
|
|
347
|
+
dates,
|
|
348
|
+
dayWidth,
|
|
349
|
+
layer,
|
|
350
|
+
locale
|
|
351
|
+
}),
|
|
352
|
+
testID: withTestId(testID, `${view}-grid`),
|
|
353
|
+
viewportControls: "hidden",
|
|
354
|
+
width
|
|
355
|
+
}) : null
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function CalendarTimeGridGeometry({
|
|
359
|
+
dates,
|
|
360
|
+
dayWidth,
|
|
361
|
+
layer,
|
|
362
|
+
locale
|
|
363
|
+
}) {
|
|
364
|
+
const hourFormatter = new Intl.DateTimeFormat(locale, { hour: "numeric" });
|
|
365
|
+
return /* @__PURE__ */ jsxs(NativeView, {
|
|
366
|
+
pointerEvents: "none",
|
|
367
|
+
style: { height: layer.height, width: layer.width },
|
|
368
|
+
children: [
|
|
369
|
+
dates.map((date, index) => /* @__PURE__ */ jsxs(React.Fragment, {
|
|
370
|
+
children: [
|
|
371
|
+
/* @__PURE__ */ jsx(NativeView, {
|
|
372
|
+
style: {
|
|
373
|
+
borderLeftWidth: 1,
|
|
374
|
+
height: layer.height - layer.origin.y,
|
|
375
|
+
left: layer.origin.x + (TIME_AXIS_WIDTH + index * dayWidth) * layer.pixelsPerUnitX,
|
|
376
|
+
position: "absolute",
|
|
377
|
+
top: layer.origin.y,
|
|
378
|
+
width: dayWidth * layer.pixelsPerUnitX
|
|
379
|
+
},
|
|
380
|
+
children: /* @__PURE__ */ jsx(Text2, {
|
|
381
|
+
align: "center",
|
|
382
|
+
variant: "caption",
|
|
383
|
+
weight: "semiBold",
|
|
384
|
+
children: formatDayLabel(date, locale)
|
|
385
|
+
})
|
|
386
|
+
}),
|
|
387
|
+
index === dates.length - 1 ? /* @__PURE__ */ jsx(NativeView, {
|
|
388
|
+
style: {
|
|
389
|
+
borderLeftWidth: 1,
|
|
390
|
+
height: layer.height - layer.origin.y,
|
|
391
|
+
left: layer.origin.x + (TIME_AXIS_WIDTH + (index + 1) * dayWidth) * layer.pixelsPerUnitX,
|
|
392
|
+
position: "absolute",
|
|
393
|
+
top: layer.origin.y
|
|
394
|
+
}
|
|
395
|
+
}) : null
|
|
396
|
+
]
|
|
397
|
+
}, formatCalendarDate2(date))),
|
|
398
|
+
Array.from({ length: 25 }, (_, hour) => {
|
|
399
|
+
const top = layer.origin.y + (TIME_GRID_HEADER_HEIGHT + hour * 60) * layer.pixelsPerUnitY;
|
|
400
|
+
return /* @__PURE__ */ jsxs(React.Fragment, {
|
|
401
|
+
children: [
|
|
402
|
+
/* @__PURE__ */ jsx(NativeView, {
|
|
403
|
+
style: {
|
|
404
|
+
borderTopWidth: 1,
|
|
405
|
+
left: layer.origin.x + TIME_AXIS_WIDTH * layer.pixelsPerUnitX,
|
|
406
|
+
position: "absolute",
|
|
407
|
+
top,
|
|
408
|
+
width: layer.width - TIME_AXIS_WIDTH * layer.pixelsPerUnitX
|
|
409
|
+
}
|
|
410
|
+
}),
|
|
411
|
+
hour < 24 ? /* @__PURE__ */ jsx(Text2, {
|
|
412
|
+
align: "right",
|
|
413
|
+
style: {
|
|
414
|
+
left: layer.origin.x,
|
|
415
|
+
position: "absolute",
|
|
416
|
+
top,
|
|
417
|
+
width: TIME_AXIS_WIDTH * layer.pixelsPerUnitX - 6
|
|
418
|
+
},
|
|
419
|
+
variant: "caption",
|
|
420
|
+
children: hourFormatter.format(new Date(2023, 0, 1, hour))
|
|
421
|
+
}) : null
|
|
422
|
+
]
|
|
423
|
+
}, hour);
|
|
424
|
+
})
|
|
425
|
+
]
|
|
313
426
|
});
|
|
314
427
|
}
|
|
315
428
|
function createWeekdayLabels(locale, weekStartsOn) {
|
|
@@ -344,9 +457,9 @@ function createTimeGridIntervals(events, dates, timeZone) {
|
|
|
344
457
|
return [
|
|
345
458
|
{
|
|
346
459
|
extent: Math.max(1, endMinute - startMinute),
|
|
347
|
-
id: event.id
|
|
460
|
+
id: `${dateId}:${event.id}`,
|
|
348
461
|
laneId: dateId,
|
|
349
|
-
start: startMinute
|
|
462
|
+
start: TIME_GRID_HEADER_HEIGHT + startMinute
|
|
350
463
|
}
|
|
351
464
|
];
|
|
352
465
|
}));
|
|
@@ -420,6 +533,10 @@ function formatViewLabel(value, locale, view) {
|
|
|
420
533
|
function formatDayLabel(value, locale) {
|
|
421
534
|
return new Intl.DateTimeFormat(locale, { day: "numeric", weekday: "short" }).format(value);
|
|
422
535
|
}
|
|
536
|
+
function getBrowserViewportWidth() {
|
|
537
|
+
const browserWindow = Reflect.get(globalThis, "window");
|
|
538
|
+
return typeof browserWindow === "object" && "innerWidth" in browserWindow && typeof browserWindow.innerWidth === "number" ? Math.max(0, browserWindow.innerWidth) : 0;
|
|
539
|
+
}
|
|
423
540
|
function withTestId(testID, suffix) {
|
|
424
541
|
return testID === undefined ? undefined : `${testID}-${suffix}`;
|
|
425
542
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
GridView2
|
|
4
4
|
} from "./Accordion-snk6nggm.js";
|
|
5
5
|
import {
|
|
6
|
+
getVisibleGridItems,
|
|
6
7
|
getLaneIntervalPlacement,
|
|
7
8
|
getVisibleLaneIntervals
|
|
8
9
|
} from "./Accordion-tnyqv1xv.js";
|
|
@@ -55,6 +56,7 @@ function TimeGridKeyboardProxy({ children, onKeyDown }) {
|
|
|
55
56
|
// src/features/time-grid/adapters/inbound/TimeGrid.tsx
|
|
56
57
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
57
58
|
function TimeGrid2({
|
|
59
|
+
contentHeight: requestedContentHeight,
|
|
58
60
|
contentWidth,
|
|
59
61
|
focusedIntervalId,
|
|
60
62
|
height,
|
|
@@ -65,12 +67,15 @@ function TimeGrid2({
|
|
|
65
67
|
onIntervalPress,
|
|
66
68
|
onViewportChange,
|
|
67
69
|
onVisibleIntervalIdsChange,
|
|
70
|
+
orientation = "horizontal",
|
|
68
71
|
overscanPixels,
|
|
69
72
|
renderInterval,
|
|
70
73
|
renderLaneLabel,
|
|
74
|
+
renderWorldLayer,
|
|
71
75
|
revealPaddingPixels,
|
|
72
76
|
selectedIntervalIds = [],
|
|
73
77
|
testID,
|
|
78
|
+
viewportControls,
|
|
74
79
|
width,
|
|
75
80
|
zoom
|
|
76
81
|
}) {
|
|
@@ -88,40 +93,34 @@ function TimeGrid2({
|
|
|
88
93
|
}), [height, scale, scrollOffsets, width]);
|
|
89
94
|
const intervalById = React.useMemo(() => new Map(intervals.map((interval) => [interval.id, interval])), [intervals]);
|
|
90
95
|
const selectedIds = React.useMemo(() => new Set(selectedIntervalIds), [selectedIntervalIds]);
|
|
91
|
-
const
|
|
92
|
-
const
|
|
96
|
+
const laneExtent = React.useMemo(() => lanes.reduce((total, lane) => total + lane.height, 0), [lanes]);
|
|
97
|
+
const contentHeight = orientation === "vertical" ? requestedContentHeight ?? 0 : laneExtent;
|
|
98
|
+
const resolvedContentWidth = orientation === "vertical" ? laneExtent : contentWidth;
|
|
99
|
+
const placements = React.useMemo(() => orientation === "vertical" ? createVerticalPlacements(lanes, intervals) : intervals.map((interval) => getLaneIntervalPlacement(lanes, interval)), [intervals, lanes, orientation]);
|
|
100
|
+
const visibleIntervals = React.useMemo(() => orientation === "vertical" ? getVisibleGridItems(placements, viewport, overscanPixels) : resolveTimeGridVisibleIntervals(lanes, intervals, viewport, overscanPixels), [intervals, lanes, orientation, overscanPixels, placements, viewport]);
|
|
93
101
|
const focusedPlacement = React.useMemo(() => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}, [focusedIntervalId, intervals, lanes]);
|
|
102
|
+
return placements.find((interval) => interval.id === focusedIntervalId);
|
|
103
|
+
}, [focusedIntervalId, placements]);
|
|
97
104
|
const gridItems = React.useMemo(() => focusedPlacement && !visibleIntervals.some((interval) => interval.id === focusedPlacement.id) ? [...visibleIntervals, focusedPlacement] : visibleIntervals, [focusedPlacement, visibleIntervals]);
|
|
98
105
|
const labelIntervals = React.useMemo(() => lanes.map((lane) => ({
|
|
99
|
-
extent:
|
|
106
|
+
extent: resolvedContentWidth,
|
|
100
107
|
id: `lane-label-${lane.id}`,
|
|
101
108
|
laneId: lane.id,
|
|
102
109
|
start: 0
|
|
103
|
-
})), [
|
|
110
|
+
})), [lanes, resolvedContentWidth]);
|
|
104
111
|
const visibleLabels = React.useMemo(() => resolveTimeGridVisibleIntervals(lanes, labelIntervals, viewport, overscanPixels), [labelIntervals, lanes, overscanPixels, viewport]);
|
|
105
112
|
const handleViewportChange = React.useCallback((nextViewport) => {
|
|
106
113
|
setScrollOffsets((current) => current.offsetX === nextViewport.offsetX && current.offsetY === nextViewport.offsetY ? current : { offsetX: nextViewport.offsetX, offsetY: nextViewport.offsetY });
|
|
107
114
|
onViewportChange?.(nextViewport);
|
|
108
115
|
}, [onViewportChange]);
|
|
109
116
|
const resolveNextFocusId = React.useCallback((intervalId, direction) => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
offsetX: 0,
|
|
113
|
-
offsetY: 0,
|
|
114
|
-
pixelsPerUnitX: 1,
|
|
115
|
-
pixelsPerUnitY: 1,
|
|
116
|
-
width: contentWidth
|
|
117
|
-
});
|
|
118
|
-
return resolveTimeGridNextFocusId(allIntervals, intervalId, direction);
|
|
119
|
-
}, [contentHeight, contentWidth, intervals, lanes]);
|
|
117
|
+
return resolveTimeGridNextFocusId(placements, intervalId, direction);
|
|
118
|
+
}, [placements]);
|
|
120
119
|
return /* @__PURE__ */ jsxs(View, {
|
|
121
120
|
style: { flexDirection: "row", height, width },
|
|
122
121
|
testID,
|
|
123
122
|
children: [
|
|
124
|
-
renderLaneLabel ? /* @__PURE__ */ jsx2(View, {
|
|
123
|
+
orientation === "horizontal" && renderLaneLabel ? /* @__PURE__ */ jsx2(View, {
|
|
125
124
|
accessibilityElementsHidden: true,
|
|
126
125
|
pointerEvents: "none",
|
|
127
126
|
style: { height, overflow: "hidden" },
|
|
@@ -142,7 +141,7 @@ function TimeGrid2({
|
|
|
142
141
|
}) : null,
|
|
143
142
|
/* @__PURE__ */ jsx2(GridView2, {
|
|
144
143
|
contentHeight,
|
|
145
|
-
contentWidth,
|
|
144
|
+
contentWidth: resolvedContentWidth,
|
|
146
145
|
focusedItemId: focusedIntervalId,
|
|
147
146
|
height,
|
|
148
147
|
interactionPolicy,
|
|
@@ -179,13 +178,37 @@ function TimeGrid2({
|
|
|
179
178
|
});
|
|
180
179
|
},
|
|
181
180
|
revealPaddingPixels,
|
|
181
|
+
renderWorldLayer,
|
|
182
182
|
testID: testID === undefined ? undefined : `${testID}-viewport`,
|
|
183
|
+
viewportControls,
|
|
183
184
|
width,
|
|
184
185
|
zoom
|
|
185
186
|
})
|
|
186
187
|
]
|
|
187
188
|
});
|
|
188
189
|
}
|
|
190
|
+
function createVerticalPlacements(lanes, intervals) {
|
|
191
|
+
const offsets = new Map;
|
|
192
|
+
lanes.reduce((offset, lane) => {
|
|
193
|
+
offsets.set(lane.id, offset);
|
|
194
|
+
return offset + lane.height;
|
|
195
|
+
}, 0);
|
|
196
|
+
return intervals.flatMap((interval) => {
|
|
197
|
+
const x = offsets.get(interval.laneId);
|
|
198
|
+
const laneIndex = lanes.findIndex((candidate) => candidate.id === interval.laneId);
|
|
199
|
+
const lane = lanes.find((candidate) => candidate.id === interval.laneId);
|
|
200
|
+
return x === undefined || lane === undefined || laneIndex < 0 ? [] : [
|
|
201
|
+
{
|
|
202
|
+
...interval,
|
|
203
|
+
height: interval.extent,
|
|
204
|
+
laneIndex,
|
|
205
|
+
width: lane.height,
|
|
206
|
+
x,
|
|
207
|
+
y: interval.start
|
|
208
|
+
}
|
|
209
|
+
];
|
|
210
|
+
});
|
|
211
|
+
}
|
|
189
212
|
function resolveKeyboardDirection(key) {
|
|
190
213
|
if (key === "ArrowDown")
|
|
191
214
|
return "down";
|
|
@@ -7,11 +7,11 @@ import"../../chunks/Accordion-vbh3xqv6.js";
|
|
|
7
7
|
import"../../chunks/Accordion-2kv6p7by.js";
|
|
8
8
|
import"../../chunks/Accordion-w8zke8fa.js";
|
|
9
9
|
import"../../chunks/Accordion-snk6nggm.js";
|
|
10
|
-
import"../../chunks/Accordion-
|
|
10
|
+
import"../../chunks/Accordion-gb3mfjmx.js";
|
|
11
11
|
import"../../chunks/Accordion-5x4cv0kv.js";
|
|
12
12
|
import {
|
|
13
13
|
Calendar2
|
|
14
|
-
} from "../../chunks/Accordion-
|
|
14
|
+
} from "../../chunks/Accordion-95003ycq.js";
|
|
15
15
|
export {
|
|
16
16
|
Calendar2 as Calendar
|
|
17
17
|
};
|
|
@@ -4,15 +4,15 @@ import type { ZoraBaseProps } from './ColorPicker.dependency-0.js';
|
|
|
4
4
|
|
|
5
5
|
export type ColorPickerTab = 'grid' | 'wheel';
|
|
6
6
|
|
|
7
|
-
/** A consumer-owned OKLCH target from
|
|
7
|
+
/** A consumer-owned OKLCH target from a tone catalog. */
|
|
8
8
|
export interface ColorToneTarget {
|
|
9
9
|
readonly lightness: number;
|
|
10
10
|
readonly chroma: number;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Structural boundary for a
|
|
15
|
-
* neither the catalog nor its classifications.
|
|
14
|
+
* Structural boundary for a consumer-owned tone-pair entry. ZORA intentionally
|
|
15
|
+
* owns neither the catalog nor its classifications.
|
|
16
16
|
*/
|
|
17
17
|
export interface ColorToneDefinition {
|
|
18
18
|
readonly id: string;
|
|
@@ -2,15 +2,15 @@ import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';
|
|
|
2
2
|
|
|
3
3
|
import type { ZoraBaseProps } from './ColorTone.dependency-0.js';
|
|
4
4
|
|
|
5
|
-
/** A consumer-owned OKLCH target from
|
|
5
|
+
/** A consumer-owned OKLCH target from a tone catalog. */
|
|
6
6
|
export interface ColorToneTarget {
|
|
7
7
|
readonly lightness: number;
|
|
8
8
|
readonly chroma: number;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Structural boundary for a
|
|
13
|
-
* neither the catalog nor its classifications.
|
|
12
|
+
* Structural boundary for a consumer-owned tone-pair entry. ZORA intentionally
|
|
13
|
+
* owns neither the catalog nor its classifications.
|
|
14
14
|
*/
|
|
15
15
|
export interface ColorToneDefinition {
|
|
16
16
|
readonly id: string;
|
|
@@ -2,7 +2,7 @@ import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';
|
|
|
2
2
|
|
|
3
3
|
import type { ZoraBaseProps } from './ColorWheel.dependency-0.js';
|
|
4
4
|
|
|
5
|
-
/** A consumer-owned OKLCH target from
|
|
5
|
+
/** A consumer-owned OKLCH target from a tone catalog. */
|
|
6
6
|
export interface ColorToneTarget {
|
|
7
7
|
readonly lightness: number;
|
|
8
8
|
readonly chroma: number;
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
} from "../../chunks/Accordion-2kv6p7by.js";
|
|
17
17
|
import"../../chunks/Accordion-w8zke8fa.js";
|
|
18
18
|
import"../../chunks/Accordion-snk6nggm.js";
|
|
19
|
-
import"../../chunks/Accordion-
|
|
19
|
+
import"../../chunks/Accordion-gb3mfjmx.js";
|
|
20
20
|
import"../../chunks/Accordion-5x4cv0kv.js";
|
|
21
21
|
import {
|
|
22
22
|
Calendar2
|
|
23
|
-
} from "../../chunks/Accordion-
|
|
23
|
+
} from "../../chunks/Accordion-95003ycq.js";
|
|
24
24
|
import {
|
|
25
25
|
PickerHeader,
|
|
26
26
|
PickerField
|
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
import type { TimeGridProps } from './TimeGrid.types-0.js';
|
|
4
4
|
|
|
5
5
|
/*** Presents virtualized variable-height interval lanes through ZORA's shared GridView renderer. */
|
|
6
|
-
export declare function TimeGrid({ contentWidth, focusedIntervalId, height, interactionPolicy, intervals, lanes, onFocusedIntervalIdChange, onIntervalPress, onViewportChange, onVisibleIntervalIdsChange, overscanPixels, renderInterval, renderLaneLabel, revealPaddingPixels, selectedIntervalIds, testID, width, zoom, }: TimeGridProps): React.JSX.Element;
|
|
6
|
+
export declare function TimeGrid({ contentHeight: requestedContentHeight, contentWidth, focusedIntervalId, height, interactionPolicy, intervals, lanes, onFocusedIntervalIdChange, onIntervalPress, onViewportChange, onVisibleIntervalIdsChange, orientation, overscanPixels, renderInterval, renderLaneLabel, renderWorldLayer, revealPaddingPixels, selectedIntervalIds, testID, viewportControls, width, zoom, }: TimeGridProps): React.JSX.Element;
|
|
7
7
|
export type { TimeGridInterval, TimeGridLane, TimeGridProps } from './TimeGrid.types-0.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Pixel mapping handed to a world layer so it can draw in the same coordinates as the items. */
|
|
2
|
+
export interface GridWorldLayerContext {
|
|
3
|
+
/** Pixel position of world coordinate (0, 0) inside the layer. */
|
|
4
|
+
readonly origin: {
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
};
|
|
8
|
+
readonly pixelsPerUnitX: number;
|
|
9
|
+
readonly pixelsPerUnitY: number;
|
|
10
|
+
/** Pixel size of the scrollable layer. */
|
|
11
|
+
readonly width: number;
|
|
12
|
+
readonly height: number;
|
|
13
|
+
}
|
|
@@ -4,6 +4,8 @@ import type React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import type { ZoraBaseProps } from './TimeGrid.dependency-0.js';
|
|
6
6
|
|
|
7
|
+
import type { GridWorldLayerContext } from './TimeGrid.dependency-2.js';
|
|
8
|
+
|
|
7
9
|
/** An ordered, variable-height track rendered by the generic TimeGrid. */
|
|
8
10
|
export type TimeGridLane = GridLane;
|
|
9
11
|
|
|
@@ -18,8 +20,14 @@ export interface TimeGridProps extends ZoraBaseProps {
|
|
|
18
20
|
readonly lanes: readonly TimeGridLane[];
|
|
19
21
|
readonly intervals: readonly TimeGridInterval[];
|
|
20
22
|
readonly contentWidth: number;
|
|
23
|
+
/** Required for vertical time progression, where intervals extend down the grid. */
|
|
24
|
+
readonly contentHeight?: number;
|
|
21
25
|
readonly width: number;
|
|
22
26
|
readonly height: number;
|
|
27
|
+
/** Selects whether lane intervals progress across or down the shared GridView world. */
|
|
28
|
+
readonly orientation?: 'horizontal' | 'vertical';
|
|
29
|
+
/** Controls the shared viewport affordances for compositions that provide their own navigation. */
|
|
30
|
+
readonly viewportControls?: 'hidden' | 'visible';
|
|
23
31
|
readonly zoom?: number;
|
|
24
32
|
readonly overscanPixels?: number;
|
|
25
33
|
readonly focusedIntervalId?: string;
|
|
@@ -31,4 +39,6 @@ export interface TimeGridProps extends ZoraBaseProps {
|
|
|
31
39
|
readonly onVisibleIntervalIdsChange?: (ids: readonly string[]) => void;
|
|
32
40
|
readonly renderInterval: (interval: TimeGridInterval, selected: boolean) => React.ReactNode;
|
|
33
41
|
readonly renderLaneLabel?: (lane: TimeGridLane) => React.ReactNode;
|
|
42
|
+
/** Draws owner-defined geometry behind virtualized intervals without duplicating GridView. */
|
|
43
|
+
readonly renderWorldLayer?: (layer: GridWorldLayerContext) => React.ReactNode;
|
|
34
44
|
}
|
package/web-dist/manifest.json
CHANGED
|
@@ -510,10 +510,10 @@
|
|
|
510
510
|
"components/calendar/index.d.ts",
|
|
511
511
|
"chunks/Accordion-2kv6p7by.js",
|
|
512
512
|
"chunks/Accordion-5x4cv0kv.js",
|
|
513
|
-
"chunks/Accordion-
|
|
513
|
+
"chunks/Accordion-95003ycq.js",
|
|
514
514
|
"chunks/Accordion-e8tapf5a.js",
|
|
515
515
|
"chunks/Accordion-fkftnxgw.js",
|
|
516
|
-
"chunks/Accordion-
|
|
516
|
+
"chunks/Accordion-gb3mfjmx.js",
|
|
517
517
|
"chunks/Accordion-pagdkp07.js",
|
|
518
518
|
"chunks/Accordion-snk6nggm.js",
|
|
519
519
|
"chunks/Accordion-tnyqv1xv.js",
|
|
@@ -1054,12 +1054,12 @@
|
|
|
1054
1054
|
"components/date-picker/index.d.ts",
|
|
1055
1055
|
"chunks/Accordion-2kv6p7by.js",
|
|
1056
1056
|
"chunks/Accordion-5x4cv0kv.js",
|
|
1057
|
-
"chunks/Accordion-
|
|
1057
|
+
"chunks/Accordion-95003ycq.js",
|
|
1058
1058
|
"chunks/Accordion-dfr26j8m.js",
|
|
1059
1059
|
"chunks/Accordion-e8tapf5a.js",
|
|
1060
1060
|
"chunks/Accordion-e9jwetg7.js",
|
|
1061
1061
|
"chunks/Accordion-fkftnxgw.js",
|
|
1062
|
-
"chunks/Accordion-
|
|
1062
|
+
"chunks/Accordion-gb3mfjmx.js",
|
|
1063
1063
|
"chunks/Accordion-pagdkp07.js",
|
|
1064
1064
|
"chunks/Accordion-snk6nggm.js",
|
|
1065
1065
|
"chunks/Accordion-tnyqv1xv.js",
|
|
@@ -3320,10 +3320,11 @@
|
|
|
3320
3320
|
"components/time-grid/TimeGrid.d.ts",
|
|
3321
3321
|
"components/time-grid/TimeGrid.dependency-0.d.ts",
|
|
3322
3322
|
"components/time-grid/TimeGrid.dependency-1.d.ts",
|
|
3323
|
+
"components/time-grid/TimeGrid.dependency-2.d.ts",
|
|
3323
3324
|
"components/time-grid/TimeGrid.types-0.d.ts",
|
|
3324
3325
|
"components/time-grid/index.js",
|
|
3325
3326
|
"components/time-grid/index.d.ts",
|
|
3326
|
-
"chunks/Accordion-
|
|
3327
|
+
"chunks/Accordion-gb3mfjmx.js",
|
|
3327
3328
|
"chunks/Accordion-snk6nggm.js",
|
|
3328
3329
|
"chunks/Accordion-tnyqv1xv.js",
|
|
3329
3330
|
"chunks/Accordion-w8zke8fa.js"
|