@uvalib/web-components 1.0.0 → 1.0.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.
@@ -7678,444 +7678,6 @@
7678
7678
  }
7679
7679
  ]
7680
7680
  },
7681
- {
7682
- "kind": "javascript-module",
7683
- "path": "src/components/library-hours/hours-data.ts",
7684
- "declarations": [
7685
- {
7686
- "kind": "variable",
7687
- "name": "hoursEndpoints",
7688
- "type": {
7689
- "text": "HoursEndpoints"
7690
- },
7691
- "default": "{ libraries: '/jsonapi/index/default_index?filter[type]=library&page[limit]=100', hours: 'https://cal.lib.virginia.edu/api/1.0/hours/{ids}?iid=863&key=e4b27d40b7099e8e392113da2f8bf30a', }",
7692
- "description": "Where the data comes from, shared by every hours element (and exposed to pages as the\nelements' static `endpoints`). The LibCal key is LibCal's public client widget key\n(already public in the live bundles). A page can also set `window.uvalibHoursEndpoints`\n(`{ libraries?, hours? }`) before the elements' script runs; it is merged in at the\nfirst fetch. Requests are cached by URL, so a change applies to the next load."
7693
- },
7694
- {
7695
- "kind": "variable",
7696
- "name": "hoursTiming",
7697
- "type": {
7698
- "text": "object"
7699
- },
7700
- "default": "{ retries: 3, retryDelay: 1000, timeout: 10_000, tick: 60_000 }",
7701
- "description": "Fetch attempts, the delay between them (ms), each attempt's timeout (ms), and how often\nelements check the date (ms)."
7702
- },
7703
- {
7704
- "kind": "function",
7705
- "name": "setHoursEndpoints",
7706
- "return": {
7707
- "type": {
7708
- "text": "void"
7709
- }
7710
- },
7711
- "parameters": [
7712
- {
7713
- "name": "from",
7714
- "type": {
7715
- "text": "Partial<HoursEndpoints> | null | undefined"
7716
- }
7717
- }
7718
- ],
7719
- "description": "Copy the known endpoint keys (strings only) from `from` into the shared endpoints."
7720
- },
7721
- {
7722
- "kind": "function",
7723
- "name": "parseLibraries",
7724
- "return": {
7725
- "type": {
7726
- "text": "LibraryInfo[]"
7727
- }
7728
- },
7729
- "parameters": [
7730
- {
7731
- "name": "json",
7732
- "type": {
7733
- "text": "unknown"
7734
- }
7735
- }
7736
- ],
7737
- "description": "Reduce a JSON:API response to LibraryInfo, in response order."
7738
- },
7739
- {
7740
- "kind": "function",
7741
- "name": "loadLibraries",
7742
- "return": {
7743
- "type": {
7744
- "text": "Promise<LibraryInfo[]>"
7745
- }
7746
- },
7747
- "description": "The library list, fetched once per page (per URL) and shared. A failure is not cached."
7748
- },
7749
- {
7750
- "kind": "variable",
7751
- "name": "promise"
7752
- },
7753
- {
7754
- "kind": "function",
7755
- "name": "loadHours",
7756
- "return": {
7757
- "type": {
7758
- "text": "Promise<HoursByCalendar>"
7759
- }
7760
- },
7761
- "parameters": [
7762
- {
7763
- "name": "ids",
7764
- "type": {
7765
- "text": "number[]"
7766
- }
7767
- },
7768
- {
7769
- "name": "from",
7770
- "type": {
7771
- "text": "string"
7772
- }
7773
- },
7774
- {
7775
- "name": "to",
7776
- "type": {
7777
- "text": "string"
7778
- }
7779
- },
7780
- {
7781
- "name": "maxAge",
7782
- "default": "Infinity"
7783
- }
7784
- ],
7785
- "description": "Hours for LibCal calendars `ids` from `from` to `to` (inclusive, `YYYY-MM-DD`, at most\n100 days). Identical requests share one fetch; a cached result older than `maxAge` ms is\nfetched again. A failure is not cached."
7786
- },
7787
- {
7788
- "kind": "function",
7789
- "name": "resetHoursCache",
7790
- "return": {
7791
- "type": {
7792
- "text": "void"
7793
- }
7794
- },
7795
- "description": "Forget the cached library list and hours (for tests)."
7796
- },
7797
- {
7798
- "kind": "function",
7799
- "name": "sortLibraries",
7800
- "return": {
7801
- "type": {
7802
- "text": "LibraryInfo[]"
7803
- }
7804
- },
7805
- "parameters": [
7806
- {
7807
- "name": "libs",
7808
- "type": {
7809
- "text": "readonly LibraryInfo[]"
7810
- }
7811
- }
7812
- ],
7813
- "description": "Libraries by priority placement (missing last), then title. Returns a new array."
7814
- },
7815
- {
7816
- "kind": "function",
7817
- "name": "addDays",
7818
- "return": {
7819
- "type": {
7820
- "text": "string"
7821
- }
7822
- },
7823
- "parameters": [
7824
- {
7825
- "name": "date",
7826
- "type": {
7827
- "text": "string"
7828
- }
7829
- },
7830
- {
7831
- "name": "days",
7832
- "type": {
7833
- "text": "number"
7834
- }
7835
- }
7836
- ]
7837
- },
7838
- {
7839
- "kind": "function",
7840
- "name": "weekStart",
7841
- "return": {
7842
- "type": {
7843
- "text": "string"
7844
- }
7845
- },
7846
- "parameters": [
7847
- {
7848
- "name": "date",
7849
- "type": {
7850
- "text": "string"
7851
- }
7852
- }
7853
- ],
7854
- "description": "The Sunday on or before `date`."
7855
- },
7856
- {
7857
- "kind": "variable",
7858
- "name": "longDate",
7859
- "description": "\"Monday, November 9\""
7860
- },
7861
- {
7862
- "kind": "variable",
7863
- "name": "shortDate",
7864
- "description": "\"Nov 9\""
7865
- },
7866
- {
7867
- "kind": "variable",
7868
- "name": "shortWeekday",
7869
- "description": "\"Mon\""
7870
- },
7871
- {
7872
- "kind": "variable",
7873
- "name": "fullDate",
7874
- "description": "\"Saturday, November 14, 2026\""
7875
- },
7876
- {
7877
- "kind": "function",
7878
- "name": "weekHeadingDate",
7879
- "return": {
7880
- "type": {
7881
- "text": "string"
7882
- }
7883
- },
7884
- "parameters": [
7885
- {
7886
- "name": "date",
7887
- "type": {
7888
- "text": "string"
7889
- }
7890
- }
7891
- ],
7892
- "description": "\"Nov 08. 2026\": the live week heading's format, kept because Drupal's /hours shows it."
7893
- },
7894
- {
7895
- "kind": "function",
7896
- "name": "formatTime",
7897
- "return": {
7898
- "type": {
7899
- "text": "string"
7900
- }
7901
- },
7902
- "parameters": [
7903
- {
7904
- "name": "time",
7905
- "type": {
7906
- "text": "string"
7907
- }
7908
- }
7909
- ],
7910
- "description": "`9:00am` → `9am`, `5:30pm` → `5:30pm`; anything else unchanged."
7911
- },
7912
- {
7913
- "kind": "function",
7914
- "name": "formatDay",
7915
- "return": {
7916
- "type": {
7917
- "text": "string"
7918
- }
7919
- },
7920
- "parameters": [
7921
- {
7922
- "name": "day",
7923
- "type": {
7924
- "text": "DayHours | undefined"
7925
- }
7926
- }
7927
- ],
7928
- "description": "A day's hours as text: `9am - 6pm` (ranges joined by commas), `24 Hours`, `closed`, or ''."
7929
- },
7930
- {
7931
- "kind": "function",
7932
- "name": "sanitizeHoursHtml",
7933
- "return": {
7934
- "type": {
7935
- "text": "DocumentFragment"
7936
- }
7937
- },
7938
- "parameters": [
7939
- {
7940
- "name": "html",
7941
- "type": {
7942
- "text": "string"
7943
- }
7944
- },
7945
- {
7946
- "name": "doc",
7947
- "default": "document",
7948
- "type": {
7949
- "text": "Document"
7950
- }
7951
- }
7952
- ],
7953
- "description": "Drupal's hours HTML reduced to an allowlist (`a[href]` with an http(s), mailto, tel or\nrelative URL, `p`, `br`, `strong`, `em`), as new nodes owned by `doc`. It is parsed in an\ninert document, so nothing in it runs or loads. The same walk is used in every browser\n(rather than `setHTML` where available) so the output never differs between browsers."
7954
- }
7955
- ],
7956
- "exports": [
7957
- {
7958
- "kind": "js",
7959
- "name": "hoursEndpoints",
7960
- "declaration": {
7961
- "name": "hoursEndpoints",
7962
- "module": "src/components/library-hours/hours-data.ts"
7963
- }
7964
- },
7965
- {
7966
- "kind": "js",
7967
- "name": "hoursTiming",
7968
- "declaration": {
7969
- "name": "hoursTiming",
7970
- "module": "src/components/library-hours/hours-data.ts"
7971
- }
7972
- },
7973
- {
7974
- "kind": "js",
7975
- "name": "setHoursEndpoints",
7976
- "declaration": {
7977
- "name": "setHoursEndpoints",
7978
- "module": "src/components/library-hours/hours-data.ts"
7979
- }
7980
- },
7981
- {
7982
- "kind": "js",
7983
- "name": "TIME_ZONE",
7984
- "declaration": {
7985
- "name": "TIME_ZONE",
7986
- "module": "src/components/library-hours/hours-data.ts"
7987
- }
7988
- },
7989
- {
7990
- "kind": "js",
7991
- "name": "todayInNewYork",
7992
- "declaration": {
7993
- "name": "todayInNewYork",
7994
- "module": "src/components/library-hours/hours-data.ts"
7995
- }
7996
- },
7997
- {
7998
- "kind": "js",
7999
- "name": "parseLibraries",
8000
- "declaration": {
8001
- "name": "parseLibraries",
8002
- "module": "src/components/library-hours/hours-data.ts"
8003
- }
8004
- },
8005
- {
8006
- "kind": "js",
8007
- "name": "loadLibraries",
8008
- "declaration": {
8009
- "name": "loadLibraries",
8010
- "module": "src/components/library-hours/hours-data.ts"
8011
- }
8012
- },
8013
- {
8014
- "kind": "js",
8015
- "name": "loadHours",
8016
- "declaration": {
8017
- "name": "loadHours",
8018
- "module": "src/components/library-hours/hours-data.ts"
8019
- }
8020
- },
8021
- {
8022
- "kind": "js",
8023
- "name": "resetHoursCache",
8024
- "declaration": {
8025
- "name": "resetHoursCache",
8026
- "module": "src/components/library-hours/hours-data.ts"
8027
- }
8028
- },
8029
- {
8030
- "kind": "js",
8031
- "name": "sortLibraries",
8032
- "declaration": {
8033
- "name": "sortLibraries",
8034
- "module": "src/components/library-hours/hours-data.ts"
8035
- }
8036
- },
8037
- {
8038
- "kind": "js",
8039
- "name": "addDays",
8040
- "declaration": {
8041
- "name": "addDays",
8042
- "module": "src/components/library-hours/hours-data.ts"
8043
- }
8044
- },
8045
- {
8046
- "kind": "js",
8047
- "name": "weekStart",
8048
- "declaration": {
8049
- "name": "weekStart",
8050
- "module": "src/components/library-hours/hours-data.ts"
8051
- }
8052
- },
8053
- {
8054
- "kind": "js",
8055
- "name": "longDate",
8056
- "declaration": {
8057
- "name": "longDate",
8058
- "module": "src/components/library-hours/hours-data.ts"
8059
- }
8060
- },
8061
- {
8062
- "kind": "js",
8063
- "name": "shortDate",
8064
- "declaration": {
8065
- "name": "shortDate",
8066
- "module": "src/components/library-hours/hours-data.ts"
8067
- }
8068
- },
8069
- {
8070
- "kind": "js",
8071
- "name": "shortWeekday",
8072
- "declaration": {
8073
- "name": "shortWeekday",
8074
- "module": "src/components/library-hours/hours-data.ts"
8075
- }
8076
- },
8077
- {
8078
- "kind": "js",
8079
- "name": "fullDate",
8080
- "declaration": {
8081
- "name": "fullDate",
8082
- "module": "src/components/library-hours/hours-data.ts"
8083
- }
8084
- },
8085
- {
8086
- "kind": "js",
8087
- "name": "weekHeadingDate",
8088
- "declaration": {
8089
- "name": "weekHeadingDate",
8090
- "module": "src/components/library-hours/hours-data.ts"
8091
- }
8092
- },
8093
- {
8094
- "kind": "js",
8095
- "name": "formatTime",
8096
- "declaration": {
8097
- "name": "formatTime",
8098
- "module": "src/components/library-hours/hours-data.ts"
8099
- }
8100
- },
8101
- {
8102
- "kind": "js",
8103
- "name": "formatDay",
8104
- "declaration": {
8105
- "name": "formatDay",
8106
- "module": "src/components/library-hours/hours-data.ts"
8107
- }
8108
- },
8109
- {
8110
- "kind": "js",
8111
- "name": "sanitizeHoursHtml",
8112
- "declaration": {
8113
- "name": "sanitizeHoursHtml",
8114
- "module": "src/components/library-hours/hours-data.ts"
8115
- }
8116
- }
8117
- ]
8118
- },
8119
7681
  {
8120
7682
  "kind": "javascript-module",
8121
7683
  "path": "src/components/events-section/EventsSection.ts",
@@ -8571,80 +8133,433 @@
8571
8133
  }
