@openbrf/display 0.0.0-stage → 0.1.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/LICENSE +661 -0
- package/LICENSE-EXCEPTION.md +28 -0
- package/README.md +126 -2
- package/dist/contract.d.ts +244 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +54 -0
- package/dist/contract.js.map +1 -0
- package/dist/fetch-loop.d.ts +87 -0
- package/dist/fetch-loop.d.ts.map +1 -0
- package/dist/fetch-loop.js +351 -0
- package/dist/fetch-loop.js.map +1 -0
- package/dist/fit.d.ts +44 -0
- package/dist/fit.d.ts.map +1 -0
- package/dist/fit.js +257 -0
- package/dist/fit.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/parse.d.ts +39 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +494 -0
- package/dist/parse.js.map +1 -0
- package/dist/renderer.d.ts +85 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +476 -0
- package/dist/renderer.js.map +1 -0
- package/dist/rotation.d.ts +129 -0
- package/dist/rotation.d.ts.map +1 -0
- package/dist/rotation.js +335 -0
- package/dist/rotation.js.map +1 -0
- package/dist/slides.d.ts +41 -0
- package/dist/slides.d.ts.map +1 -0
- package/dist/slides.js +341 -0
- package/dist/slides.js.map +1 -0
- package/dist/styles.d.ts +10 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +107 -0
- package/dist/styles.js.map +1 -0
- package/dist/text.d.ts +16 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +62 -0
- package/dist/text.js.map +1 -0
- package/dist/time.d.ts +39 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +94 -0
- package/dist/time.js.map +1 -0
- package/dist/translate.d.ts +18 -0
- package/dist/translate.d.ts.map +1 -0
- package/dist/translate.js +35 -0
- package/dist/translate.js.map +1 -0
- package/dist/words.d.ts +41 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +73 -0
- package/dist/words.js.map +1 -0
- package/package.json +58 -3
- package/src/contract.ts +279 -0
- package/src/fetch-loop.ts +472 -0
- package/src/fit.ts +348 -0
- package/src/index.ts +77 -0
- package/src/parse.ts +605 -0
- package/src/renderer.ts +708 -0
- package/src/rotation.ts +515 -0
- package/src/slides.ts +595 -0
- package/src/styles.ts +113 -0
- package/src/text.ts +65 -0
- package/src/time.ts +147 -0
- package/src/translate.ts +56 -0
- package/src/words.ts +91 -0
package/dist/slides.js
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { PAGED_LIST_ATTRIBUTE } from "./fit.js";
|
|
2
|
+
import { translate } from "./translate.js";
|
|
3
|
+
import { zonedDayStartAfter, zonedParts } from "./time.js";
|
|
4
|
+
/** The language tag a locale is formatted in: 24-hour, day before month. */
|
|
5
|
+
export function localeTag(locale) {
|
|
6
|
+
return locale === "sv" ? "sv-SE" : "en-GB";
|
|
7
|
+
}
|
|
8
|
+
const formatters = new Map();
|
|
9
|
+
/** Formats an instant in the screen's locale and time zone. */
|
|
10
|
+
export function formatTime(time, locale, timeZone, style) {
|
|
11
|
+
const key = `${locale}\u0000${timeZone}\u0000${style}`;
|
|
12
|
+
let formatter = formatters.get(key);
|
|
13
|
+
if (formatter === undefined) {
|
|
14
|
+
formatter = new Intl.DateTimeFormat(localeTag(locale), {
|
|
15
|
+
timeZone,
|
|
16
|
+
...FORMATS[style],
|
|
17
|
+
});
|
|
18
|
+
formatters.set(key, formatter);
|
|
19
|
+
}
|
|
20
|
+
return formatter.format(time);
|
|
21
|
+
}
|
|
22
|
+
const TIME = {
|
|
23
|
+
hour: "2-digit",
|
|
24
|
+
minute: "2-digit",
|
|
25
|
+
hourCycle: "h23",
|
|
26
|
+
};
|
|
27
|
+
const FORMATS = {
|
|
28
|
+
time: TIME,
|
|
29
|
+
date: { day: "numeric", month: "long" },
|
|
30
|
+
dayShort: { weekday: "short", day: "numeric", month: "short" },
|
|
31
|
+
weekdayDate: { weekday: "long", day: "numeric", month: "long" },
|
|
32
|
+
weekdayDateTime: {
|
|
33
|
+
weekday: "long",
|
|
34
|
+
day: "numeric",
|
|
35
|
+
month: "long",
|
|
36
|
+
...TIME,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/** The text with its first letter in capitals, as a heading starts. */
|
|
40
|
+
export function capitalised(text) {
|
|
41
|
+
return text.charAt(0).toLocaleUpperCase() + text.slice(1);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Empties `parent` and puts `nodes` in it. What `Element.replaceChildren`
|
|
45
|
+
* does, written with calls Chromium 85 has: that method came in 86.
|
|
46
|
+
*/
|
|
47
|
+
export function replaceContent(parent, ...nodes) {
|
|
48
|
+
parent.textContent = "";
|
|
49
|
+
parent.append(...nodes);
|
|
50
|
+
}
|
|
51
|
+
/** A new element, with a class and its text. */
|
|
52
|
+
export function element(document, tag, className, text) {
|
|
53
|
+
const node = document.createElement(tag);
|
|
54
|
+
if (className !== undefined) {
|
|
55
|
+
node.className = className;
|
|
56
|
+
}
|
|
57
|
+
if (text !== undefined) {
|
|
58
|
+
node.textContent = text;
|
|
59
|
+
}
|
|
60
|
+
return node;
|
|
61
|
+
}
|
|
62
|
+
/** A list the renderer may show a page at a time, when the canvas cannot hold all of it. */
|
|
63
|
+
function pagedList(document, tag, className) {
|
|
64
|
+
const list = element(document, tag, className);
|
|
65
|
+
list.setAttribute(PAGED_LIST_ATTRIBUTE, "");
|
|
66
|
+
return list;
|
|
67
|
+
}
|
|
68
|
+
/** The slide's body, or null when it cannot be shown now (a picture slide without its picture). */
|
|
69
|
+
export function renderSlide(slide, context) {
|
|
70
|
+
const { body } = slide;
|
|
71
|
+
switch (body.kind) {
|
|
72
|
+
case "news":
|
|
73
|
+
return news(body, context);
|
|
74
|
+
case "events":
|
|
75
|
+
return events(body, context);
|
|
76
|
+
case "meeting":
|
|
77
|
+
return meeting(body, context);
|
|
78
|
+
case "availability":
|
|
79
|
+
return availability(body, context);
|
|
80
|
+
case "picture":
|
|
81
|
+
return picture(body, context);
|
|
82
|
+
case "text":
|
|
83
|
+
return text(body, context);
|
|
84
|
+
case "table":
|
|
85
|
+
return table(body, context);
|
|
86
|
+
case "doors":
|
|
87
|
+
return doors(body, context);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function container(context, kind) {
|
|
91
|
+
return element(context.document, "section", `obrf-display-slide obrf-display-${kind}`);
|
|
92
|
+
}
|
|
93
|
+
function image(ref, url, context) {
|
|
94
|
+
const img = element(context.document, "img", "obrf-display-picture");
|
|
95
|
+
img.alt = ref.alt;
|
|
96
|
+
img.decoding = "async";
|
|
97
|
+
img.addEventListener("error", () => context.pictureFailed(ref), {
|
|
98
|
+
once: true,
|
|
99
|
+
});
|
|
100
|
+
img.src = url;
|
|
101
|
+
return img;
|
|
102
|
+
}
|
|
103
|
+
function news(body, context) {
|
|
104
|
+
const { document } = context;
|
|
105
|
+
const section = container(context, "news");
|
|
106
|
+
const copy = element(document, "div", "obrf-display-copy");
|
|
107
|
+
const published = Date.parse(body.publishedAt);
|
|
108
|
+
copy.append(element(document, "p", "obrf-display-date", formatTime(published, context.locale, context.timeZone, "date")), element(document, "h2", "obrf-display-heading", body.title), ...body.paragraphs.map((paragraph) => element(document, "p", "obrf-display-text", paragraph)));
|
|
109
|
+
section.append(copy);
|
|
110
|
+
const url = body.picture === null ? null : context.pictureUrl(body.picture);
|
|
111
|
+
if (body.picture !== null && url !== null) {
|
|
112
|
+
section.classList.add("obrf-display-news--picture");
|
|
113
|
+
section.append(image(body.picture, url, context));
|
|
114
|
+
}
|
|
115
|
+
return section;
|
|
116
|
+
}
|
|
117
|
+
function timeRange(start, end, context) {
|
|
118
|
+
const { locale, timeZone } = context;
|
|
119
|
+
const from = formatTime(start, locale, timeZone, "time");
|
|
120
|
+
const sameDay = zonedDayStartAfter(start, 0, timeZone) ===
|
|
121
|
+
zonedDayStartAfter(end, 0, timeZone);
|
|
122
|
+
const to = sameDay
|
|
123
|
+
? formatTime(end, locale, timeZone, "time")
|
|
124
|
+
: `${formatTime(end, locale, timeZone, "dayShort")} ${formatTime(end, locale, timeZone, "time")}`;
|
|
125
|
+
return translate(locale, "timeRange", { from, to });
|
|
126
|
+
}
|
|
127
|
+
function events(body, context) {
|
|
128
|
+
const { document, locale, timeZone } = context;
|
|
129
|
+
const section = container(context, "events");
|
|
130
|
+
section.append(element(document, "h2", "obrf-display-heading", translate(locale, "comingEvents")));
|
|
131
|
+
const list = pagedList(document, "ol", "obrf-display-list");
|
|
132
|
+
for (const occurrence of body.occurrences) {
|
|
133
|
+
const start = Date.parse(occurrence.startsAt);
|
|
134
|
+
const end = Date.parse(occurrence.endsAt);
|
|
135
|
+
const item = element(document, "li", "obrf-display-event");
|
|
136
|
+
const when = element(document, "div", "obrf-display-when");
|
|
137
|
+
when.append(element(document, "span", undefined, capitalised(formatTime(start, locale, timeZone, "dayShort"))), element(document, "span", undefined, timeRange(start, end, context)));
|
|
138
|
+
const what = element(document, "div", "obrf-display-what");
|
|
139
|
+
what.append(element(document, "p", "obrf-display-title", occurrence.title));
|
|
140
|
+
if (occurrence.location !== null) {
|
|
141
|
+
what.append(element(document, "p", "obrf-display-text obrf-display-muted", occurrence.location));
|
|
142
|
+
}
|
|
143
|
+
if (occurrence.description !== null) {
|
|
144
|
+
what.append(element(document, "p", "obrf-display-description", occurrence.description));
|
|
145
|
+
}
|
|
146
|
+
if (occurrence.calledOff) {
|
|
147
|
+
item.classList.add("obrf-display-event--called-off");
|
|
148
|
+
what.append(element(document, "span", "obrf-display-badge", translate(locale, "calledOff")));
|
|
149
|
+
}
|
|
150
|
+
else if (occurrence.placesLeft !== null) {
|
|
151
|
+
what.append(element(document, "p", "obrf-display-text", occurrence.placesLeft === 0
|
|
152
|
+
? translate(locale, "fullyBooked")
|
|
153
|
+
: translate(locale, "placesLeft", { count: occurrence.placesLeft })));
|
|
154
|
+
}
|
|
155
|
+
item.append(when, what);
|
|
156
|
+
list.append(item);
|
|
157
|
+
}
|
|
158
|
+
section.append(list);
|
|
159
|
+
return section;
|
|
160
|
+
}
|
|
161
|
+
function meeting(body, context) {
|
|
162
|
+
const { document, locale, timeZone } = context;
|
|
163
|
+
const section = container(context, "meeting");
|
|
164
|
+
section.append(element(document, "h2", "obrf-display-heading", translate(locale, body.meetingKind === "extraordinary"
|
|
165
|
+
? "extraordinaryMeeting"
|
|
166
|
+
: "ordinaryMeeting")));
|
|
167
|
+
const facts = element(document, "dl", "obrf-display-facts");
|
|
168
|
+
const fact = (term, value, className) => {
|
|
169
|
+
facts.append(element(document, "dt", undefined, term), element(document, "dd", className, value));
|
|
170
|
+
};
|
|
171
|
+
fact(translate(locale, "meetingWhen"), capitalised(formatTime(Date.parse(body.startsAt), locale, timeZone, "weekdayDateTime")), "obrf-display-data");
|
|
172
|
+
fact(translate(locale, "meetingWhere"), body.place);
|
|
173
|
+
if (body.digitalParticipation !== null) {
|
|
174
|
+
fact(translate(locale, "digitalParticipation"), body.digitalParticipation);
|
|
175
|
+
}
|
|
176
|
+
section.append(facts);
|
|
177
|
+
if (body.agenda.length > 0) {
|
|
178
|
+
const agenda = pagedList(document, "ol", "obrf-display-agenda");
|
|
179
|
+
for (const item of body.agenda) {
|
|
180
|
+
const entry = element(document, "li");
|
|
181
|
+
entry.append(element(document, "span", "obrf-display-agenda-position", `${item.position}.`), element(document, "span", undefined, item.title));
|
|
182
|
+
agenda.append(entry);
|
|
183
|
+
}
|
|
184
|
+
section.append(element(document, "h3", "obrf-display-subheading", translate(locale, "agenda")), agenda);
|
|
185
|
+
}
|
|
186
|
+
return section;
|
|
187
|
+
}
|
|
188
|
+
function availability(body, context) {
|
|
189
|
+
const { document, locale, timeZone, now } = context;
|
|
190
|
+
const section = container(context, "availability");
|
|
191
|
+
section.append(element(document, "h2", "obrf-display-heading", translate(locale, "freeAndBusy")));
|
|
192
|
+
const documentFrom = Date.parse(body.from);
|
|
193
|
+
const to = Date.parse(body.to);
|
|
194
|
+
const todayStart = zonedDayStartAfter(now, 0, timeZone);
|
|
195
|
+
const tomorrowStart = zonedDayStartAfter(now, 1, timeZone);
|
|
196
|
+
const dayAfterStart = zonedDayStartAfter(now, 2, timeZone);
|
|
197
|
+
// A day is shown only as far as the document knows it: from the later of the
|
|
198
|
+
// day's start (on today, now) and the document's `from`, to the earlier of
|
|
199
|
+
// the day's end and the document's `to`. What lies outside is not said.
|
|
200
|
+
const days = [];
|
|
201
|
+
const addDay = (label, dayStart, dayEnd, today) => {
|
|
202
|
+
const wanted = today ? Math.max(dayStart, now) : dayStart;
|
|
203
|
+
const known = Math.max(wanted, documentFrom);
|
|
204
|
+
const end = Math.min(dayEnd, to);
|
|
205
|
+
if (end > known) {
|
|
206
|
+
days.push({
|
|
207
|
+
label,
|
|
208
|
+
dayStart,
|
|
209
|
+
dayEnd,
|
|
210
|
+
from: known,
|
|
211
|
+
end,
|
|
212
|
+
whole: known === wanted && end === dayEnd,
|
|
213
|
+
today,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
addDay(translate(locale, "today"), todayStart, tomorrowStart, true);
|
|
218
|
+
addDay(translate(locale, "tomorrow"), tomorrowStart, dayAfterStart, false);
|
|
219
|
+
const list = pagedList(document, "ul", "obrf-display-resources");
|
|
220
|
+
for (const resource of body.resources) {
|
|
221
|
+
const item = element(document, "li", "obrf-display-resource");
|
|
222
|
+
item.append(element(document, "p", "obrf-display-title", resource.name));
|
|
223
|
+
for (const day of days) {
|
|
224
|
+
const row = element(document, "p", "obrf-display-day");
|
|
225
|
+
row.append(element(document, "span", "obrf-display-day-label", day.label));
|
|
226
|
+
const busy = resource.busy
|
|
227
|
+
.map((interval) => ({
|
|
228
|
+
start: Date.parse(interval.start),
|
|
229
|
+
end: Date.parse(interval.end),
|
|
230
|
+
}))
|
|
231
|
+
.filter(({ start, end }) => end > day.from && start < day.end);
|
|
232
|
+
if (busy.length === 0) {
|
|
233
|
+
row.append(element(document, "span", day.whole ? undefined : "obrf-display-data", day.whole
|
|
234
|
+
? translate(locale, day.today ? "freeRestOfDay" : "freeAllDay")
|
|
235
|
+
: translate(locale, "freeBetween", {
|
|
236
|
+
from: formatTime(day.from, locale, timeZone, "time"),
|
|
237
|
+
to: formatTime(day.end, locale, timeZone, "time"),
|
|
238
|
+
})));
|
|
239
|
+
}
|
|
240
|
+
else if (day.whole &&
|
|
241
|
+
busy.length === 1 &&
|
|
242
|
+
busy[0] !== undefined &&
|
|
243
|
+
busy[0].start <= day.from &&
|
|
244
|
+
busy[0].end >= day.end) {
|
|
245
|
+
row.append(element(document, "span", "obrf-display-busy", translate(locale, "busyAllDay")));
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
row.append(element(document, "span", undefined, translate(locale, "busy")));
|
|
249
|
+
for (const interval of busy) {
|
|
250
|
+
const start = Math.max(interval.start, day.dayStart);
|
|
251
|
+
const end = Math.min(interval.end, day.dayEnd);
|
|
252
|
+
row.append(element(document, "span", "obrf-display-busy obrf-display-data", translate(locale, "timeRange", {
|
|
253
|
+
from: formatTime(start, locale, timeZone, "time"),
|
|
254
|
+
to: end === day.dayEnd
|
|
255
|
+
? "24:00"
|
|
256
|
+
: formatTime(end, locale, timeZone, "time"),
|
|
257
|
+
})));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
item.append(row);
|
|
261
|
+
}
|
|
262
|
+
list.append(item);
|
|
263
|
+
}
|
|
264
|
+
section.append(list);
|
|
265
|
+
return section;
|
|
266
|
+
}
|
|
267
|
+
function picture(body, context) {
|
|
268
|
+
const url = context.pictureUrl(body.picture);
|
|
269
|
+
if (url === null) {
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
const { document } = context;
|
|
273
|
+
const section = container(context, "picture");
|
|
274
|
+
const figure = element(document, "figure", "obrf-display-figure");
|
|
275
|
+
figure.append(image(body.picture, url, context));
|
|
276
|
+
if (body.caption !== null) {
|
|
277
|
+
figure.append(element(document, "figcaption", "obrf-display-caption", body.caption));
|
|
278
|
+
}
|
|
279
|
+
section.append(figure);
|
|
280
|
+
return section;
|
|
281
|
+
}
|
|
282
|
+
function text(body, context) {
|
|
283
|
+
const { document } = context;
|
|
284
|
+
const section = container(context, "addon-text");
|
|
285
|
+
section.append(element(document, "h2", "obrf-display-heading", body.heading), ...body.body.map((paragraph) => element(document, "p", "obrf-display-text", paragraph)));
|
|
286
|
+
return section;
|
|
287
|
+
}
|
|
288
|
+
function table(body, context) {
|
|
289
|
+
const { document } = context;
|
|
290
|
+
const section = container(context, "addon-table");
|
|
291
|
+
const grid = element(document, "table", "obrf-display-table");
|
|
292
|
+
const head = element(document, "thead");
|
|
293
|
+
const headRow = element(document, "tr");
|
|
294
|
+
for (const column of body.columns) {
|
|
295
|
+
const cell = element(document, "th", undefined, column);
|
|
296
|
+
cell.scope = "col";
|
|
297
|
+
headRow.append(cell);
|
|
298
|
+
}
|
|
299
|
+
head.append(headRow);
|
|
300
|
+
const rows = pagedList(document, "tbody");
|
|
301
|
+
for (const row of body.rows) {
|
|
302
|
+
const line = element(document, "tr");
|
|
303
|
+
for (const cell of row) {
|
|
304
|
+
line.append(element(document, "td", undefined, cell));
|
|
305
|
+
}
|
|
306
|
+
rows.append(line);
|
|
307
|
+
}
|
|
308
|
+
grid.append(head, rows);
|
|
309
|
+
section.append(element(document, "h2", "obrf-display-heading", body.heading), grid);
|
|
310
|
+
return section;
|
|
311
|
+
}
|
|
312
|
+
function doors(body, context) {
|
|
313
|
+
const { document, locale } = context;
|
|
314
|
+
const section = container(context, "addon-doors");
|
|
315
|
+
const list = pagedList(document, "ul", "obrf-display-doors");
|
|
316
|
+
for (const door of body.doors) {
|
|
317
|
+
const item = element(document, "li", "obrf-display-door");
|
|
318
|
+
item.append(element(document, "span", "obrf-display-door-apartment", door.apartment));
|
|
319
|
+
if (door.floor !== null) {
|
|
320
|
+
item.append(element(document, "span", "obrf-display-muted", translate(locale, "floor", { floor: door.floor })));
|
|
321
|
+
}
|
|
322
|
+
for (const name of door.names) {
|
|
323
|
+
item.append(element(document, "span", undefined, name));
|
|
324
|
+
}
|
|
325
|
+
list.append(item);
|
|
326
|
+
}
|
|
327
|
+
section.append(element(document, "h2", "obrf-display-heading", body.heading), list);
|
|
328
|
+
return section;
|
|
329
|
+
}
|
|
330
|
+
/** Whether the zone's wall clock at `time` is inside one of the windows. */
|
|
331
|
+
export function inSchedule(windows, time, timeZone) {
|
|
332
|
+
if (windows.length === 0) {
|
|
333
|
+
return true;
|
|
334
|
+
}
|
|
335
|
+
const parts = zonedParts(time, timeZone);
|
|
336
|
+
const clock = `${String(parts.hour).padStart(2, "0")}:${String(parts.minute).padStart(2, "0")}`;
|
|
337
|
+
return windows.some((window) => window.days.includes(parts.weekday) &&
|
|
338
|
+
window.from <= clock &&
|
|
339
|
+
clock < window.to);
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=slides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slides.js","sourceRoot":"","sources":["../src/slides.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAc3D,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,MAAoB;IAC5C,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE1D,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CACxB,IAAY,EACZ,MAAoB,EACpB,QAAgB,EAChB,KAAuE;IAEvE,MAAM,GAAG,GAAG,GAAG,MAAM,SAAS,QAAQ,SAAS,KAAK,EAAE,CAAC;IAC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IAAI,CACjB,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;QACnC,MAAM,CAAC,IAAI,IAAI,KAAK;QACpB,KAAK,GAAG,MAAM,CAAC,EAAE,CACpB,CAAC;AACJ,CAAC"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stylesheet `mountRenderer` adds to the document once, as a `<style>`
|
|
3
|
+
* element with the attribute `data-obrf-display`. Exported for a page that
|
|
4
|
+
* would rather serve it as a file of its own, as a page under a strict content
|
|
5
|
+
* security policy has to: it passes `stylesheet: false` to `mountRenderer` and
|
|
6
|
+
* links the file with the same attribute. Written for Chromium 85, so a
|
|
7
|
+
* selector list inside `:not()`, `inset` and the like stay out of it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DISPLAY_STYLESHEET: string;
|
|
10
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QA6D9B,CAAC"}
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The renderer's stylesheet.
|
|
3
|
+
*
|
|
4
|
+
* Its colours, type, shape and motion are the default theme's (Porttavlan,
|
|
5
|
+
* from `@openbrf/tokens`), so a screen looks like the association's own pages,
|
|
6
|
+
* and every pair it sets on another is one the token contract holds to WCAG
|
|
7
|
+
* AA. Dates, times and apartment numbers are in the data face, as everywhere
|
|
8
|
+
* else (DESIGN.md, the Mono-Grid Rule).
|
|
9
|
+
* A screen is read from across a stairwell, so every size is a fraction of the
|
|
10
|
+
* canvas's shorter side (`--obrf-display-u`, a hundredth of it), which the
|
|
11
|
+
* renderer sets from the element it is mounted on.
|
|
12
|
+
*
|
|
13
|
+
* Every class starts with `obrf-display`, so the sheet restyles nothing of the
|
|
14
|
+
* page it is mounted in.
|
|
15
|
+
*/
|
|
16
|
+
import { PORTTAVLAN_DARK, PORTTAVLAN_LIGHT, } from "@openbrf/tokens";
|
|
17
|
+
import { ELSEWHERE_ATTRIBUTE } from "./fit.js";
|
|
18
|
+
function palette(tokens) {
|
|
19
|
+
return [
|
|
20
|
+
`--obrf-display-ground: ${tokens["surface-page"]};`,
|
|
21
|
+
`--obrf-display-panel: ${tokens["surface-raised"]};`,
|
|
22
|
+
`--obrf-display-ink: ${tokens["text-primary"]};`,
|
|
23
|
+
`--obrf-display-muted: ${tokens["text-secondary"]};`,
|
|
24
|
+
`--obrf-display-accent: ${tokens["accent-trust"]};`,
|
|
25
|
+
`--obrf-display-danger: ${tokens["status-danger"]};`,
|
|
26
|
+
`--obrf-display-on-danger: ${tokens["on-status-danger"]};`,
|
|
27
|
+
`--obrf-display-rule: ${tokens["border-subtle"]};`,
|
|
28
|
+
`--obrf-display-font: ${tokens["font-ui"]};`,
|
|
29
|
+
`--obrf-display-data-font: ${tokens["font-data"]};`,
|
|
30
|
+
`--obrf-display-radius-control: ${tokens["radius-control"]};`,
|
|
31
|
+
`--obrf-display-radius-panel: ${tokens["radius-panel"]};`,
|
|
32
|
+
`--obrf-display-motion-duration: ${tokens["motion-duration"]};`,
|
|
33
|
+
`--obrf-display-motion-easing: ${tokens["motion-easing"]};`,
|
|
34
|
+
].join(" ");
|
|
35
|
+
}
|
|
36
|
+
const u = (times) => `calc(var(--obrf-display-u) * ${times})`;
|
|
37
|
+
/**
|
|
38
|
+
* The stylesheet `mountRenderer` adds to the document once, as a `<style>`
|
|
39
|
+
* element with the attribute `data-obrf-display`. Exported for a page that
|
|
40
|
+
* would rather serve it as a file of its own, as a page under a strict content
|
|
41
|
+
* security policy has to: it passes `stylesheet: false` to `mountRenderer` and
|
|
42
|
+
* links the file with the same attribute. Written for Chromium 85, so a
|
|
43
|
+
* selector list inside `:not()`, `inset` and the like stay out of it.
|
|
44
|
+
*/
|
|
45
|
+
export const DISPLAY_STYLESHEET = `
|
|
46
|
+
.obrf-display { --obrf-display-u: 1vmin; position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--obrf-display-ground); color: var(--obrf-display-ink); font-family: var(--obrf-display-font); }
|
|
47
|
+
.obrf-display--light { ${palette(PORTTAVLAN_LIGHT)} color-scheme: light; }
|
|
48
|
+
.obrf-display--dark { ${palette(PORTTAVLAN_DARK)} color-scheme: dark; }
|
|
49
|
+
.obrf-display [hidden] { display: none !important; }
|
|
50
|
+
.obrf-display [${ELSEWHERE_ATTRIBUTE}]:not(td):not(th) { display: none !important; }
|
|
51
|
+
.obrf-display *, .obrf-display *::before, .obrf-display *::after { box-sizing: border-box; }
|
|
52
|
+
.obrf-display-canvas { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: ${u(2.5)}; padding: ${u(4)} ${u(5)}; font-size: ${u(3.4)}; line-height: 1.3; }
|
|
53
|
+
.obrf-display-clock { display: flex; justify-content: space-between; align-items: baseline; gap: ${u(3)}; padding-bottom: ${u(1.5)}; border-bottom: ${u(0.25)} solid var(--obrf-display-rule); color: var(--obrf-display-muted); font-size: ${u(3.6)}; }
|
|
54
|
+
.obrf-display-clock, .obrf-display-date, .obrf-display-when, .obrf-display-door-apartment, .obrf-display-data { font-family: var(--obrf-display-data-font); }
|
|
55
|
+
.obrf-display-clock-time { color: var(--obrf-display-ink); font-size: ${u(5)}; font-weight: 700; font-variant-numeric: tabular-nums; }
|
|
56
|
+
.obrf-display-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
|
|
57
|
+
.obrf-display-slide { display: flex; flex-direction: column; gap: ${u(2.5)}; height: 100%; min-height: 0; overflow: hidden; font-size: ${u(3.4)}; }
|
|
58
|
+
.obrf-display-slide--enter { animation: obrf-display-enter var(--obrf-display-motion-duration) var(--obrf-display-motion-easing); }
|
|
59
|
+
@keyframes obrf-display-enter { from { opacity: 0; } to { opacity: 1; } }
|
|
60
|
+
@media (prefers-reduced-motion: reduce) { .obrf-display-slide--enter { animation: none; } }
|
|
61
|
+
.obrf-display-heading { margin: 0; font-size: ${u(6.5)}; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
|
|
62
|
+
.obrf-display-subheading { margin: 0; font-size: ${u(4)}; font-weight: 700; color: var(--obrf-display-muted); }
|
|
63
|
+
.obrf-display-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
|
|
64
|
+
.obrf-display-muted { color: var(--obrf-display-muted); }
|
|
65
|
+
.obrf-display-date { margin: 0; color: var(--obrf-display-accent); font-weight: 700; }
|
|
66
|
+
.obrf-display-news { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
|
|
67
|
+
.obrf-display-news--picture { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: ${u(5)}; }
|
|
68
|
+
.obrf-display--portrait .obrf-display-news--picture { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
|
|
69
|
+
.obrf-display-copy { display: flex; flex-direction: column; gap: ${u(2)}; min-height: 0; overflow: hidden; }
|
|
70
|
+
.obrf-display-picture { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
|
|
71
|
+
.obrf-display-figure { display: flex; flex-direction: column; gap: ${u(2)}; height: 100%; margin: 0; }
|
|
72
|
+
.obrf-display-figure .obrf-display-picture { flex: 1 1 auto; }
|
|
73
|
+
.obrf-display-caption { font-size: ${u(4)}; text-align: center; }
|
|
74
|
+
.obrf-display-list { display: flex; flex-direction: column; gap: ${u(2)}; margin: 0; padding: 0; list-style: none; }
|
|
75
|
+
.obrf-display-event { display: grid; grid-template-columns: ${u(24)} minmax(0, 1fr); gap: ${u(3)}; padding-bottom: ${u(1.5)}; border-bottom: ${u(0.2)} solid var(--obrf-display-rule); }
|
|
76
|
+
.obrf-display-when { display: flex; flex-direction: column; color: var(--obrf-display-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
|
|
77
|
+
.obrf-display-what { grid-column: 2; display: flex; flex-direction: column; gap: ${u(0.5)}; min-width: 0; }
|
|
78
|
+
.obrf-display-title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
|
|
79
|
+
.obrf-display-event--called-off .obrf-display-title { text-decoration: line-through; }
|
|
80
|
+
.obrf-display-description { margin: 0; color: var(--obrf-display-muted); font-size: ${u(2.8)}; white-space: pre-line; overflow-wrap: anywhere; }
|
|
81
|
+
.obrf-display-badge { align-self: flex-start; padding: 0 ${u(1)}; border-radius: var(--obrf-display-radius-control); background: var(--obrf-display-danger); color: var(--obrf-display-on-danger); font-weight: 700; }
|
|
82
|
+
.obrf-display-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: ${u(1)} ${u(3)}; margin: 0; }
|
|
83
|
+
.obrf-display-facts dt { grid-column: 1; color: var(--obrf-display-muted); }
|
|
84
|
+
.obrf-display-facts dd { grid-column: 2; margin: 0; font-weight: 700; white-space: pre-line; overflow-wrap: anywhere; }
|
|
85
|
+
.obrf-display-agenda { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: ${u(5)}; font-size: ${u(3)}; }
|
|
86
|
+
.obrf-display--portrait .obrf-display-agenda { columns: 1; }
|
|
87
|
+
.obrf-display-agenda li { break-inside: avoid; display: flex; gap: ${u(1.5)}; }
|
|
88
|
+
.obrf-display-agenda-position { min-width: ${u(4)}; color: var(--obrf-display-muted); font-variant-numeric: tabular-nums; }
|
|
89
|
+
.obrf-display-resources { display: grid; grid-template-columns: repeat(auto-fill, minmax(${u(52)}, 1fr)); gap: ${u(2)}; margin: 0; padding: 0; list-style: none; }
|
|
90
|
+
.obrf-display-resource { display: flex; flex-direction: column; gap: ${u(0.8)}; padding: ${u(1.5)} ${u(2)}; border-radius: var(--obrf-display-radius-panel); background: var(--obrf-display-panel); }
|
|
91
|
+
.obrf-display-day { display: flex; margin: 0; flex-wrap: wrap; gap: ${u(0.5)} ${u(1.5)}; font-size: ${u(2.8)}; }
|
|
92
|
+
.obrf-display-day-label { min-width: ${u(14)}; color: var(--obrf-display-muted); }
|
|
93
|
+
.obrf-display-busy { font-weight: 700; font-variant-numeric: tabular-nums; }
|
|
94
|
+
.obrf-display-table { width: 100%; border-collapse: collapse; }
|
|
95
|
+
.obrf-display-table th, .obrf-display-table td { padding: ${u(0.8)} ${u(1.5)}; border-bottom: ${u(0.2)} solid var(--obrf-display-rule); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
|
|
96
|
+
.obrf-display-table th { color: var(--obrf-display-muted); }
|
|
97
|
+
.obrf-display-doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(${u(30)}, 1fr)); gap: ${u(1.5)}; margin: 0; padding: 0; list-style: none; font-size: ${u(2.8)}; }
|
|
98
|
+
.obrf-display-door { display: flex; flex-direction: column; padding: ${u(1)} ${u(1.5)}; border-radius: var(--obrf-display-radius-panel); background: var(--obrf-display-panel); }
|
|
99
|
+
.obrf-display-door-apartment { font-weight: 700; }
|
|
100
|
+
.obrf-display-message { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: ${u(3)}; height: 100%; text-align: center; }
|
|
101
|
+
.obrf-display-message-title { margin: 0; font-size: ${u(7)}; font-weight: 700; }
|
|
102
|
+
.obrf-display-empty { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; color: var(--obrf-display-muted); font-size: ${u(4)}; }
|
|
103
|
+
.obrf-display-message-detail { max-width: 40ch; margin: 0; color: var(--obrf-display-muted); font-size: ${u(4)}; }
|
|
104
|
+
.obrf-display-note { position: absolute; right: ${u(2)}; bottom: ${u(1.2)}; color: var(--obrf-display-muted); font-size: ${u(2.2)}; }
|
|
105
|
+
.obrf-display-off { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; background: black; }
|
|
106
|
+
`;
|
|
107
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|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DAGgB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC;;uFAEf,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC,GAAG,CAAC;uEAC3G,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;;oHAE+B,CAAC,CAAC,CAAC,CAAC;sDAClE,CAAC,CAAC,CAAC,CAAC;2JACiG,CAAC,CAAC,CAAC,CAAC;0GACrD,CAAC,CAAC,CAAC,CAAC;kDAC5D,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC,GAAG,CAAC;;CAEhI,CAAC"}
|
package/dist/text.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortening a text to a limit of the contract, the way the contract says:
|
|
3
|
+
* ending it with "…", the ellipsis counted within the limit.
|
|
4
|
+
*
|
|
5
|
+
* Measured in UTF-16 code units, which is never more lenient than the
|
|
6
|
+
* contract's code points, and never cutting a surrogate pair in two.
|
|
7
|
+
*/
|
|
8
|
+
/** The text as it is when within `max`, and otherwise shortened to it with "…". */
|
|
9
|
+
export declare function shortenText(text: string, max: number): string;
|
|
10
|
+
/**
|
|
11
|
+
* Texts that are at most `max` together: blank ones dropped, and the first one
|
|
12
|
+
* that does not fit shortened with "…", or left out with the ellipsis on the
|
|
13
|
+
* one before it when too little room is left to say anything.
|
|
14
|
+
*/
|
|
15
|
+
export declare function shortenTexts(texts: readonly string[], max: number): string[];
|
|
16
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7D;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAwB5E"}
|
package/dist/text.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortening a text to a limit of the contract, the way the contract says:
|
|
3
|
+
* ending it with "…", the ellipsis counted within the limit.
|
|
4
|
+
*
|
|
5
|
+
* Measured in UTF-16 code units, which is never more lenient than the
|
|
6
|
+
* contract's code points, and never cutting a surrogate pair in two.
|
|
7
|
+
*/
|
|
8
|
+
const ELLIPSIS = "…";
|
|
9
|
+
/** The text cut to leave room for the ellipsis within `max`, and the ellipsis. */
|
|
10
|
+
function withEllipsis(text, max) {
|
|
11
|
+
if (max < 1) {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
let base = text.trimEnd();
|
|
15
|
+
if (base.length + 1 > max) {
|
|
16
|
+
let cut = max - 1;
|
|
17
|
+
const last = base.charCodeAt(cut - 1);
|
|
18
|
+
if (last >= 0xd800 && last <= 0xdbff) {
|
|
19
|
+
cut -= 1;
|
|
20
|
+
}
|
|
21
|
+
base = base.slice(0, cut).trimEnd();
|
|
22
|
+
}
|
|
23
|
+
return `${base}${ELLIPSIS}`;
|
|
24
|
+
}
|
|
25
|
+
/** The text as it is when within `max`, and otherwise shortened to it with "…". */
|
|
26
|
+
export function shortenText(text, max) {
|
|
27
|
+
return text.length <= max ? text : withEllipsis(text, max);
|
|
28
|
+
}
|
|
29
|
+
/** Below this, the start of a further paragraph says nothing worth its room. */
|
|
30
|
+
const SHORTEST_FRAGMENT = 20;
|
|
31
|
+
/**
|
|
32
|
+
* Texts that are at most `max` together: blank ones dropped, and the first one
|
|
33
|
+
* that does not fit shortened with "…", or left out with the ellipsis on the
|
|
34
|
+
* one before it when too little room is left to say anything.
|
|
35
|
+
*/
|
|
36
|
+
export function shortenTexts(texts, max) {
|
|
37
|
+
const kept = [];
|
|
38
|
+
let left = max;
|
|
39
|
+
for (const text of texts) {
|
|
40
|
+
if (text.trim() === "") {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (text.length <= left) {
|
|
44
|
+
kept.push(text);
|
|
45
|
+
left -= text.length;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (left >= SHORTEST_FRAGMENT || kept.length === 0) {
|
|
49
|
+
const fragment = withEllipsis(text, left);
|
|
50
|
+
if (fragment !== "") {
|
|
51
|
+
kept.push(fragment);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const last = kept.pop() ?? "";
|
|
56
|
+
kept.push(withEllipsis(last, last.length + left));
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
return kept;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=text.js.map
|
package/dist/text.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,kFAAkF;AAClF,SAAS,YAAY,CAAC,IAAY,EAAE,GAAW;IAC7C,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;QAC1B,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;YACrC,GAAG,IAA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AC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,MAAM;IACR,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/time.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instants and the calendar day of a time zone, with nothing but `Intl`.
|
|
3
|
+
*
|
|
4
|
+
* The association's day is the document's `timeZone`, never the browser's:
|
|
5
|
+
* a screen whose clock is set to another zone still shows Stockholm's today.
|
|
6
|
+
*/
|
|
7
|
+
import type { Instant, IsoWeekday } from "./contract.ts";
|
|
8
|
+
/** A calendar date and a time of day, as a wall clock in one zone shows it. */
|
|
9
|
+
export interface ZonedParts {
|
|
10
|
+
year: number;
|
|
11
|
+
/** 1 to 12. */
|
|
12
|
+
month: number;
|
|
13
|
+
day: number;
|
|
14
|
+
/** 0 to 23. */
|
|
15
|
+
hour: number;
|
|
16
|
+
minute: number;
|
|
17
|
+
second: number;
|
|
18
|
+
weekday: IsoWeekday;
|
|
19
|
+
}
|
|
20
|
+
declare const MINUTE: number;
|
|
21
|
+
declare const DAY: number;
|
|
22
|
+
/** Whether `Intl` knows the zone. */
|
|
23
|
+
export declare function isTimeZone(timeZone: string): boolean;
|
|
24
|
+
/** The wall clock of `timeZone` at an instant. */
|
|
25
|
+
export declare function zonedParts(time: number, timeZone: string): ZonedParts;
|
|
26
|
+
/**
|
|
27
|
+
* The first instant of a calendar date in `timeZone`: its midnight, or, in a
|
|
28
|
+
* zone that skips midnight on the day the clocks go forward, the moment the
|
|
29
|
+
* day begins.
|
|
30
|
+
*/
|
|
31
|
+
export declare function zonedDayStart(year: number, month: number, day: number, timeZone: string): number;
|
|
32
|
+
/** The first instant of the calendar day `days` after the one `time` falls on. */
|
|
33
|
+
export declare function zonedDayStartAfter(time: number, days: number, timeZone: string): number;
|
|
34
|
+
/** An instant floored to its minute. */
|
|
35
|
+
export declare function floorToMinute(time: number): number;
|
|
36
|
+
/** An instant as the contract writes one: UTC, whole seconds, "Z". */
|
|
37
|
+
export declare function toInstant(time: number): Instant;
|
|
38
|
+
export { DAY, MINUTE };
|
|
39
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,QAAY,CAAC;AACzB,QAAA,MAAM,GAAG,QAAmB,CAAC;AAsB7B,qCAAqC;AACrC,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOpD;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAmBrE;AAqBD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,MAAM,CAWR;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAWR;AAED,wCAAwC;AACxC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED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