@spillway-cms/blocks 0.1.23 → 0.1.25
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/THIRD_PARTY_NOTICES.md +49 -0
- package/dist/breadcrumbs.d.ts +27 -0
- package/dist/breadcrumbs.js +44 -0
- package/dist/breadcrumbs.js.map +1 -0
- package/dist/collection.d.ts +32 -1
- package/dist/collection.js +40 -5
- package/dist/collection.js.map +1 -1
- package/dist/config.d.ts +64 -4
- package/dist/config.js +124 -24
- package/dist/config.js.map +1 -1
- package/dist/countdown.d.ts +34 -0
- package/dist/countdown.js +81 -0
- package/dist/countdown.js.map +1 -0
- package/dist/css.js +43 -0
- package/dist/css.js.map +1 -1
- package/dist/documents.d.ts +52 -0
- package/dist/documents.js +146 -0
- package/dist/documents.js.map +1 -0
- package/dist/examples.js +141 -1
- package/dist/examples.js.map +1 -1
- package/dist/form.d.ts +11 -3
- package/dist/form.js +27 -11
- package/dist/form.js.map +1 -1
- package/dist/glossary.d.ts +56 -0
- package/dist/glossary.js +117 -0
- package/dist/glossary.js.map +1 -0
- package/dist/hours.d.ts +44 -0
- package/dist/hours.js +163 -0
- package/dist/hours.js.map +1 -0
- package/dist/icons-data.d.ts +18 -0
- package/dist/icons-data.js +117 -0
- package/dist/icons-data.js.map +1 -0
- package/dist/icons.d.ts +31 -0
- package/dist/icons.js +49 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +27 -3
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/language-switcher.d.ts +38 -0
- package/dist/language-switcher.js +60 -0
- package/dist/language-switcher.js.map +1 -0
- package/dist/listing-script.d.ts +13 -0
- package/dist/listing-script.js +44 -0
- package/dist/listing-script.js.map +1 -0
- package/dist/location-map.d.ts +60 -0
- package/dist/location-map.js +215 -0
- package/dist/location-map.js.map +1 -0
- package/dist/marketing.d.ts +3 -0
- package/dist/marketing.js +5 -2
- package/dist/marketing.js.map +1 -1
- package/dist/meta.js +75 -15
- package/dist/meta.js.map +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +3 -2
- package/dist/motion.js.map +1 -1
- package/dist/progress.d.ts +46 -0
- package/dist/progress.js +106 -0
- package/dist/progress.js.map +1 -0
- package/dist/registry-package.js +1 -1
- package/dist/registry-package.js.map +1 -1
- package/dist/registry-types.d.ts +5 -0
- package/dist/registry-types.js.map +1 -1
- package/dist/styles.css +376 -2
- package/dist/styles.js +95 -0
- package/dist/styles.js.map +1 -1
- package/dist/toc.d.ts +32 -0
- package/dist/toc.js +79 -0
- package/dist/toc.js.map +1 -0
- package/dist/utility-script.d.ts +20 -0
- package/dist/utility-script.js +90 -0
- package/dist/utility-script.js.map +1 -0
- package/dist/utility-shared.d.ts +18 -0
- package/dist/utility-shared.js +32 -0
- package/dist/utility-shared.js.map +1 -0
- package/dist/video.d.ts +36 -1
- package/dist/video.js +157 -4
- package/dist/video.js.map +1 -1
- package/dist/widgets.d.ts +95 -0
- package/dist/widgets.js +449 -0
- package/dist/widgets.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glossary A to Z (docs/dev/utility-blocks.md): terms and definitions, typed in the block or read from a content type or a
|
|
3
|
+
* vocabulary by the server's resolver (`resolved.terms`), under letter headings with a letter navigation that greys out empty
|
|
4
|
+
* letters, an anchor per letter and per term, an optional search box that UTILITY_SCRIPT runs (without script the whole list
|
|
5
|
+
* shows), and DefinedTermSet structured data. Self-contained: it has nothing to do with collections. Server-safe and pure.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentConfig } from '@puckeditor/core';
|
|
8
|
+
export interface GlossaryTerm {
|
|
9
|
+
term: string;
|
|
10
|
+
definition: string;
|
|
11
|
+
/** The term's link name (its id, for `#name` links); empty uses the term. */
|
|
12
|
+
anchor?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GlossaryProps {
|
|
15
|
+
title: string;
|
|
16
|
+
intro: string;
|
|
17
|
+
/** The block's link name: the letters' ids are `<link name>-a`, `<link name>-b` and so on. */
|
|
18
|
+
anchor: string;
|
|
19
|
+
source: 'inline' | 'type' | 'vocabulary';
|
|
20
|
+
terms: GlossaryTerm[];
|
|
21
|
+
/** source type: the content type's key, the field that holds the term (title by default) and the one that holds the definition. */
|
|
22
|
+
typeKey: string;
|
|
23
|
+
termField: string;
|
|
24
|
+
definitionField: string;
|
|
25
|
+
/** source vocabulary: its key; the terms' labels and descriptions. */
|
|
26
|
+
vocabulary: string;
|
|
27
|
+
search: boolean;
|
|
28
|
+
structuredData: boolean;
|
|
29
|
+
/** Added by the server's resolver for a content type or vocabulary, never stored. */
|
|
30
|
+
resolved?: {
|
|
31
|
+
terms: {
|
|
32
|
+
term: string;
|
|
33
|
+
definition: string;
|
|
34
|
+
href?: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare const GLOSSARY_LETTERS: string[];
|
|
39
|
+
/** The letter a term files under: its first letter with accents folded (Éclair → E), else `#`. */
|
|
40
|
+
export declare function letterOf(term: string): string;
|
|
41
|
+
type Entry = {
|
|
42
|
+
term: string;
|
|
43
|
+
definition: string;
|
|
44
|
+
href?: string;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
/** Terms sorted (accents and case ignored) and filed by letter, `#` last; each with a unique id. */
|
|
48
|
+
export declare function fileTerms(terms: {
|
|
49
|
+
term: string;
|
|
50
|
+
definition: string;
|
|
51
|
+
href?: string;
|
|
52
|
+
anchor?: string;
|
|
53
|
+
}[], lang?: string): Map<string, Entry[]>;
|
|
54
|
+
export declare const glossaryComponent: ComponentConfig<GlossaryProps>;
|
|
55
|
+
export declare const GLOSSARY_CSS = "\n/* ---------- Glossary ---------- */\n.sw-glossary__title { margin: 0 0 var(--sw-space-1); }\n.sw-glossary__intro { margin: 0 0 var(--sw-space-2); color: var(--sw-color-muted); max-width: 70ch; }\n.sw-glossary__letters ul { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0 0 var(--sw-space-2); padding: 0; }\n.sw-glossary__letters a, .sw-glossary__letter-empty { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; border-radius: var(--sw-radius); font-weight: 700; text-decoration: none; }\n.sw-glossary__letters a { color: var(--sw-color-primary); border: 1px solid var(--sw-color-border); }\n.sw-glossary__letters a:hover { background: var(--sw-color-surface); }\n.sw-glossary__letters a:focus-visible { outline: none; box-shadow: var(--sw-focus-ring); }\n.sw-glossary__letter-empty { color: var(--sw-color-muted); }\n.sw-glossary__section { scroll-margin-top: var(--sw-space-3); }\n.sw-glossary__section + .sw-glossary__section { margin-top: var(--sw-space-3); }\n.sw-glossary__letter { margin: 0 0 var(--sw-space-1); padding-bottom: 0.25rem; border-bottom: 2px solid var(--sw-color-primary); font-size: 1.5rem; }\n.sw-glossary__list { margin: 0; }\n.sw-glossary__entry { padding: var(--sw-space-1) 0; border-bottom: 1px solid var(--sw-color-border); scroll-margin-top: var(--sw-space-3); }\n.sw-glossary__entry:target { background: var(--sw-color-surface); }\n.sw-glossary__term { font-weight: 700; }\n.sw-glossary__definition { margin: 0.25rem 0 0; max-width: 70ch; }\n.sw-glossary__empty { color: var(--sw-color-muted); }\n.sw-glossary__empty[hidden] { display: none; }\n";
|
|
56
|
+
export {};
|
package/dist/glossary.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx, keyFor, ldJson, slugOf, textOf } from './utility-shared.js';
|
|
3
|
+
export const GLOSSARY_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
|
4
|
+
/** The letter a term files under: its first letter with accents folded (Éclair → E), else `#`. */
|
|
5
|
+
export function letterOf(term) {
|
|
6
|
+
const c = term.trim().normalize('NFKD').replace(/[̀-ͯ]/g, '').charAt(0).toUpperCase();
|
|
7
|
+
return c >= 'A' && c <= 'Z' ? c : '#';
|
|
8
|
+
}
|
|
9
|
+
/** Terms sorted (accents and case ignored) and filed by letter, `#` last; each with a unique id. */
|
|
10
|
+
export function fileTerms(terms, lang = 'en') {
|
|
11
|
+
const coll = new Intl.Collator(lang, { sensitivity: 'base', numeric: true });
|
|
12
|
+
const seen = new Set();
|
|
13
|
+
const sorted = terms.filter((t) => t && textOf(t.term).trim()).sort((a, b) => coll.compare(a.term.trim(), b.term.trim()));
|
|
14
|
+
const out = new Map();
|
|
15
|
+
for (const t of sorted) {
|
|
16
|
+
let base = slugOf(textOf(t.anchor)) || slugOf(t.term) || 'term';
|
|
17
|
+
if (/^\d/.test(base))
|
|
18
|
+
base = `n-${base}`;
|
|
19
|
+
let id = base;
|
|
20
|
+
for (let n = 2; seen.has(id); n++)
|
|
21
|
+
id = `${base}-${n}`;
|
|
22
|
+
seen.add(id);
|
|
23
|
+
const l = letterOf(t.term);
|
|
24
|
+
out.set(l, [...(out.get(l) ?? []), { term: t.term.trim(), definition: textOf(t.definition).trim(), ...(t.href ? { href: t.href } : {}), id }]);
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
export const glossaryComponent = {
|
|
29
|
+
label: 'Glossary A to Z',
|
|
30
|
+
fields: {
|
|
31
|
+
title: { type: 'text', label: 'Title', contentEditable: true },
|
|
32
|
+
intro: { type: 'textarea', label: 'Introduction' },
|
|
33
|
+
anchor: { type: 'text', label: 'Link name (letters link to #<link name>-a)', placeholder: 'glossary' },
|
|
34
|
+
source: { type: 'radio', label: 'Terms from', options: [{ label: 'This block', value: 'inline' }, { label: 'A content type', value: 'type' }, { label: 'A vocabulary', value: 'vocabulary' }] },
|
|
35
|
+
terms: {
|
|
36
|
+
type: 'array',
|
|
37
|
+
label: 'Terms (when the terms are in this block)',
|
|
38
|
+
max: 500,
|
|
39
|
+
getItemSummary: (t, i) => t?.term || `Term ${(i ?? 0) + 1}`,
|
|
40
|
+
arrayFields: {
|
|
41
|
+
term: { type: 'text', label: 'Term' },
|
|
42
|
+
definition: { type: 'textarea', label: 'Definition' },
|
|
43
|
+
anchor: { type: 'text', label: 'Link name (empty: from the term)' },
|
|
44
|
+
},
|
|
45
|
+
defaultItemProps: { term: '', definition: '', anchor: '' },
|
|
46
|
+
},
|
|
47
|
+
typeKey: { type: 'text', label: 'Content type key (terms from a content type)' },
|
|
48
|
+
termField: { type: 'text', label: 'Term field (empty: the title)' },
|
|
49
|
+
definitionField: { type: 'text', label: 'Definition field', placeholder: 'summary' },
|
|
50
|
+
vocabulary: { type: 'text', label: 'Vocabulary key (terms from a vocabulary)' },
|
|
51
|
+
search: { type: 'radio', label: 'Search box', options: [{ label: 'Off', value: false }, { label: 'On', value: true }] },
|
|
52
|
+
structuredData: { type: 'radio', label: 'Terms in search results (DefinedTermSet)', options: [{ label: 'On', value: true }, { label: 'Off', value: false }] },
|
|
53
|
+
},
|
|
54
|
+
defaultProps: {
|
|
55
|
+
title: 'Glossary',
|
|
56
|
+
intro: '',
|
|
57
|
+
anchor: 'glossary',
|
|
58
|
+
source: 'inline',
|
|
59
|
+
terms: [
|
|
60
|
+
{ term: 'Add/drop period', definition: 'The first week of a term, when you can add or drop classes without a fee.', anchor: '' },
|
|
61
|
+
{ term: 'Bursar', definition: 'The office that bills tuition and fees and issues refunds.', anchor: '' },
|
|
62
|
+
{ term: 'Credit hour', definition: 'One hour of class a week for a term, the unit a degree counts.', anchor: '' },
|
|
63
|
+
],
|
|
64
|
+
typeKey: '',
|
|
65
|
+
termField: '',
|
|
66
|
+
definitionField: 'summary',
|
|
67
|
+
vocabulary: '',
|
|
68
|
+
search: false,
|
|
69
|
+
structuredData: true,
|
|
70
|
+
},
|
|
71
|
+
render: (props) => {
|
|
72
|
+
const { title, intro, anchor, source, terms, search, structuredData, resolved } = props;
|
|
73
|
+
const list = source === 'type' || source === 'vocabulary' ? (resolved?.terms ?? []) : (Array.isArray(terms) ? terms : []).map((t) => ({ term: textOf(t?.term), definition: textOf(t?.definition), anchor: textOf(t?.anchor) }));
|
|
74
|
+
const filed = fileTerms(list);
|
|
75
|
+
const base = slugOf(textOf(anchor)) || 'glossary';
|
|
76
|
+
const key = keyFor('glossary', props.id, base);
|
|
77
|
+
const titleText = textOf(title);
|
|
78
|
+
const Letter = titleText ? 'h3' : 'h2';
|
|
79
|
+
const letters = [...GLOSSARY_LETTERS, '#'];
|
|
80
|
+
const idOf = (l) => `${base}-${l === '#' ? 'other' : l.toLowerCase()}`;
|
|
81
|
+
const total = [...filed.values()].reduce((n, e) => n + e.length, 0);
|
|
82
|
+
const filtering = search === true && total > 1;
|
|
83
|
+
const ld = structuredData !== false && total
|
|
84
|
+
? {
|
|
85
|
+
'@context': 'https://schema.org',
|
|
86
|
+
'@type': 'DefinedTermSet',
|
|
87
|
+
...(titleText ? { name: titleText } : {}),
|
|
88
|
+
hasDefinedTerm: [...filed.values()].flat().map((e) => ({ '@type': 'DefinedTerm', name: e.term, ...(e.definition ? { description: e.definition } : {}) })),
|
|
89
|
+
}
|
|
90
|
+
: null;
|
|
91
|
+
return (_jsx("section", { className: "sw-block sw-glossary", "data-sw-filter": filtering ? 'terms' : undefined, "aria-labelledby": titleText ? `${key}-title` : undefined, children: _jsxs("div", { className: "sw-container", children: [titleText ? (_jsx("h2", { className: "sw-glossary__title", id: `${key}-title`, children: title })) : null, textOf(intro).trim() ? _jsx("p", { className: "sw-glossary__intro", children: intro }) : null, _jsx("nav", { className: "sw-glossary__letters", "aria-label": titleText ? `${titleText}: letters` : 'Glossary letters', children: _jsx("ul", { children: letters.map((l) => (_jsx("li", { children: filed.has(l) ? (_jsx("a", { href: `#${idOf(l)}`, "data-sw-filter-letter": idOf(l), children: l })) : (_jsx("span", { className: "sw-glossary__letter-empty", "aria-disabled": "true", children: l })) }, l))) }) }), filtering ? (_jsxs("div", { className: "sw-filter", "data-sw-filter-tools": "", hidden: true, children: [_jsxs("div", { className: "sw-filter__field", children: [_jsx("label", { htmlFor: `${key}-q`, children: "Search terms" }), _jsx("input", { id: `${key}-q`, className: "sw-filter__input", type: "search", autoComplete: "off", "data-sw-filter-input": "" })] }), _jsx("p", { className: "sw-filter__status", role: "status", "data-sw-filter-status": "" })] })) : null, total === 0 ? _jsx("p", { className: "sw-glossary__empty", children: "No terms yet." }) : null, letters
|
|
92
|
+
.filter((l) => filed.has(l))
|
|
93
|
+
.map((l) => (_jsxs("section", { className: "sw-glossary__section", id: idOf(l), "aria-labelledby": `${idOf(l)}-h`, "data-sw-filter-group": idOf(l), children: [_jsx(Letter, { className: "sw-glossary__letter", id: `${idOf(l)}-h`, children: l === '#' ? _jsx("span", { "aria-label": "Numbers and symbols", children: "#" }) : l }), _jsx("dl", { className: "sw-glossary__list", children: filed.get(l).map((e) => (_jsxs("div", { className: "sw-glossary__entry", id: e.id, "data-sw-filter-item": "", children: [_jsx("dt", { className: cx('sw-glossary__term'), children: e.href ? _jsx("a", { href: e.href, children: e.term }) : e.term }), _jsx("dd", { className: "sw-glossary__definition", children: e.definition })] }, e.id))) })] }, l))), filtering ? (_jsx("p", { className: "sw-glossary__empty", "data-sw-filter-empty": "", hidden: true, children: "No terms match." })) : null, ld ? _jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: ldJson(ld) } }) : null] }) }));
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
export const GLOSSARY_CSS = `
|
|
97
|
+
/* ---------- Glossary ---------- */
|
|
98
|
+
.sw-glossary__title { margin: 0 0 var(--sw-space-1); }
|
|
99
|
+
.sw-glossary__intro { margin: 0 0 var(--sw-space-2); color: var(--sw-color-muted); max-width: 70ch; }
|
|
100
|
+
.sw-glossary__letters ul { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0 0 var(--sw-space-2); padding: 0; }
|
|
101
|
+
.sw-glossary__letters a, .sw-glossary__letter-empty { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; border-radius: var(--sw-radius); font-weight: 700; text-decoration: none; }
|
|
102
|
+
.sw-glossary__letters a { color: var(--sw-color-primary); border: 1px solid var(--sw-color-border); }
|
|
103
|
+
.sw-glossary__letters a:hover { background: var(--sw-color-surface); }
|
|
104
|
+
.sw-glossary__letters a:focus-visible { outline: none; box-shadow: var(--sw-focus-ring); }
|
|
105
|
+
.sw-glossary__letter-empty { color: var(--sw-color-muted); }
|
|
106
|
+
.sw-glossary__section { scroll-margin-top: var(--sw-space-3); }
|
|
107
|
+
.sw-glossary__section + .sw-glossary__section { margin-top: var(--sw-space-3); }
|
|
108
|
+
.sw-glossary__letter { margin: 0 0 var(--sw-space-1); padding-bottom: 0.25rem; border-bottom: 2px solid var(--sw-color-primary); font-size: 1.5rem; }
|
|
109
|
+
.sw-glossary__list { margin: 0; }
|
|
110
|
+
.sw-glossary__entry { padding: var(--sw-space-1) 0; border-bottom: 1px solid var(--sw-color-border); scroll-margin-top: var(--sw-space-3); }
|
|
111
|
+
.sw-glossary__entry:target { background: var(--sw-color-surface); }
|
|
112
|
+
.sw-glossary__term { font-weight: 700; }
|
|
113
|
+
.sw-glossary__definition { margin: 0.25rem 0 0; max-width: 70ch; }
|
|
114
|
+
.sw-glossary__empty { color: var(--sw-color-muted); }
|
|
115
|
+
.sw-glossary__empty[hidden] { display: none; }
|
|
116
|
+
`;
|
|
117
|
+
//# sourceMappingURL=glossary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glossary.js","sourceRoot":"","sources":["../src/glossary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA2BzE,MAAM,CAAC,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAEvE,kGAAkG;AAClG,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,CAA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AG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACxB,eAAgB,SAAS,EAAC,oBAAoB,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,yBAAsB,EAAE,aAC7E,aAAI,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,YAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAG,IAAI,EAAE,CAAC,CAAC,IAAI,YAAG,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAM,EAC9F,aAAI,SAAS,EAAC,yBAAyB,YAAE,CAAC,CAAC,UAAU,GAAM,KAFnD,CAAC,CAAC,EAAE,CAGR,CACP,CAAC,GACC,KAXO,CAAC,CAYL,CACX,CAAC,EACH,SAAS,CAAC,CAAC,CAAC,CACX,YAAG,SAAS,EAAC,oBAAoB,0BAAsB,EAAE,EAAC,MAAM,sCAE5D,CACL,CAAC,CAAC,CAAC,IAAI,EACP,EAAE,CAAC,CAAC,CAAC,iBAAQ,IAAI,EAAC,qBAAqB,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI,IAC/F,GACE,CACX,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;CAoB3B,CAAC"}
|
package/dist/hours.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hours of operation (docs/dev/utility-blocks.md): weekly hours per location, dated exceptions (holidays, closures, special hours)
|
|
3
|
+
* and a status line ("Open now, closes at 5:00 PM") computed in the site's time zone (or the block's). The server renders the
|
|
4
|
+
* status from its clock (`resolved`), so it is right with no script; UTILITY_SCRIPT refreshes it every minute from the schedule
|
|
5
|
+
* in `data-sw-hours-schedule`. Each location carries its schema.org place with OpeningHoursSpecification. Server-safe and pure.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentConfig } from '@puckeditor/core';
|
|
8
|
+
import { type HoursClock, type HoursException, type HoursRow } from '@spillway-cms/shared';
|
|
9
|
+
export interface HoursLocation {
|
|
10
|
+
/** The location's name (stored as `title`, which translation reads as copy). */
|
|
11
|
+
title: string;
|
|
12
|
+
address?: string;
|
|
13
|
+
phone?: string;
|
|
14
|
+
note?: string;
|
|
15
|
+
hours: HoursRow[];
|
|
16
|
+
}
|
|
17
|
+
export interface HoursProps {
|
|
18
|
+
title: string;
|
|
19
|
+
locations: HoursLocation[];
|
|
20
|
+
/** Dated exceptions; `location` names the one it applies to, empty for every location. */
|
|
21
|
+
exceptions: HoursException[];
|
|
22
|
+
/** An IANA time zone for this block; empty uses the site's. */
|
|
23
|
+
timeZone: string;
|
|
24
|
+
clock: HoursClock;
|
|
25
|
+
showWeek: boolean;
|
|
26
|
+
/** Lists exceptions in the next 60 days under Holiday hours. */
|
|
27
|
+
showExceptions: boolean;
|
|
28
|
+
schemaType: 'LocalBusiness' | 'GovernmentOffice' | 'Library' | 'Place';
|
|
29
|
+
structuredData: boolean;
|
|
30
|
+
/** Added by the server's resolver, never stored: its clock and the time zone used. */
|
|
31
|
+
resolved?: {
|
|
32
|
+
now: number;
|
|
33
|
+
timeZone: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare const HOURS_SCHEMA_TYPES: readonly ["LocalBusiness", "GovernmentOffice", "Library", "Place"];
|
|
37
|
+
/** The rows that are well formed (a known day and two HH:MM times). */
|
|
38
|
+
export declare function cleanRows(rows: unknown): HoursRow[];
|
|
39
|
+
/** The exceptions that apply to a location (its own and those for every location), well formed. */
|
|
40
|
+
export declare function exceptionsFor(exceptions: unknown, location: string): HoursException[];
|
|
41
|
+
/** The schema.org place for one location: its weekly rows and its exceptions as OpeningHoursSpecification. */
|
|
42
|
+
export declare function hoursJsonLd(type: string, loc: HoursLocation, rows: HoursRow[], exceptions: HoursException[]): Record<string, unknown>;
|
|
43
|
+
export declare const hoursComponent: ComponentConfig<HoursProps>;
|
|
44
|
+
export declare const HOURS_CSS = "\n/* ---------- Hours of operation ---------- */\n.sw-hours__title { margin: 0 0 var(--sw-space-2); }\n.sw-hours__grid { display: grid; gap: var(--sw-space-3); }\n@media (min-width: 640px) { .sw-hours__grid--many { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); } }\n.sw-hours__location { padding: var(--sw-space-2); border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius); background: var(--sw-color-bg); }\n.sw-hours__name { margin: 0 0 var(--sw-space-1); font-size: 1.25rem; }\n.sw-hours__status { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 var(--sw-space-1); font-weight: 600; }\n.sw-hours__status::before { content: \"\"; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--sw-color-muted); }\n.sw-hours__status--open::before { background: var(--sw-color-success, #15803d); }\n.sw-hours__status--closed::before { background: var(--sw-color-danger, #b91c1c); }\n.sw-hours__status[hidden] { display: none; }\n.sw-hours__detail, .sw-hours__note { margin: 0 0 0.25rem; color: var(--sw-color-muted); }\n.sw-hours__week { width: 100%; margin-top: var(--sw-space-1); border-collapse: collapse; font-variant-numeric: tabular-nums; }\n.sw-hours__week th, .sw-hours__week td { padding: 0.375rem 0; text-align: left; border-bottom: 1px solid var(--sw-color-border); vertical-align: top; }\n.sw-hours__week th { font-weight: 400; padding-right: var(--sw-space-2); }\n.sw-hours__today th, .sw-hours__today td { font-weight: 700; }\n.sw-hours__exceptions { margin-top: var(--sw-space-2); }\n.sw-hours__subhead { margin: 0 0 0.25rem; font-weight: 700; }\n.sw-hours__exceptions ul { margin: 0; padding-left: 1.25rem; }\n.sw-hours__exception-date { font-weight: 600; }\n";
|
package/dist/hours.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DATE_RE, HOURS_DAY_LABELS, HOURS_DAYS, formatClock, formatDateRange, hoursStatus, minutesOf, upcomingExceptions, weeklyTable, zoneOr, } from '@spillway-cms/shared';
|
|
3
|
+
import { cx, keyFor, ldJson, textOf } from './utility-shared.js';
|
|
4
|
+
export const HOURS_SCHEMA_TYPES = ['LocalBusiness', 'GovernmentOffice', 'Library', 'Place'];
|
|
5
|
+
const DAY_URL = {
|
|
6
|
+
MO: ['Monday'],
|
|
7
|
+
TU: ['Tuesday'],
|
|
8
|
+
WE: ['Wednesday'],
|
|
9
|
+
TH: ['Thursday'],
|
|
10
|
+
FR: ['Friday'],
|
|
11
|
+
SA: ['Saturday'],
|
|
12
|
+
SU: ['Sunday'],
|
|
13
|
+
weekdays: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
|
|
14
|
+
weekend: ['Saturday', 'Sunday'],
|
|
15
|
+
daily: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
|
|
16
|
+
};
|
|
17
|
+
/** The rows that are well formed (a known day and two HH:MM times). */
|
|
18
|
+
export function cleanRows(rows) {
|
|
19
|
+
return (Array.isArray(rows) ? rows : []).filter((r) => !!r && HOURS_DAYS.includes(r.day) && minutesOf(r.opens) !== null && minutesOf(r.closes) !== null);
|
|
20
|
+
}
|
|
21
|
+
/** The exceptions that apply to a location (its own and those for every location), well formed. */
|
|
22
|
+
export function exceptionsFor(exceptions, location) {
|
|
23
|
+
const name = location.trim().toLowerCase();
|
|
24
|
+
return (Array.isArray(exceptions) ? exceptions : [])
|
|
25
|
+
.filter((e) => !!e && typeof e.date === 'string' && DATE_RE.test(e.date.trim()))
|
|
26
|
+
.filter((e) => !e.location?.trim() || e.location.trim().toLowerCase() === name)
|
|
27
|
+
.map((e) => ({ ...e, date: e.date.trim(), ...(e.endDate?.trim() ? { endDate: e.endDate.trim() } : {}), closed: e.closed === true || e.closed === 'true' || minutesOf(e.opens) === null || minutesOf(e.closes) === null }));
|
|
28
|
+
}
|
|
29
|
+
/** The schema.org place for one location: its weekly rows and its exceptions as OpeningHoursSpecification. */
|
|
30
|
+
export function hoursJsonLd(type, loc, rows, exceptions) {
|
|
31
|
+
const spec = rows.map((r) => ({ '@type': 'OpeningHoursSpecification', dayOfWeek: DAY_URL[r.day].map((d) => `https://schema.org/${d}`), opens: r.opens, closes: r.closes }));
|
|
32
|
+
for (const e of exceptions) {
|
|
33
|
+
spec.push({ '@type': 'OpeningHoursSpecification', validFrom: e.date, validThrough: e.endDate && e.endDate >= e.date ? e.endDate : e.date, opens: e.closed ? '00:00' : e.opens, closes: e.closed ? '00:00' : e.closes });
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
'@context': 'https://schema.org',
|
|
37
|
+
'@type': HOURS_SCHEMA_TYPES.includes(type) ? type : 'LocalBusiness',
|
|
38
|
+
name: loc.title,
|
|
39
|
+
...(loc.address?.trim() ? { address: loc.address.trim() } : {}),
|
|
40
|
+
...(loc.phone?.trim() ? { telephone: loc.phone.trim() } : {}),
|
|
41
|
+
openingHoursSpecification: spec,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const dayOptions = HOURS_DAYS.map((d) => ({ label: HOURS_DAY_LABELS[d], value: d }));
|
|
45
|
+
export const hoursComponent = {
|
|
46
|
+
label: 'Hours of operation',
|
|
47
|
+
fields: {
|
|
48
|
+
title: { type: 'text', label: 'Title', contentEditable: true },
|
|
49
|
+
locations: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
label: 'Locations',
|
|
52
|
+
min: 1,
|
|
53
|
+
max: 12,
|
|
54
|
+
getItemSummary: (item, i) => item.title || `Location ${(i ?? 0) + 1}`,
|
|
55
|
+
arrayFields: {
|
|
56
|
+
title: { type: 'text', label: 'Name' },
|
|
57
|
+
address: { type: 'text', label: 'Address' },
|
|
58
|
+
phone: { type: 'text', label: 'Phone' },
|
|
59
|
+
note: { type: 'textarea', label: 'Note' },
|
|
60
|
+
hours: {
|
|
61
|
+
type: 'array',
|
|
62
|
+
label: 'Weekly hours (a day with no row is closed)',
|
|
63
|
+
getItemSummary: (r) => (r?.day ? `${HOURS_DAY_LABELS[r.day] ?? r.day} ${r.opens ?? ''}–${r.closes ?? ''}` : 'Hours'),
|
|
64
|
+
arrayFields: {
|
|
65
|
+
day: { type: 'select', label: 'Day', options: dayOptions },
|
|
66
|
+
opens: { type: 'text', label: 'Opens (HH:MM)', placeholder: '09:00' },
|
|
67
|
+
closes: { type: 'text', label: 'Closes (HH:MM)', placeholder: '17:00' },
|
|
68
|
+
},
|
|
69
|
+
defaultItemProps: { day: 'weekdays', opens: '09:00', closes: '17:00' },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
defaultItemProps: { title: 'Office', address: '', phone: '', note: '', hours: [{ day: 'weekdays', opens: '09:00', closes: '17:00' }] },
|
|
73
|
+
},
|
|
74
|
+
exceptions: {
|
|
75
|
+
type: 'array',
|
|
76
|
+
label: 'Exceptions and holidays',
|
|
77
|
+
getItemSummary: (e, i) => (e?.date ? `${e.date}${e.label ? ` ${e.label}` : ''}` : `Exception ${(i ?? 0) + 1}`),
|
|
78
|
+
arrayFields: {
|
|
79
|
+
date: { type: 'text', label: 'Date (YYYY-MM-DD)', placeholder: '2026-12-25' },
|
|
80
|
+
endDate: { type: 'text', label: 'Through (YYYY-MM-DD, optional)' },
|
|
81
|
+
label: { type: 'text', label: 'Label', placeholder: 'Winter break' },
|
|
82
|
+
closed: { type: 'radio', label: 'Hours', options: [{ label: 'Closed', value: true }, { label: 'Open', value: false }] },
|
|
83
|
+
opens: { type: 'text', label: 'Opens (HH:MM)' },
|
|
84
|
+
closes: { type: 'text', label: 'Closes (HH:MM)' },
|
|
85
|
+
location: { type: 'text', label: 'Location (empty: every location)' },
|
|
86
|
+
},
|
|
87
|
+
defaultItemProps: { date: '', endDate: '', label: '', closed: true, opens: '', closes: '', location: '' },
|
|
88
|
+
},
|
|
89
|
+
timeZone: { type: 'text', label: 'Time zone (empty: the site’s)', placeholder: 'America/Chicago' },
|
|
90
|
+
clock: { type: 'radio', label: 'Times', options: [{ label: '12-hour', value: '12' }, { label: '24-hour', value: '24' }] },
|
|
91
|
+
showWeek: { type: 'radio', label: 'Weekly table', options: [{ label: 'Show', value: true }, { label: 'Hide', value: false }] },
|
|
92
|
+
showExceptions: { type: 'radio', label: 'Holiday hours (the next 60 days)', options: [{ label: 'Show', value: true }, { label: 'Hide', value: false }] },
|
|
93
|
+
schemaType: { type: 'select', label: 'Structured data type', options: HOURS_SCHEMA_TYPES.map((t) => ({ label: t === 'LocalBusiness' ? 'Local business' : t === 'GovernmentOffice' ? 'Government office' : t, value: t })) },
|
|
94
|
+
structuredData: { type: 'radio', label: 'Opening hours in search results', options: [{ label: 'On', value: true }, { label: 'Off', value: false }] },
|
|
95
|
+
},
|
|
96
|
+
defaultProps: {
|
|
97
|
+
title: 'Hours',
|
|
98
|
+
locations: [
|
|
99
|
+
{
|
|
100
|
+
title: 'Main office',
|
|
101
|
+
address: '',
|
|
102
|
+
phone: '',
|
|
103
|
+
note: '',
|
|
104
|
+
hours: [
|
|
105
|
+
{ day: 'weekdays', opens: '08:30', closes: '17:00' },
|
|
106
|
+
{ day: 'SA', opens: '10:00', closes: '14:00' },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
exceptions: [],
|
|
111
|
+
timeZone: '',
|
|
112
|
+
clock: '12',
|
|
113
|
+
showWeek: true,
|
|
114
|
+
showExceptions: true,
|
|
115
|
+
schemaType: 'LocalBusiness',
|
|
116
|
+
structuredData: true,
|
|
117
|
+
},
|
|
118
|
+
render: (props) => {
|
|
119
|
+
const { title, locations, exceptions, timeZone, clock, showWeek, showExceptions, schemaType, structuredData, resolved } = props;
|
|
120
|
+
const tz = resolved?.timeZone ?? zoneOr(timeZone);
|
|
121
|
+
const ck = clock === '24' ? '24' : '12';
|
|
122
|
+
const key = keyFor('hours', props.id, JSON.stringify(locations ?? []).slice(0, 200));
|
|
123
|
+
const titleText = textOf(title);
|
|
124
|
+
const Name = titleText ? 'h3' : 'h2';
|
|
125
|
+
const list = (Array.isArray(locations) ? locations : []).filter((l) => l && (textOf(l.title).trim() || cleanRows(l.hours).length));
|
|
126
|
+
return (_jsx("section", { className: "sw-block sw-hours", "data-sw-hours": "", "data-tz": tz, "data-clock": ck, "aria-labelledby": titleText ? `${key}-title` : undefined, children: _jsxs("div", { className: "sw-container", children: [titleText ? (_jsx("h2", { className: "sw-hours__title", id: `${key}-title`, children: title })) : null, _jsx("div", { className: cx('sw-hours__grid', list.length > 1 && 'sw-hours__grid--many'), children: list.map((loc, i) => {
|
|
127
|
+
const name = textOf(loc.title).trim();
|
|
128
|
+
const rows = cleanRows(loc.hours);
|
|
129
|
+
const ex = exceptionsFor(exceptions, name);
|
|
130
|
+
const status = resolved ? hoursStatus({ rows, exceptions: ex }, resolved.now, tz, ck) : null;
|
|
131
|
+
const upcoming = showExceptions !== false && status ? upcomingExceptions(ex, status.today) : [];
|
|
132
|
+
const schedule = JSON.stringify({ rows: rows.map((r) => [r.day, r.opens, r.closes]), ex: ex.map((e) => [e.date, e.endDate ?? '', e.label ?? '', e.closed ? 1 : 0, e.opens ?? '', e.closes ?? '']) });
|
|
133
|
+
return (_jsxs("article", { className: "sw-hours__location", "data-sw-hours-schedule": schedule, "aria-labelledby": name ? `${key}-${i}` : undefined, children: [name ? (_jsx(Name, { className: "sw-hours__name", id: `${key}-${i}`, children: name })) : null, _jsx("p", { className: cx('sw-hours__status', status && (status.open ? 'sw-hours__status--open' : 'sw-hours__status--closed')), "data-sw-hours-status": "", hidden: status ? undefined : true, children: status?.text ?? '' }), loc.address?.trim() ? _jsx("p", { className: "sw-hours__detail", children: loc.address }) : null, loc.phone?.trim() ? (_jsx("p", { className: "sw-hours__detail", children: _jsx("a", { href: `tel:${loc.phone.replace(/[^\d+]/g, '')}`, children: loc.phone }) })) : null, loc.note?.trim() ? _jsx("p", { className: "sw-hours__note", children: loc.note }) : null, showWeek !== false ? (_jsxs("table", { className: "sw-hours__week", children: [_jsx("caption", { className: "sw-visually-hidden", children: name ? `Weekly hours, ${name}` : 'Weekly hours' }), _jsx("tbody", { children: weeklyTable(rows, ck).map((d, wd) => (_jsxs("tr", { "data-weekday": wd, className: status?.weekday === wd ? 'sw-hours__today' : undefined, "aria-current": status?.weekday === wd ? 'date' : undefined, children: [_jsx("th", { scope: "row", children: d.day }), _jsx("td", { children: d.hours })] }, d.day))) })] })) : null, upcoming.length ? (_jsxs("div", { className: "sw-hours__exceptions", children: [_jsx("p", { className: "sw-hours__subhead", children: "Holiday hours" }), _jsx("ul", { children: upcoming.map((e, j) => {
|
|
134
|
+
const o = minutesOf(e.opens);
|
|
135
|
+
const c = minutesOf(e.closes);
|
|
136
|
+
return (_jsxs("li", { children: [_jsx("span", { className: "sw-hours__exception-date", children: formatDateRange(e.date, e.endDate) }), `${e.label?.trim() ? ` (${e.label.trim()})` : ''}: ${e.closed || o === null || c === null ? 'Closed' : `${formatClock(o, ck)} to ${formatClock(c, ck)}`}`] }, j));
|
|
137
|
+
}) })] })) : null, structuredData !== false && name && (rows.length || ex.length) ? _jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: ldJson(hoursJsonLd(schemaType, { ...loc, title: name }, rows, ex)) } }) : null] }, i));
|
|
138
|
+
}) })] }) }));
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
export const HOURS_CSS = `
|
|
142
|
+
/* ---------- Hours of operation ---------- */
|
|
143
|
+
.sw-hours__title { margin: 0 0 var(--sw-space-2); }
|
|
144
|
+
.sw-hours__grid { display: grid; gap: var(--sw-space-3); }
|
|
145
|
+
@media (min-width: 640px) { .sw-hours__grid--many { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); } }
|
|
146
|
+
.sw-hours__location { padding: var(--sw-space-2); border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius); background: var(--sw-color-bg); }
|
|
147
|
+
.sw-hours__name { margin: 0 0 var(--sw-space-1); font-size: 1.25rem; }
|
|
148
|
+
.sw-hours__status { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 var(--sw-space-1); font-weight: 600; }
|
|
149
|
+
.sw-hours__status::before { content: ""; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--sw-color-muted); }
|
|
150
|
+
.sw-hours__status--open::before { background: var(--sw-color-success, #15803d); }
|
|
151
|
+
.sw-hours__status--closed::before { background: var(--sw-color-danger, #b91c1c); }
|
|
152
|
+
.sw-hours__status[hidden] { display: none; }
|
|
153
|
+
.sw-hours__detail, .sw-hours__note { margin: 0 0 0.25rem; color: var(--sw-color-muted); }
|
|
154
|
+
.sw-hours__week { width: 100%; margin-top: var(--sw-space-1); border-collapse: collapse; font-variant-numeric: tabular-nums; }
|
|
155
|
+
.sw-hours__week th, .sw-hours__week td { padding: 0.375rem 0; text-align: left; border-bottom: 1px solid var(--sw-color-border); vertical-align: top; }
|
|
156
|
+
.sw-hours__week th { font-weight: 400; padding-right: var(--sw-space-2); }
|
|
157
|
+
.sw-hours__today th, .sw-hours__today td { font-weight: 700; }
|
|
158
|
+
.sw-hours__exceptions { margin-top: var(--sw-space-2); }
|
|
159
|
+
.sw-hours__subhead { margin: 0 0 0.25rem; font-weight: 700; }
|
|
160
|
+
.sw-hours__exceptions ul { margin: 0; padding-left: 1.25rem; }
|
|
161
|
+
.sw-hours__exception-date { font-weight: 600; }
|
|
162
|
+
`;
|
|
163
|
+
//# sourceMappingURL=hours.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hours.js","sourceRoot":"","sources":["../src/hours.tsx"],"names":[],"mappings":";AAOA,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,MAAM,GAKP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA2BjE,MAAM,CAAC,MAAM,kBAAkB,GAAG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ICES.md). Each icon is its label, a few search words and its SVG shapes on a
|
|
4
|
+
* 24 by 24 grid, drawn with a 2 px round stroke in currentColor.
|
|
5
|
+
*/
|
|
6
|
+
export type IconShape = [tag: 'path' | 'circle' | 'rect' | 'line' | 'polyline' | 'polygon' | 'ellipse', attrs: Record<string, string>];
|
|
7
|
+
export interface IconDef {
|
|
8
|
+
label: string;
|
|
9
|
+
tags: string[];
|
|
10
|
+
shapes: IconShape[];
|
|
11
|
+
}
|
|
12
|
+
export declare const ICON_SOURCE: {
|
|
13
|
+
readonly name: "Lucide";
|
|
14
|
+
readonly version: "1.76.0";
|
|
15
|
+
readonly license: "ISC";
|
|
16
|
+
readonly url: "https://lucide.dev";
|
|
17
|
+
};
|
|
18
|
+
export declare const ICONS: Record<string, IconDef>;
|