8572
8134
  },
8573
8135
  {
8574
- "name": "no-style",
8136
+ "name": "no-style",
8137
+ "type": {
8138
+ "text": "boolean"
8139
+ },
8140
+ "default": "false",
8141
+ "fieldName": "noStyle",
8142
+ "inheritedFrom": {
8143
+ "name": "UvalibElement",
8144
+ "module": "src/base/UvalibElement.ts"
8145
+ }
8146
+ }
8147
+ ],
8148
+ "superclass": {
8149
+ "name": "UvalibElement",
8150
+ "module": "/src/base/UvalibElement.js"
8151
+ },
8152
+ "tagName": "events-section",
8153
+ "customElement": true
8154
+ }
8155
+ ],
8156
+ "exports": [
8157
+ {
8158
+ "kind": "js",
8159
+ "name": "EventsSection",
8160
+ "declaration": {
8161
+ "name": "EventsSection",
8162
+ "module": "src/components/events-section/EventsSection.ts"
8163
+ }
8164
+ }
8165
+ ]
8166
+ },
8167
+ {
8168
+ "kind": "javascript-module",
8169
+ "path": "src/components/events-section/events-data.ts",
8170
+ "declarations": [
8171
+ {
8172
+ "kind": "variable",
8173
+ "name": "eventsEndpoints",
8174
+ "type": {
8175
+ "text": "EventsEndpoints"
8176
+ },
8177
+ "default": "{ events: `https://cal.lib.virginia.edu/api/1.0/events?${PARAMS}`, search: `https://cal.lib.virginia.edu/api/1.0/event_search?${PARAMS}`, }",
8178
+ "description": "Where events come from, shared by every <events-section> (and exposed to pages as the\nelement's static `endpoints`). A page can also set `window.uvalibEventsEndpoints`\n(`{ events?, search? }`) before the element's script runs; it is merged in at the first\nfetch. Requests are cached by URL, so a change applies to the next load."
8179
+ },
8180
+ {
8181
+ "kind": "variable",
8182
+ "name": "eventsTiming",
8183
+ "type": {
8184
+ "text": "object"
8185
+ },
8186
+ "default": "{ retries: 3, retryDelay: 1000, timeout: 10_000, retryEvery: 60_000, maxAge: 3_600_000, }",
8187
+ "description": "Fetch attempts, the delay between them (ms) and each attempt's timeout (ms); how often (ms)\nan element checks its events (after an error it tries again; otherwise it drops ended\nevents), and the age (ms) after which that check fetches them again."
8188
+ },
8189
+ {
8190
+ "kind": "function",
8191
+ "name": "setEventsEndpoints",
8192
+ "return": {
8193
+ "type": {
8194
+ "text": "void"
8195
+ }
8196
+ },
8197
+ "parameters": [
8198
+ {
8199
+ "name": "from",
8200
+ "type": {
8201
+ "text": "Partial<EventsEndpoints> | null | undefined"
8202
+ }
8203
+ }
8204
+ ],
8205
+ "description": "Copy the known endpoint keys (strings only) from `from` into the shared endpoints."
8206
+ },
8207
+ {
8208
+ "kind": "function",
8209
+ "name": "eventsUrl",
8210
+ "return": {
8211
+ "type": {
8212
+ "text": "string"
8213
+ }
8214
+ },
8215
+ "parameters": [
8216
+ {
8217
+ "name": "{ limit, category, query }",
8218
+ "type": {
8219
+ "text": "EventsQuery"
8220
+ }
8221
+ }
8222
+ ],
8223
+ "description": "The LibCal URL for `q`: the endpoint with `limit` (ten more than asked for, at most 100),\nand `category` and `search` when set. Any of those three already in the endpoint is\ndropped first, so no parameter is sent twice. Values are encoded with encodeURIComponent\n(commas in a category list are kept)."
8224
+ },
8225
+ {
8226
+ "kind": "function",
8227
+ "name": "parseEvents",
8228
+ "return": {
8229
+ "type": {
8230
+ "text": "EventItem[]"
8231
+ }
8232
+ },
8233
+ "parameters": [
8234
+ {
8235
+ "name": "json",
8236
+ "type": {
8237
+ "text": "unknown"
8238
+ }
8239
+ }
8240
+ ],
8241
+ "description": "LibCal's `{ events: [...] }` reduced to EventItem, in response order. Events without a\ntitle, a public http(s) URL, or a parseable start and end (end not before start) are\nskipped; everything else LibCal sends (descriptions, owners, seats…) is dropped."
8242
+ },
8243
+ {
8244
+ "kind": "function",
8245
+ "name": "upcoming",
8246
+ "return": {
8247
+ "type": {
8248
+ "text": "EventItem[]"
8249
+ }
8250
+ },
8251
+ "parameters": [
8252
+ {
8253
+ "name": "events",
8254
+ "type": {
8255
+ "text": "readonly EventItem[]"
8256
+ }
8257
+ },
8258
+ {
8259
+ "name": "limit",
8260
+ "type": {
8261
+ "text": "number"
8262
+ }
8263
+ },
8264
+ {
8265
+ "name": "now",
8266
+ "default": "Date.now()"
8267
+ }
8268
+ ],
8269
+ "description": "The first `limit` events that have not ended at `now`, by start time."
8270
+ },
8271
+ {
8272
+ "kind": "function",
8273
+ "name": "loadEvents",
8274
+ "return": {
8275
+ "type": {
8276
+ "text": "Promise<EventItem[]>"
8277
+ }
8278
+ },
8279
+ "parameters": [
8280
+ {
8281
+ "name": "q",
8282
+ "type": {
8283
+ "text": "EventsQuery"
8284
+ }
8285
+ },
8286
+ {
8287
+ "name": "maxAge",
8288
+ "default": "Infinity"
8289
+ }
8290
+ ],
8291
+ "description": "The events for `q` (all of them, ended ones included: see `upcoming`). Identical requests\nshare one fetch; a cached answer older than `maxAge` ms is fetched again. A failure is not\ncached."
8292
+ },
8293
+ {
8294
+ "kind": "function",
8295
+ "name": "resetEventsCache",
8296
+ "return": {
8297
+ "type": {
8298
+ "text": "void"
8299
+ }
8300
+ },
8301
+ "description": "Forget cached events and re-read `window.uvalibEventsEndpoints` (for tests)."
8302
+ },
8303
+ {
8304
+ "kind": "function",
8305
+ "name": "eventWhen",
8306
+ "return": {
8307
+ "type": {
8308
+ "text": "EventWhen"
8309
+ }
8310
+ },
8311
+ "parameters": [
8312
+ {
8313
+ "name": "e",
8575
8314
  "type": {
8576
- "text": "boolean"
8577
- },
8578
- "default": "false",
8579
- "fieldName": "noStyle",
8580
- "inheritedFrom": {
8581
- "name": "UvalibElement",
8582
- "module": "src/base/UvalibElement.ts"
8315
+ "text": "EventItem"
8583
8316
  }
8584
8317
  }
8585
8318
  ],
8586
- "superclass": {
8587
- "name": "UvalibElement",
8588
- "module": "/src/base/UvalibElement.js"
8589
- },
8590
- "tagName": "events-section",
8591
- "customElement": true
8319
+ "description": "The date column and time line for `e`, in America/New_York."
8592
8320
  }
8593
8321
  ],
8594
8322
  "exports": [
8595
8323
  {
8596
8324
  "kind": "js",
8597
- "name": "EventsSection",
8325
+ "name": "eventsEndpoints",
8598
8326
  "declaration": {
8599
- "name": "EventsSection",
8600
- "module": "src/components/events-section/EventsSection.ts"
8327
+ "name": "eventsEndpoints",
8328
+ "module": "src/components/events-section/events-data.ts"
8329
+ }
8330
+ },
8331
+ {
8332
+ "kind": "js",
8333
+ "name": "eventsTiming",
8334
+ "declaration": {
8335
+ "name": "eventsTiming",
8336
+ "module": "src/components/events-section/events-data.ts"
8337
+ }
8338
+ },
8339
+ {
8340
+ "kind": "js",
8341
+ "name": "setEventsEndpoints",
8342
+ "declaration": {
8343
+ "name": "setEventsEndpoints",
8344
+ "module": "src/components/events-section/events-data.ts"
8345
+ }
8346
+ },
8347
+ {
8348
+ "kind": "js",
8349
+ "name": "eventsUrl",
8350
+ "declaration": {
8351
+ "name": "eventsUrl",
8352
+ "module": "src/components/events-section/events-data.ts"
8353
+ }
8354
+ },
8355
+ {
8356
+ "kind": "js",
8357
+ "name": "parseEvents",
8358
+ "declaration": {
8359
+ "name": "parseEvents",
8360
+ "module": "src/components/events-section/events-data.ts"
8361
+ }
8362
+ },
8363
+ {
8364
+ "kind": "js",
8365
+ "name": "upcoming",
8366
+ "declaration": {
8367
+ "name": "upcoming",
8368
+ "module": "src/components/events-section/events-data.ts"
8369
+ }
8370
+ },
8371
+ {
8372
+ "kind": "js",
8373
+ "name": "loadEvents",
8374
+ "declaration": {
8375
+ "name": "loadEvents",
8376
+ "module": "src/components/events-section/events-data.ts"
8377
+ }
8378
+ },
8379
+ {
8380
+ "kind": "js",
8381
+ "name": "resetEventsCache",
8382
+ "declaration": {
8383
+ "name": "resetEventsCache",
8384
+ "module": "src/components/events-section/events-data.ts"
8385
+ }
8386
+ },
8387
+ {
8388
+ "kind": "js",
8389
+ "name": "eventWhen",
8390
+ "declaration": {
8391
+ "name": "eventWhen",
8392
+ "module": "src/components/events-section/events-data.ts"
8601
8393
  }
8602
8394
  }
8603
8395
  ]
8604
8396
  },
8605
8397
  {
8606
8398
  "kind": "javascript-module",
8607
- "path": "src/components/events-section/events-data.ts",
8399
+ "path": "src/components/events-section/events-section.ts",
8400
+ "declarations": [],
8401
+ "exports": []
8402
+ },
8403
+ {
8404
+ "kind": "javascript-module",
8405
+ "path": "src/components/library-hours/hours-data.ts",
8608
8406
  "declarations": [
8609
8407
  {
8610
8408
  "kind": "variable",
8611
- "name": "eventsEndpoints",
8409
+ "name": "hoursEndpoints",
8612
8410
  "type": {
8613
- "text": "EventsEndpoints"
8411
+ "text": "HoursEndpoints"
8614
8412
  },
8615
- "default": "{ events: `https://cal.lib.virginia.edu/api/1.0/events?${PARAMS}`, search: `https://cal.lib.virginia.edu/api/1.0/event_search?${PARAMS}`, }",
8616
- "description": "Where events come from, shared by every <events-section> (and exposed to pages as the\nelement's static `endpoints`). A page can also set `window.uvalibEventsEndpoints`\n(`{ events?, search? }`) before the element's script runs; it is merged in at the first\nfetch. Requests are cached by URL, so a change applies to the next load."
8413
+ "default": "{ libraries: '/jsonapi/index/default_index?filter[type]=library&page[limit]=100', hours: 'https://cal.lib.virginia.edu/api/1.0/hours/{ids}?iid=863&key=e4b27d40b7099e8e392113da2f8bf30a', }",
8414
+ "description": "Where the data comes from, shared by every hours element (and exposed to pages as the\nelements' static `endpoints`). The LibCal key is LibCal's public client widget key\n(already public in the live bundles). A page can also set `window.uvalibHoursEndpoints`\n(`{ libraries?, hours? }`) before the elements' script runs; it is merged in at the\nfirst fetch. Requests are cached by URL, so a change applies to the next load."
8617
8415
  },
8618
8416
  {
8619
8417
  "kind": "variable",
8620
- "name": "eventsTiming",
8418
+ "name": "hoursTiming",
8621
8419
  "type": {
8622
8420
  "text": "object"
8623
8421
  },
8624
- "default": "{ retries: 3, retryDelay: 1000, timeout: 10_000, retryEvery: 60_000, maxAge: 3_600_000, }",
8625
- "description": "Fetch attempts, the delay between them (ms) and each attempt's timeout (ms); how often (ms)\nan element checks its events (after an error it tries again; otherwise it drops ended\nevents), and the age (ms) after which that check fetches them again."
8422
+ "default": "{ retries: 3, retryDelay: 1000, timeout: 10_000, tick: 60_000 }",
8423
+ "description": "Fetch attempts, the delay between them (ms), each attempt's timeout (ms), and how often\nelements check the date (ms)."
8626
8424
  },
8627
8425
  {
8628
8426
  "kind": "function",
8629
- "name": "setEventsEndpoints",
8427
+ "name": "setHoursEndpoints",
8428
+ "return": {
8429
+ "type": {
8430
+ "text": "void"
8431
+ }
8432
+ },
8433
+ "parameters": [
8434
+ {
8435
+ "name": "from",
8436
+ "type": {
8437
+ "text": "Partial<HoursEndpoints> | null | undefined"
8438
+ }
8439
+ }
8440
+ ],
8441
+ "description": "Copy the known endpoint keys (strings only) from `from` into the shared endpoints."
8442
+ },
8443
+ {
8444
+ "kind": "function",
8445
+ "name": "parseLibraries",
8446
+ "return": {
8447
+ "type": {
8448
+ "text": "LibraryInfo[]"
8449
+ }
8450
+ },
8451
+ "parameters": [
8452
+ {
8453
+ "name": "json",
8454
+ "type": {
8455
+ "text": "unknown"
8456
+ }
8457
+ }
8458
+ ],
8459
+ "description": "Reduce a JSON:API response to LibraryInfo, in response order."
8460
+ },
8461
+ {
8462
+ "kind": "function",
8463
+ "name": "loadLibraries",
8464
+ "return": {
8465
+ "type": {
8466
+ "text": "Promise<LibraryInfo[]>"
8467
+ }
8468
+ },
8469
+ "description": "The library list, fetched once per page (per URL) and shared. A failure is not cached."
8470
+ },
8471
+ {
8472
+ "kind": "variable",
8473
+ "name": "promise"
8474
+ },
8475
+ {
8476
+ "kind": "function",
8477
+ "name": "loadHours",
8478
+ "return": {
8479
+ "type": {
8480
+ "text": "Promise<HoursByCalendar>"
8481
+ }
8482
+ },
8483
+ "parameters": [
8484
+ {
8485
+ "name": "ids",
8486
+ "type": {
8487
+ "text": "number[]"
8488
+ }
8489
+ },
8490
+ {
8491
+ "name": "from",
8492
+ "type": {
8493
+ "text": "string"
8494
+ }
8495
+ },
8496
+ {
8497
+ "name": "to",
8498
+ "type": {
8499
+ "text": "string"
8500
+ }
8501
+ },
8502
+ {
8503
+ "name": "maxAge",
8504
+ "default": "Infinity"
8505
+ }
8506
+ ],
8507
+ "description": "Hours for LibCal calendars `ids` from `from` to `to` (inclusive, `YYYY-MM-DD`, at most\n100 days). Identical requests share one fetch; a cached result older than `maxAge` ms is\nfetched again. A failure is not cached."
8508
+ },
8509
+ {
8510
+ "kind": "function",
8511
+ "name": "resetHoursCache",
8630
8512
  "return": {
8631
8513
  "type": {
8632
8514
  "text": "void"
8633
8515
  }
8634
8516
  },
8517
+ "description": "Forget the cached library list and hours (for tests)."
8518
+ },
8519
+ {
8520
+ "kind": "function",
8521
+ "name": "sortLibraries",
8522
+ "return": {
8523
+ "type": {
8524
+ "text": "LibraryInfo[]"
8525
+ }
8526
+ },
8527
+ "parameters": [
8528
+ {
8529
+ "name": "libs",
8530
+ "type": {
8531
+ "text": "readonly LibraryInfo[]"
8532
+ }
8533
+ }
8534
+ ],
8535
+ "description": "Libraries by priority placement (missing last), then title. Returns a new array."
8536
+ },
8537
+ {
8538
+ "kind": "function",
8539
+ "name": "addDays",
8540
+ "return": {
8541
+ "type": {
8542
+ "text": "string"
8543
+ }
8544
+ },
8635
8545
  "parameters": [
8636
8546
  {
8637
- "name": "from",
8547
+ "name": "date",
8548
+ "type": {
8549
+ "text": "string"
8550
+ }
8551
+ },
8552
+ {
8553
+ "name": "days",
8638
8554
  "type": {
8639
- "text": "Partial<EventsEndpoints> | null | undefined"
8555
+ "text": "number"
8640
8556
  }
8641
8557
  }
8642
- ],
8643
- "description": "Copy the known endpoint keys (strings only) from `from` into the shared endpoints."
8558
+ ]
8644
8559
  },
8645
8560
  {
8646
8561
  "kind": "function",
8647
- "name": "eventsUrl",
8562
+ "name": "weekStart",
8648
8563
  "return": {
8649
8564
  "type": {
8650
8565
  "text": "string"
@@ -8652,192 +8567,277 @@
8652
8567
  },
8653
8568
  "parameters": [
8654
8569
  {
8655
- "name": "{ limit, category, query }",
8570
+ "name": "date",
8656
8571
  "type": {
8657
- "text": "EventsQuery"
8572
+ "text": "string"
8658
8573
  }
8659
8574
  }
8660
8575
  ],
8661
- "description": "The LibCal URL for `q`: the endpoint with `limit` (ten more than asked for, at most 100),\nand `category` and `search` when set. Any of those three already in the endpoint is\ndropped first, so no parameter is sent twice. Values are encoded with encodeURIComponent\n(commas in a category list are kept)."
8576
+ "description": "The Sunday on or before `date`."
8577
+ },
8578
+ {
8579
+ "kind": "variable",
8580
+ "name": "longDate",
8581
+ "description": "\"Monday, November 9\""
8582
+ },
8583
+ {
8584
+ "kind": "variable",
8585
+ "name": "shortDate",
8586
+ "description": "\"Nov 9\""
8587
+ },
8588
+ {
8589
+ "kind": "variable",
8590
+ "name": "shortWeekday",
8591
+ "description": "\"Mon\""
8592
+ },
8593
+ {
8594
+ "kind": "variable",
8595
+ "name": "fullDate",
8596
+ "description": "\"Saturday, November 14, 2026\""
8662
8597
  },
8663
8598
  {
8664
8599
  "kind": "function",
8665
- "name": "parseEvents",
8600
+ "name": "weekHeadingDate",
8666
8601
  "return": {
8667
8602
  "type": {
8668
- "text": "EventItem[]"
8603
+ "text": "string"
8669
8604
  }
8670
8605
  },
8671
8606
  "parameters": [
8672
8607
  {
8673
- "name": "json",
8608
+ "name": "date",
8674
8609
  "type": {
8675
- "text": "unknown"
8610
+ "text": "string"
8676
8611
  }
8677
8612
  }
8678
8613
  ],
8679
- "description": "LibCal's `{ events: [...] }` reduced to EventItem, in response order. Events without a\ntitle, a public http(s) URL, or a parseable start and end (end not before start) are\nskipped; everything else LibCal sends (descriptions, owners, seats…) is dropped."
8614
+ "description": "\"Nov 08. 2026\": the live week heading's format, kept because Drupal's /hours shows it."
8680
8615
  },
8681
8616
  {
8682
8617
  "kind": "function",
8683
- "name": "upcoming",
8618
+ "name": "formatTime",
8684
8619
  "return": {
8685
8620
  "type": {
8686
- "text": "EventItem[]"
8621
+ "text": "string"
8687
8622
  }
8688
8623
  },
8689
8624
  "parameters": [
8690
8625
  {
8691
- "name": "events",
8692
- "type": {
8693
- "text": "readonly EventItem[]"
8694
- }
8695
- },
8696
- {
8697
- "name": "limit",
8626
+ "name": "time",
8698
8627
  "type": {
8699
- "text": "number"
8628
+ "text": "string"
8700
8629
  }
8701
- },
8702
- {
8703
- "name": "now",
8704
- "default": "Date.now()"
8705
8630
  }
8706
8631
  ],
8707
- "description": "The first `limit` events that have not ended at `now`, by start time."
8632
+ "description": "`9:00am` → `9am`, `5:30pm` → `5:30pm`; anything else unchanged."
8708
8633
  },
8709
8634
  {
8710
8635
  "kind": "function",
8711
- "name": "loadEvents",
8636
+ "name": "formatDay",
8712
8637
  "return": {
8713
8638
  "type": {
8714
- "text": "Promise<EventItem[]>"
8639
+ "text": "string"
8715
8640
  }
8716
8641
  },
8717
8642
  "parameters": [
8718
8643
  {
8719
- "name": "q",
8644
+ "name": "day",
8720
8645
  "type": {
8721
- "text": "EventsQuery"
8646
+ "text": "DayHours | undefined"
8722
8647
  }
8723
- },
8724
- {
8725
- "name": "maxAge",
8726
- "default": "Infinity"
8727
8648
  }
8728
8649
  ],
8729
- "description": "The events for `q` (all of them, ended ones included: see `upcoming`). Identical requests\nshare one fetch; a cached answer older than `maxAge` ms is fetched again. A failure is not\ncached."
8730
- },
8731
- {
8732
- "kind": "function",
8733
- "name": "resetEventsCache",
8734
- "return": {
8735
- "type": {
8736
- "text": "void"
8737
- }
8738
- },
8739
- "description": "Forget cached events and re-read `window.uvalibEventsEndpoints` (for tests)."
8650
+ "description": "A day's hours as text: `9am - 6pm` (ranges joined by commas), `24 Hours`, `closed`, or ''."
8740
8651
  },
8741
8652
  {
8742
8653
  "kind": "function",
8743
- "name": "eventWhen",
8654
+ "name": "sanitizeHoursHtml",
8744
8655
  "return": {
8745
8656
  "type": {
8746
- "text": "EventWhen"
8657
+ "text": "DocumentFragment"
8747
8658
  }
8748
8659
  },
8749
8660
  "parameters": [
8750
8661
  {
8751
- "name": "e",
8662
+ "name": "html",
8752
8663
  "type": {
8753
- "text": "EventItem"
8664
+ "text": "string"
8665
+ }
8666
+ },
8667
+ {
8668
+ "name": "doc",
8669
+ "default": "document",
8670
+ "type": {
8671
+ "text": "Document"
8754
8672
  }
8755
8673
  }
8756
8674
  ],
8757
- "description": "The date column and time line for `e`, in America/New_York."
8675
+ "description": "Drupal's hours HTML reduced to an allowlist (`a[href]` with an http(s), mailto, tel or\nrelative URL, `p`, `br`, `strong`, `em`), as new nodes owned by `doc`. It is parsed in an\ninert document, so nothing in it runs or loads. The same walk is used in every browser\n(rather than `setHTML` where available) so the output never differs between browsers."
8758
8676
  }
8759
8677
  ],
8760
8678
  "exports": [
8761
8679
  {
8762
8680
  "kind": "js",
8763
- "name": "eventsEndpoints",
8681
+ "name": "hoursEndpoints",
8764
8682
  "declaration": {
8765
- "name": "eventsEndpoints",
8766
- "module": "src/components/events-section/events-data.ts"
8683
+ "name": "hoursEndpoints",
8684
+ "module": "src/components/library-hours/hours-data.ts"
8767
8685
  }
8768
8686
  },
8769
8687
  {
8770
8688
  "kind": "js",
8771
- "name": "eventsTiming",
8689
+ "name": "hoursTiming",
8772
8690
  "declaration": {
8773
- "name": "eventsTiming",
8774
- "module": "src/components/events-section/events-data.ts"
8691
+ "name": "hoursTiming",
8692
+ "module": "src/components/library-hours/hours-data.ts"
8775
8693
  }
8776
8694
  },
8777
8695
  {
8778
8696
  "kind": "js",
8779
- "name": "setEventsEndpoints",
8697
+ "name": "setHoursEndpoints",
8780
8698
  "declaration": {
8781
- "name": "setEventsEndpoints",
8782
- "module": "src/components/events-section/events-data.ts"
8699
+ "name": "setHoursEndpoints",
8700
+ "module": "src/components/library-hours/hours-data.ts"
8783
8701
  }
8784
8702
  },
8785
8703
  {
8786
8704
  "kind": "js",
8787
- "name": "eventsUrl",
8705
+ "name": "TIME_ZONE",
8788
8706
  "declaration": {
8789
- "name": "eventsUrl",
8790
- "module": "src/components/events-section/events-data.ts"
8707
+ "name": "TIME_ZONE",
8708
+ "module": "src/components/library-hours/hours-data.ts"
8791
8709
  }
8792
8710
  },
8793
8711
  {
8794
8712
  "kind": "js",
8795
- "name": "parseEvents",
8713
+ "name": "todayInNewYork",
8796
8714
  "declaration": {
8797
- "name": "parseEvents",
8798
- "module": "src/components/events-section/events-data.ts"
8715
+ "name": "todayInNewYork",
8716
+ "module": "src/components/library-hours/hours-data.ts"
8799
8717
  }
8800
8718
  },
8801
8719
  {
8802
8720
  "kind": "js",
8803
- "name": "upcoming",
8721
+ "name": "parseLibraries",
8804
8722
  "declaration": {
8805
- "name": "upcoming",
8806
- "module": "src/components/events-section/events-data.ts"
8723
+ "name": "parseLibraries",
8724
+ "module": "src/components/library-hours/hours-data.ts"
8807
8725
  }
8808
8726
  },
8809
8727
  {
8810
8728
  "kind": "js",
8811
- "name": "loadEvents",
8729
+ "name": "loadLibraries",
8812
8730
  "declaration": {
8813
- "name": "loadEvents",
8814
- "module": "src/components/events-section/events-data.ts"
8731
+ "name": "loadLibraries",
8732
+ "module": "src/components/library-hours/hours-data.ts"
8815
8733
  }
8816
8734
  },
8817
8735
  {
8818
8736
  "kind": "js",
8819
- "name": "resetEventsCache",
8737
+ "name": "loadHours",
8820
8738
  "declaration": {
8821
- "name": "resetEventsCache",
8822
- "module": "src/components/events-section/events-data.ts"
8739
+ "name": "loadHours",
8740
+ "module": "src/components/library-hours/hours-data.ts"
8823
8741
  }
8824
8742
  },
8825
8743
  {
8826
8744
  "kind": "js",
8827
- "name": "eventWhen",
8745
+ "name": "resetHoursCache",
8828
8746
  "declaration": {
8829
- "name": "eventWhen",
8830
- "module": "src/components/events-section/events-data.ts"
8747
+ "name": "resetHoursCache",
8748
+ "module": "src/components/library-hours/hours-data.ts"
8749
+ }
8750
+ },
8751
+ {
8752
+ "kind": "js",
8753
+ "name": "sortLibraries",
8754
+ "declaration": {
8755
+ "name": "sortLibraries",
8756
+ "module": "src/components/library-hours/hours-data.ts"
8757
+ }
8758
+ },
8759
+ {
8760
+ "kind": "js",
8761
+ "name": "addDays",
8762
+ "declaration": {
8763
+ "name": "addDays",
8764
+ "module": "src/components/library-hours/hours-data.ts"
8765
+ }
8766
+ },
8767
+ {
8768
+ "kind": "js",
8769
+ "name": "weekStart",
8770
+ "declaration": {
8771
+ "name": "weekStart",
8772
+ "module": "src/components/library-hours/hours-data.ts"
8773
+ }
8774
+ },
8775
+ {
8776
+ "kind": "js",
8777
+ "name": "longDate",
8778
+ "declaration": {
8779
+ "name": "longDate",
8780
+ "module": "src/components/library-hours/hours-data.ts"
8781
+ }
8782
+ },
8783
+ {
8784
+ "kind": "js",
8785
+ "name": "shortDate",
8786
+ "declaration": {
8787
+ "name": "shortDate",
8788
+ "module": "src/components/library-hours/hours-data.ts"
8789
+ }
8790
+ },
8791
+ {
8792
+ "kind": "js",
8793
+ "name": "shortWeekday",
8794
+ "declaration": {
8795
+ "name": "shortWeekday",
8796
+ "module": "src/components/library-hours/hours-data.ts"
8797
+ }
8798
+ },
8799
+ {
8800
+ "kind": "js",
8801
+ "name": "fullDate",
8802
+ "declaration": {
8803
+ "name": "fullDate",
8804
+ "module": "src/components/library-hours/hours-data.ts"
8805
+ }
8806
+ },
8807
+ {
8808
+ "kind": "js",
8809
+ "name": "weekHeadingDate",
8810
+ "declaration": {
8811
+ "name": "weekHeadingDate",
8812
+ "module": "src/components/library-hours/hours-data.ts"
8813
+ }
8814
+ },
8815
+ {
8816
+ "kind": "js",
8817
+ "name": "formatTime",
8818
+ "declaration": {
8819
+ "name": "formatTime",
8820
+ "module": "src/components/library-hours/hours-data.ts"
8821
+ }
8822
+ },
8823
+ {
8824
+ "kind": "js",
8825
+ "name": "formatDay",
8826
+ "declaration": {
8827
+ "name": "formatDay",
8828
+ "module": "src/components/library-hours/hours-data.ts"
8829
+ }
8830
+ },
8831
+ {
8832
+ "kind": "js",
8833
+ "name": "sanitizeHoursHtml",
8834
+ "declaration": {
8835
+ "name": "sanitizeHoursHtml",
8836
+ "module": "src/components/library-hours/hours-data.ts"
8831
8837
  }
8832
8838
  }
8833
8839
  ]
8834
8840
  },
8835
- {
8836
- "kind": "javascript-module",
8837
- "path": "src/components/events-section/events-section.ts",
8838
- "declarations": [],
8839
- "exports": []
8840
- },
8841
8841
  {
8842
8842
  "kind": "javascript-module",
8843
8843
  "path": "src/components/library-hours-setup/LibraryHoursSetup.ts",