@acms-subir/core 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/cli/preview.mjs +8 -4
- package/cli/sections.mjs +4 -2
- package/docs/mobile.md +1 -1
- package/docs/theme-authoring.md +19 -3
- package/integration.mjs +21 -4
- package/package.json +14 -12
- package/src/actions/index.ts +186 -3
- package/src/components/booking/BookingFlow.astro +6 -3
- package/src/components/calendar/BookingsHead.astro +51 -0
- package/src/components/calendar/CalendarBoard.tsx +618 -0
- package/src/components/calendar/MiniMonth.tsx +54 -0
- package/src/components/calendar/NewEventDialog.tsx +44 -0
- package/src/components/calendar/QuickAdd.tsx +263 -0
- package/src/components/calendar/RoomHolds.tsx +203 -0
- package/src/components/calendar/WhereItLands.tsx +51 -0
- package/src/components/editor/EventPanel.tsx +23 -2
- package/src/components/editor/PostEditor.tsx +32 -4
- package/src/components/import/ImportExport.tsx +4 -4
- package/src/components/import/runner.ts +20 -3
- package/src/layouts/Admin.astro +5 -6
- package/src/layouts/Site.astro +29 -2
- package/src/lib/backup/content.ts +6 -1
- package/src/lib/booking/agent.ts +3 -2
- package/src/lib/booking/approval.ts +70 -0
- package/src/lib/booking/holds.ts +120 -0
- package/src/lib/booking/service.ts +37 -3
- package/src/lib/calendar/agent-schema.ts +9 -1
- package/src/lib/calendar/agent.ts +16 -1
- package/src/lib/calendar/board.ts +171 -0
- package/src/lib/calendar/config.ts +3 -0
- package/src/lib/calendar/grid.ts +169 -0
- package/src/lib/calendar/migration.ts +16 -0
- package/src/lib/calendar/render.ts +9 -7
- package/src/lib/calendar/schedule.ts +166 -0
- package/src/lib/content-service.ts +5 -0
- package/src/lib/drafts.ts +1 -1
- package/src/lib/import/bundle.ts +2 -1
- package/src/lib/mobile/calendar.ts +10 -6
- package/src/lib/mobile/http.ts +6 -0
- package/src/lib/repo/migrations.ts +3 -0
- package/src/lib/repo/sql.ts +28 -16
- package/src/lib/repo/types.ts +2 -2
- package/src/lib/scheduler.ts +3 -1
- package/src/lib/schema.ts +49 -0
- package/src/lib/sections.ts +33 -8
- package/src/lib/site-chrome.ts +34 -0
- package/src/lib/theme-assets.ts +16 -0
- package/src/lib/theme.ts +17 -3
- package/src/middleware.ts +6 -2
- package/src/pages/admin/calendar/bookings.astro +32 -26
- package/src/pages/admin/calendar/calendars.astro +4 -263
- package/src/pages/admin/calendar/events/index.astro +41 -83
- package/src/pages/admin/calendar/index.astro +43 -0
- package/src/pages/admin/calendar/resources/[id].astro +27 -5
- package/src/pages/admin/calendar/resources/index.astro +16 -17
- package/src/pages/admin/calendar/resources/link.astro +52 -12
- package/src/pages/admin/calendar/settings.astro +458 -0
- package/src/pages/admin/integrations.astro +5 -11
- package/src/pages/book/[resource].ics.ts +7 -1
- package/src/styles/admin.css +48 -0
- package/src/styles/cards.css +5 -1
- package/src/styles/editor.css +36 -0
- package/src/styles/schedule.css +325 -0
- package/src/styles/sections.css +19 -16
- package/src/theme-sdk/fields.mjs +5 -1
- package/src/theme-sdk/index.ts +5 -1
- package/src/virtual.d.ts +3 -0
- package/src/pages/admin/calendar/index.ts +0 -4
package/src/styles/editor.css
CHANGED
|
@@ -1045,3 +1045,39 @@
|
|
|
1045
1045
|
@media (max-width: 767px) { .pe-langs { order: 3; } .pe-tr-fields input, .pe-tr-fields textarea { font-size: 16px; } }
|
|
1046
1046
|
.pe-seg button[aria-checked='true'] { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
|
|
1047
1047
|
:root[data-theme='dark'] .pe-seg button[aria-checked='true'] { background: #3a3632; }
|
|
1048
|
+
|
|
1049
|
+
/* Event settings → Rooms (components/calendar/RoomHolds.tsx) */
|
|
1050
|
+
.rh-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
|
|
1051
|
+
.rh-room { display: grid; grid-template-columns: 16px 1fr auto; gap: 9px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); cursor: pointer; }
|
|
1052
|
+
.rh-room:hover { border-color: var(--line-strong); }
|
|
1053
|
+
.rh-room.on { border-color: var(--accent-ring); background: var(--accent-soft); }
|
|
1054
|
+
.rh-room input { accent-color: var(--accent); margin: 0; }
|
|
1055
|
+
.rh-name { display: flex; flex-direction: column; min-width: 0; }
|
|
1056
|
+
.rh-name b { font-size: 13px; font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1057
|
+
.rh-name small { font-size: 11.5px; color: var(--faint); }
|
|
1058
|
+
.rh-st { font-size: 11.5px; white-space: nowrap; }
|
|
1059
|
+
.rh-st.free { color: var(--green); }
|
|
1060
|
+
.rh-st.busy { color: var(--amber); }
|
|
1061
|
+
.rh-span { display: flex; gap: 1px; padding: 2px; border-radius: 9px; background: var(--sel); margin: 4px 0 8px; }
|
|
1062
|
+
.rh-span button { flex: 1; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); padding: 5px 8px; border-radius: 7px; cursor: pointer; }
|
|
1063
|
+
.rh-span button[aria-pressed='true'] { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
|
|
1064
|
+
.rh-buffers { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
|
|
1065
|
+
.rh-buffers input { width: 64px; margin: 0 4px; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; }
|
|
1066
|
+
.rh-conflict { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); font-size: 12.5px; color: var(--text); }
|
|
1067
|
+
.rh-conflict > b { display: block; margin-bottom: 4px; }
|
|
1068
|
+
.rh-bk { display: flex; flex-direction: column; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
|
|
1069
|
+
.rh-bk small, .rh-more { color: var(--text-2); font-size: 11.5px; }
|
|
1070
|
+
.rh-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
|
|
1071
|
+
.rh-acts.end { justify-content: flex-end; }
|
|
1072
|
+
.rh-cancel textarea, .rh-msg { width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 12.5px; resize: vertical; }
|
|
1073
|
+
.rh-done { color: var(--green); }
|
|
1074
|
+
.rh-layer { position: fixed; inset: 0; z-index: 90; background: var(--dim); display: grid; place-items: center; padding: 16px; }
|
|
1075
|
+
.rh-dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 18px 20px; font-size: 13px; color: var(--text); }
|
|
1076
|
+
.rh-title { font-size: 15px; display: block; }
|
|
1077
|
+
.rh-sub { color: var(--muted); margin: 4px 0 12px; font-size: 12.5px; }
|
|
1078
|
+
.rh-rows { display: flex; flex-direction: column; gap: 6px; }
|
|
1079
|
+
.rh-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
|
|
1080
|
+
.rh-row span { display: flex; flex-direction: column; min-width: 0; }
|
|
1081
|
+
.rh-row small { color: var(--muted); font-size: 11.5px; }
|
|
1082
|
+
.rh-row select { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; }
|
|
1083
|
+
@media (max-width: 640px) { .rh-layer { place-items: end stretch; padding: 0; } .rh-dialog { border-radius: 16px 16px 0 0; } .rh-row { grid-template-columns: 1fr; } }
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/* Admin Schedule (components/calendar/*) — month/week grid, quick add, day
|
|
2
|
+
panel, peek. Built on admin.css tokens so light and night both work.
|
|
3
|
+
Event colors come in as --c; never as a left edge stripe — a square
|
|
4
|
+
marker, a tinted fill or a dashed outline carries the meaning. */
|
|
5
|
+
|
|
6
|
+
.sch { --sch-line: var(--line); display: flex; flex-direction: column; gap: 12px; position: relative; }
|
|
7
|
+
.sch.is-loading .sch-stage { opacity: .72; transition: opacity .15s; }
|
|
8
|
+
|
|
9
|
+
/* toolbar */
|
|
10
|
+
.sch-bar1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
|
11
|
+
.sch-title { font-size: 24px; margin: 0 6px 0 0; letter-spacing: -0.02em; font-weight: 650; white-space: nowrap; }
|
|
12
|
+
.sch-title .yr { color: var(--muted); font-weight: 500; }
|
|
13
|
+
.sch-nav { display: flex; gap: 6px; align-items: center; }
|
|
14
|
+
.btn.ico { padding-inline: 9px; min-width: 32px; justify-content: center; }
|
|
15
|
+
.btn.ico svg { width: 15px; height: 15px; display: block; }
|
|
16
|
+
.sch-sp { flex: 1; }
|
|
17
|
+
.sch-views a { text-decoration: none; }
|
|
18
|
+
.sch-new { position: relative; display: inline-flex; }
|
|
19
|
+
.sch-new > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
|
|
20
|
+
.sch-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgb(0 0 0 / 18%); padding-inline: 8px; }
|
|
21
|
+
.sch-menu {
|
|
22
|
+
position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; padding: 5px;
|
|
23
|
+
background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-pop);
|
|
24
|
+
display: flex; flex-direction: column;
|
|
25
|
+
}
|
|
26
|
+
.sch-menu > * {
|
|
27
|
+
display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px;
|
|
28
|
+
background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; text-decoration: none;
|
|
29
|
+
}
|
|
30
|
+
.sch-menu > *:hover { background: var(--hover); }
|
|
31
|
+
.sch-menu small { color: var(--muted); font-size: 11.5px; }
|
|
32
|
+
kbd { font: 10.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; background: transparent; }
|
|
33
|
+
.btn.primary kbd { color: inherit; border-color: rgb(255 255 255 / 35%); }
|
|
34
|
+
|
|
35
|
+
/* legend: click to show/hide a calendar */
|
|
36
|
+
.sch-legend { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; font-size: 12.5px; }
|
|
37
|
+
.sch-legend button {
|
|
38
|
+
display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 7px; border: 0; background: none;
|
|
39
|
+
color: var(--text-2); font: inherit; cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
.sch-legend button:hover { background: var(--hover); color: var(--text); }
|
|
42
|
+
.sch-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
|
|
43
|
+
.sch-legend .bk i { background: none; border: 1.5px solid var(--muted); }
|
|
44
|
+
.sch-legend button.off { color: var(--faint); text-decoration: line-through; }
|
|
45
|
+
.sch-legend button.off i { opacity: .35; }
|
|
46
|
+
.sch-legend small { color: var(--faint); font-size: 11px; }
|
|
47
|
+
.sch-legend-edit { margin-left: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; }
|
|
48
|
+
.sch-legend-edit:hover { color: var(--text); }
|
|
49
|
+
.sch-error { margin: 0; }
|
|
50
|
+
|
|
51
|
+
.sch-stage { display: flex; gap: 0; align-items: stretch; position: relative; }
|
|
52
|
+
.sch-stage > .sch-grid, .sch-stage > .sch-wk { flex: 1; min-width: 0; }
|
|
53
|
+
|
|
54
|
+
/* ---- month grid ---- */
|
|
55
|
+
.sch-grid { border: 1px solid var(--line); border-radius: var(--r-lg, 12px); overflow: hidden; background: var(--panel); user-select: none; }
|
|
56
|
+
.sch-dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
|
|
57
|
+
.sch-dows div { padding: 7px 10px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
|
|
58
|
+
.sch-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: clamp(104px, 13.5vh, 150px); border-bottom: 1px solid var(--line); position: relative; }
|
|
59
|
+
.sch-week:last-child { border-bottom: 0; }
|
|
60
|
+
.sch-cell { grid-row: 1 / -1; border-right: 1px solid var(--line); cursor: cell; transition: background .08s; }
|
|
61
|
+
.sch-cell:nth-child(7n) { border-right: 0; }
|
|
62
|
+
.sch-cell:hover { background: var(--hover); }
|
|
63
|
+
.sch-cell.out { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
|
|
64
|
+
.sch-cell.sel, .sch-cell.selecting { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent-ring); }
|
|
65
|
+
.sch-cell.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
|
|
66
|
+
.sch-num {
|
|
67
|
+
grid-row: 1; align-self: start; justify-self: start; display: flex; align-items: center;
|
|
68
|
+
padding: 6px 8px 3px; margin: 0; background: none; border: 0; font: inherit; font-size: 12px; color: var(--text-2);
|
|
69
|
+
cursor: pointer; position: relative; z-index: 1; text-align: left;
|
|
70
|
+
}
|
|
71
|
+
.sch-num b { font-weight: 500; padding: 1px 5px; border-radius: 6px; margin-left: -5px; }
|
|
72
|
+
.sch-num:hover b { background: var(--sel); color: var(--text); }
|
|
73
|
+
.sch-num.out { color: var(--faint); }
|
|
74
|
+
.sch-num.today b { background: var(--accent); color: var(--on-accent, #fff); font-weight: 650; }
|
|
75
|
+
.sch-cell { position: relative; }
|
|
76
|
+
.sch-cell:hover::after { content: '+'; position: absolute; top: 4px; right: 9px; color: var(--accent); font-size: 16px; font-weight: 600; line-height: 1.2; pointer-events: none; }
|
|
77
|
+
|
|
78
|
+
/* chips + bars share the item look */
|
|
79
|
+
.sch-chip, .sch-bar {
|
|
80
|
+
display: flex; align-items: center; gap: 6px; min-width: 0; margin: 1px 4px; padding: 2px 6px; border-radius: 6px;
|
|
81
|
+
font: inherit; font-size: 12px; line-height: 17px; text-align: left; border: 1px solid transparent; background: none; color: var(--text);
|
|
82
|
+
cursor: pointer; white-space: nowrap; overflow: hidden; position: relative; z-index: 1;
|
|
83
|
+
}
|
|
84
|
+
.sch-chip:hover { background: var(--sel); }
|
|
85
|
+
.sch-chip i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: none; }
|
|
86
|
+
.sch-chip .t { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
|
|
87
|
+
.sch-chip .n { overflow: hidden; text-overflow: ellipsis; }
|
|
88
|
+
.sch-bar { background: color-mix(in srgb, var(--c) 20%, transparent); font-weight: 550; display: block; text-overflow: ellipsis; }
|
|
89
|
+
.sch-bar:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }
|
|
90
|
+
.sch-bar em { font-style: normal; font-weight: 450; color: var(--text-2); }
|
|
91
|
+
.sch-bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
|
|
92
|
+
.sch-bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
|
|
93
|
+
/* drafts / scheduled: dashed, hollow marker, italic */
|
|
94
|
+
.is-draft { border: 1px dashed var(--line-strong); }
|
|
95
|
+
.sch-chip.is-draft i { background: none; border: 1.5px solid var(--c); }
|
|
96
|
+
.sch-chip.is-draft .n, .sch-bar.is-draft { font-style: italic; color: var(--text-2); }
|
|
97
|
+
.sch-bar.is-draft { background: color-mix(in srgb, var(--c) 9%, transparent); }
|
|
98
|
+
/* subscribed (read-only) */
|
|
99
|
+
.sch-bar.is-feed { background: transparent; border: 1px dashed var(--line-strong); color: var(--text-2); font-weight: 450; }
|
|
100
|
+
.sch-chip.is-feed .n { color: var(--text-2); }
|
|
101
|
+
/* bookings + blocks: neutral outline marker */
|
|
102
|
+
.is-booking i { background: none !important; border: 1.5px solid var(--muted); }
|
|
103
|
+
.sch-chip.is-booking .n { color: var(--text-2); }
|
|
104
|
+
.sch-bar.is-booking { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--text-2); }
|
|
105
|
+
.is-pending .n::after { content: ' · needs approval'; color: var(--amber); }
|
|
106
|
+
.is-cancelled .n, .sch-bar.is-cancelled { text-decoration: line-through; color: var(--muted); }
|
|
107
|
+
.is-preview { outline: 1.5px solid var(--accent); outline-offset: -1px; }
|
|
108
|
+
.is-dragging { opacity: .35; }
|
|
109
|
+
.can-drag { cursor: grab; }
|
|
110
|
+
.sch-more {
|
|
111
|
+
justify-self: start; align-self: center; margin: 0 4px; padding: 1px 6px; border: 0; background: none; border-radius: 6px;
|
|
112
|
+
font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; position: relative; z-index: 1;
|
|
113
|
+
}
|
|
114
|
+
.sch-more:hover { background: var(--sel); color: var(--text); }
|
|
115
|
+
|
|
116
|
+
/* ---- week ---- */
|
|
117
|
+
.sch-wk { border: 1px solid var(--line); border-radius: var(--r-lg, 12px); overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
|
|
118
|
+
.sch-wk-head, .sch-wk-allday { display: grid; grid-template-columns: 56px 1fr; border-bottom: 1px solid var(--line); }
|
|
119
|
+
.sch-wk-head { grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
|
|
120
|
+
.sch-wk-gutter { font-size: 10.5px; color: var(--faint); padding: 6px 8px; text-align: right; }
|
|
121
|
+
.sch-wk-day { display: flex; gap: 6px; align-items: baseline; justify-content: center; padding: 8px 4px; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); }
|
|
122
|
+
.sch-wk-day span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
|
|
123
|
+
.sch-wk-day b { font-size: 17px; color: var(--text); font-weight: 600; }
|
|
124
|
+
.sch-wk-day.today b { color: var(--accent); }
|
|
125
|
+
.sch-wk-allday { grid-template-rows: auto !important; }
|
|
126
|
+
.sch-wk-allday-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 24px; min-height: 28px; padding: 2px 0; }
|
|
127
|
+
.sch-wk-adcell { grid-row: 1 / -1; border-left: 1px solid var(--line); cursor: cell; }
|
|
128
|
+
.sch-wk-adcell:hover { background: var(--hover); }
|
|
129
|
+
.sch-wk-adcell.drop { background: var(--accent-soft); }
|
|
130
|
+
.sch-wk-body { position: relative; overflow-y: auto; max-height: min(70vh, 760px); display: grid; grid-template-columns: 56px 1fr; }
|
|
131
|
+
.sch-wk-hours { position: relative; }
|
|
132
|
+
.sch-wk-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
|
|
133
|
+
.sch-wk-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative;
|
|
134
|
+
background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 44px); }
|
|
135
|
+
.sch-wk-col { position: relative; border-left: 1px solid var(--line); cursor: cell; }
|
|
136
|
+
.sch-wk-col.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
|
|
137
|
+
.sch-wk-col.drop { background: var(--accent-soft); }
|
|
138
|
+
.sch-ev {
|
|
139
|
+
position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 3px 6px; overflow: hidden;
|
|
140
|
+
border-radius: 7px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 18%, var(--panel));
|
|
141
|
+
font: inherit; font-size: 11.5px; line-height: 15px; text-align: left; color: var(--text); cursor: pointer; z-index: 1;
|
|
142
|
+
}
|
|
143
|
+
.sch-ev b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
|
|
144
|
+
.sch-ev span { color: var(--text-2); white-space: nowrap; }
|
|
145
|
+
.sch-ev.is-draft { background: var(--panel); border-style: dashed; }
|
|
146
|
+
.sch-ev.is-draft b { font-style: italic; }
|
|
147
|
+
.sch-ev.is-booking { background: color-mix(in srgb, var(--muted) 12%, var(--panel)); border-color: var(--line-strong); }
|
|
148
|
+
.sch-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 2; pointer-events: none; }
|
|
149
|
+
.sch-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
|
|
150
|
+
|
|
151
|
+
/* ---- day panel ---- */
|
|
152
|
+
.sch-panel {
|
|
153
|
+
width: 320px; flex: none; margin-left: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg, 12px);
|
|
154
|
+
display: flex; flex-direction: column; max-height: calc(100vh - 170px); position: sticky; top: 64px; align-self: flex-start;
|
|
155
|
+
}
|
|
156
|
+
.sch-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
|
|
157
|
+
.sch-panel-head b { display: block; font-size: 14.5px; }
|
|
158
|
+
.sch-panel-head small { color: var(--muted); font-size: 12px; }
|
|
159
|
+
.sch-panel-head > span { display: flex; gap: 2px; }
|
|
160
|
+
.sch-panel-list { padding: 10px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
|
|
161
|
+
.sch-panel-add { margin: 0 10px 12px; padding: 9px 10px; border: 1px dashed var(--line-strong); border-radius: 9px; background: none; color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
|
|
162
|
+
.sch-panel-add:hover { color: var(--text); border-color: var(--faint); }
|
|
163
|
+
.sch-row {
|
|
164
|
+
display: grid; grid-template-columns: 9px 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 11px; border-radius: 9px;
|
|
165
|
+
background: var(--bg); border: 1px solid var(--line); font: inherit; text-align: left; color: var(--text); cursor: pointer; width: 100%;
|
|
166
|
+
}
|
|
167
|
+
.sch-row:hover { border-color: var(--line-strong); }
|
|
168
|
+
.sch-row i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
|
|
169
|
+
.sch-row.hollow i { background: none; border: 1.5px solid var(--c); }
|
|
170
|
+
.sch-row.hollow { border-style: dashed; }
|
|
171
|
+
.sch-row-main { min-width: 0; display: flex; flex-direction: column; }
|
|
172
|
+
.sch-row-main b { font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
173
|
+
.sch-row-main small { color: var(--muted); font-size: 11.5px; }
|
|
174
|
+
.sch-row-st { font-size: 11px; color: var(--muted); white-space: nowrap; }
|
|
175
|
+
.sch-row.is-cancelled b { text-decoration: line-through; color: var(--muted); }
|
|
176
|
+
|
|
177
|
+
/* ---- peek / ask ---- */
|
|
178
|
+
.sch-peek-layer { position: fixed; inset: 0; z-index: 70; }
|
|
179
|
+
.sch-peek-layer.center { display: grid; place-items: center; background: var(--dim); }
|
|
180
|
+
.sch-peek, .sch-ask {
|
|
181
|
+
position: fixed; width: 330px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px;
|
|
182
|
+
box-shadow: var(--shadow-pop); padding: 14px; font-size: 13px;
|
|
183
|
+
}
|
|
184
|
+
.sch-ask { position: static; width: min(420px, calc(100vw - 32px)); padding: 18px; }
|
|
185
|
+
.sch-ask b { font-size: 15px; }
|
|
186
|
+
.sch-ask p { color: var(--text-2); margin: 6px 0 14px; }
|
|
187
|
+
.sch-ask-actions { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
188
|
+
.sch-peek-head { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; }
|
|
189
|
+
.sch-peek-head i { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; }
|
|
190
|
+
.sch-peek-head i.hollow { background: none !important; border: 2px solid var(--muted); }
|
|
191
|
+
.sch-peek-head b { font-size: 14.5px; line-height: 1.35; }
|
|
192
|
+
.sch-x { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 2px; }
|
|
193
|
+
.sch-peek-when { margin: 6px 0 6px 20px; color: var(--text-2); }
|
|
194
|
+
.sch-peek-meta { list-style: none; margin: 0 0 12px 20px; padding: 0; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
|
|
195
|
+
.sch-peek-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 20px; align-items: center; }
|
|
196
|
+
.sch-peek-actions .danger { margin-left: auto; }
|
|
197
|
+
.btn.danger.ghost { color: var(--red); }
|
|
198
|
+
|
|
199
|
+
/* ---- toast ---- */
|
|
200
|
+
.sch-toast {
|
|
201
|
+
position: fixed; left: 50%; bottom: calc(22px + var(--tabbar-h, 0px)); transform: translateX(-50%); z-index: 80;
|
|
202
|
+
display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 10px; font-size: 13px;
|
|
203
|
+
background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop); max-width: calc(100vw - 32px);
|
|
204
|
+
}
|
|
205
|
+
.sch-toast button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 650; cursor: pointer; padding: 0; }
|
|
206
|
+
:root[data-theme='dark'] .sch-toast { background: #2e2b27; color: var(--text); border: 1px solid var(--line-strong); }
|
|
207
|
+
.sch-toast.err { background: var(--red); color: #fff; }
|
|
208
|
+
|
|
209
|
+
/* ---- quick add ---- */
|
|
210
|
+
.qa-layer { position: fixed; inset: 0; z-index: 75; }
|
|
211
|
+
.qa-layer-dialog { background: var(--dim); display: grid; place-items: center; padding: 16px; }
|
|
212
|
+
.qa {
|
|
213
|
+
background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-pop);
|
|
214
|
+
font-size: 13px; color: var(--text);
|
|
215
|
+
}
|
|
216
|
+
.qa-popover { position: fixed; width: 400px; padding: 16px; }
|
|
217
|
+
.qa-dialog { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 22px; padding: 20px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
|
|
218
|
+
.qa-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
|
219
|
+
.qa-title { font: inherit; font-size: 16px; font-weight: 600; border: 0; border-bottom: 1px solid var(--line-strong); background: none; color: var(--text); padding: 2px 0 8px; margin-bottom: 4px; outline: none; }
|
|
220
|
+
.qa-title:focus { border-bottom-color: var(--accent); }
|
|
221
|
+
.qa-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; }
|
|
222
|
+
.qa-lab { color: var(--muted); font-size: 12px; }
|
|
223
|
+
.qa input[type='date'], .qa input[type='time'], .qa select, .qa .qa-grow {
|
|
224
|
+
font: inherit; font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--text); padding: 5px 8px; min-width: 0;
|
|
225
|
+
}
|
|
226
|
+
.qa input:focus-visible, .qa select:focus-visible { outline: 2px solid var(--accent-ring); border-color: var(--accent); }
|
|
227
|
+
.qa-row.top { align-items: start; }
|
|
228
|
+
.qa-row.top .qa-lab { padding-top: 6px; }
|
|
229
|
+
.qa-when { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
|
|
230
|
+
.qa-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
231
|
+
.qa input[type='date'] { width: 142px; }
|
|
232
|
+
.qa input[type='time'] { width: 112px; }
|
|
233
|
+
.qa input.qa-title:focus, .qa input.qa-title:focus-visible { outline: none; box-shadow: none; border-color: transparent; border-bottom-color: var(--accent); }
|
|
234
|
+
.qa-dash { color: var(--muted); }
|
|
235
|
+
.qa-check { display: inline-flex; gap: 5px; align-items: center; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
|
|
236
|
+
.qa-cal { display: flex; align-items: center; gap: 8px; }
|
|
237
|
+
.qa-cal i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
|
|
238
|
+
.qa-cal i.none { border: 1.5px solid var(--line-strong); }
|
|
239
|
+
.qa-cal select { flex: 1; }
|
|
240
|
+
.qa-grow { width: 100%; }
|
|
241
|
+
.qa-error { color: var(--red); margin: 2px 0 0; font-size: 12.5px; }
|
|
242
|
+
.qa-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 8px; flex-wrap: wrap; }
|
|
243
|
+
.qa-more { margin-right: auto; }
|
|
244
|
+
.qa-side { display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--line); padding-left: 20px; }
|
|
245
|
+
.qa-also b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
|
|
246
|
+
.qa-also ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
|
|
247
|
+
.qa-also li { display: flex; gap: 7px; align-items: baseline; }
|
|
248
|
+
.qa-also li i { width: 7px; height: 7px; border-radius: 2px; flex: none; transform: translateY(-1px); }
|
|
249
|
+
.qa-free { color: var(--faint); font-size: 12px; }
|
|
250
|
+
|
|
251
|
+
/* mini month (also used inside the event editor) */
|
|
252
|
+
.mini-month { font-size: 11.5px; color: var(--text-2); user-select: none; }
|
|
253
|
+
.mini-month-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
|
|
254
|
+
.mini-month-head b { font-size: 12.5px; color: var(--text); }
|
|
255
|
+
.mini-nav { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; padding: 0 6px; border-radius: 6px; }
|
|
256
|
+
.mini-nav:hover { background: var(--hover); color: var(--text); }
|
|
257
|
+
.mini-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
|
|
258
|
+
.mini-dow { font-size: 10px; color: var(--faint); padding: 2px 0; }
|
|
259
|
+
.mini-day { position: relative; border: 0; background: none; font: inherit; color: var(--text-2); padding: 4px 0 7px; border-radius: 7px; cursor: pointer; font-variant-numeric: tabular-nums; }
|
|
260
|
+
.mini-day:hover { background: var(--hover); color: var(--text); }
|
|
261
|
+
.mini-day.out { color: var(--faint); }
|
|
262
|
+
.mini-day.today { color: var(--accent); font-weight: 700; }
|
|
263
|
+
.mini-day.sel { background: var(--accent); color: var(--on-accent, #fff); font-weight: 650; }
|
|
264
|
+
.mini-dots { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; gap: 2px; }
|
|
265
|
+
.mini-dots i { width: 4px; height: 4px; border-radius: 1px; }
|
|
266
|
+
.mini-day.sel .mini-dots i { background: currentColor !important; opacity: .8; }
|
|
267
|
+
|
|
268
|
+
/* ---- tablet: titles only ---- */
|
|
269
|
+
@media (max-width: 1024px) {
|
|
270
|
+
.sch-chip .t { display: none; }
|
|
271
|
+
.sch-panel { position: fixed; right: 12px; top: 64px; bottom: 12px; max-height: none; z-index: 50; box-shadow: var(--shadow-pop); margin: 0; }
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* ---- phone: compact month + day list, sheets ---- */
|
|
275
|
+
.sch-phone { display: flex; flex-direction: column; gap: 6px; width: 100%; position: relative; }
|
|
276
|
+
.sch-pgrid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
|
|
277
|
+
.sch-pdow { font-size: 10.5px; color: var(--muted); padding: 4px 0; }
|
|
278
|
+
.sch-pday { position: relative; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); padding: 8px 0 12px; border-radius: 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
|
|
279
|
+
.sch-pday.out { color: var(--faint); }
|
|
280
|
+
.sch-pday.today { color: var(--accent); font-weight: 700; }
|
|
281
|
+
.sch-pday.sel { background: var(--sel); box-shadow: inset 0 0 0 1.5px var(--accent); }
|
|
282
|
+
.sch-pdots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 2px; }
|
|
283
|
+
.sch-pdots i { width: 4px; height: 4px; border-radius: 1px; }
|
|
284
|
+
.sch-plist { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
|
|
285
|
+
.sch-plist-head { font-size: 12.5px; color: var(--muted); font-weight: 600; }
|
|
286
|
+
.sch-empty-day { color: var(--faint); margin: 4px 0; font-size: 13px; }
|
|
287
|
+
.sch-fab {
|
|
288
|
+
position: fixed; right: 18px; bottom: calc(18px + var(--tabbar-h, 0px)); width: 50px; height: 50px; border-radius: 14px; border: 0;
|
|
289
|
+
background: var(--accent); color: var(--on-accent, #fff); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 8px 22px var(--accent-ring); z-index: 30;
|
|
290
|
+
}
|
|
291
|
+
.sch-sheet-layer { position: fixed; inset: 0; z-index: 60; background: var(--dim); display: flex; align-items: flex-end; }
|
|
292
|
+
|
|
293
|
+
@media (max-width: 640px) {
|
|
294
|
+
.sch-title { font-size: 20px; }
|
|
295
|
+
.sch-bar1 { gap: 8px; }
|
|
296
|
+
.sch-sp { display: none; }
|
|
297
|
+
.sch-views { order: 5; }
|
|
298
|
+
.sch-legend { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
|
|
299
|
+
.sch-legend button { flex: none; }
|
|
300
|
+
.sch-sheet-layer .sch-panel { position: static; width: 100%; max-height: 80vh; border-radius: 16px 16px 0 0; margin: 0; padding-bottom: env(safe-area-inset-bottom); }
|
|
301
|
+
.qa-layer-popover, .qa-layer-dialog { background: var(--dim); display: flex; align-items: flex-end; padding: 0; }
|
|
302
|
+
.qa-popover, .qa-dialog { position: static; width: 100%; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
|
|
303
|
+
.qa-dialog { grid-template-columns: 1fr; }
|
|
304
|
+
.qa-side { display: none; }
|
|
305
|
+
.qa-actions .btn { flex: 1; justify-content: center; }
|
|
306
|
+
.qa-more { flex-basis: 100% !important; order: 3; }
|
|
307
|
+
.sch-peek { left: 12px !important; right: 12px; bottom: calc(12px + var(--tabbar-h, 0px)); top: auto !important; width: auto; }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* compact board (container < 620px): the + button replaces "New event" */
|
|
311
|
+
.sch.is-compact .sch-new { display: none; }
|
|
312
|
+
.sch.is-compact .sch-sp { display: none; }
|
|
313
|
+
.sch.is-compact .sch-title { font-size: 20px; }
|
|
314
|
+
.sch.is-compact .sch-legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
|
|
315
|
+
.sch.is-compact .sch-legend button { flex: none; }
|
|
316
|
+
|
|
317
|
+
/* event editor → When → where it lands */
|
|
318
|
+
.lands { margin: 10px 0 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
|
|
319
|
+
.lands-also { margin: 8px 2px 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
|
|
320
|
+
|
|
321
|
+
/* quick add → Rooms */
|
|
322
|
+
.qa-rooms { display: flex; flex-direction: column; gap: 4px; }
|
|
323
|
+
.qa-rooms em { font-style: normal; font-size: 11.5px; margin-left: 4px; }
|
|
324
|
+
.qa-rooms em.free { color: var(--green); }
|
|
325
|
+
.qa-rooms em.busy { color: var(--amber); }
|
package/src/styles/sections.css
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* Core section defaults. Every selector is wrapped in :where() so it has zero
|
|
2
|
+
specificity: any theme rule — even a single class — wins without !important
|
|
3
|
+
or doubled class names.
|
|
4
|
+
A section page is a layout, not an article: break out of the reading column
|
|
2
5
|
to the theme's wide width (same frame as the header); sections decide their
|
|
3
6
|
own inner measure. Prose from the page itself keeps the reading width. */
|
|
4
|
-
.acms-sections{display:grid;gap:calc(3rem * var(--density,1));margin-block:2rem;margin-inline:calc((100% - min(var(--wide-width), 100vw - 2 * var(--gutter))) / 2)}
|
|
5
|
-
.section-page-content>.page-body{max-width:var(--content-width);margin-inline:auto}
|
|
6
|
-
.acms-section{padding:clamp(1rem,4vw,3rem);border-radius:var(--r-lg);min-width:0}
|
|
7
|
-
.acms-section h2{font-family:var(--font-heading);font-size:clamp(1.7rem,4vw,3rem);line-height:1.15}
|
|
8
|
-
.section-text{white-space:pre-line;max-width:65ch;color:var(--muted)}
|
|
9
|
-
.acms-section>.section-copy{max-width:48rem}
|
|
10
|
-
.section-hero.variant-split{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:2rem}
|
|
11
|
-
.section-hero.variant-centered{text-align:center}.section-hero.variant-centered .section-text{margin-inline:auto}
|
|
12
|
-
.section-image{width:100%;max-height:32rem;object-fit:cover;border-radius:var(--r)}
|
|
13
|
-
.section-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1.25rem;margin-top:1.5rem}
|
|
14
|
-
.variant-list .section-items,.section-faq .section-items{grid-template-columns:1fr}
|
|
15
|
-
.section-items>article:not(.post-card),.section-items>details{background:var(--panel);padding:1.25rem;border:1px solid var(--line);border-radius:var(--r)}
|
|
16
|
-
.section-items summary{cursor:pointer;font-weight:600}.section-cta.variant-panel{background:var(--soft)}
|
|
17
|
-
@media(max-width:640px){.section-hero.variant-split{grid-template-columns:1fr}.acms-section{padding:1rem}}
|
|
18
|
-
.acms-off-schedule{opacity:.55;outline:2px dashed var(--line-2,#ccc);outline-offset:-2px}
|
|
7
|
+
:where(.acms-sections){display:grid;gap:calc(3rem * var(--density,1));margin-block:2rem;margin-inline:calc((100% - min(var(--wide-width), 100vw - 2 * var(--gutter))) / 2)}
|
|
8
|
+
:where(.section-page-content>.page-body){max-width:var(--content-width);margin-inline:auto}
|
|
9
|
+
:where(.acms-section){padding:clamp(1rem,4vw,3rem);border-radius:var(--r-lg);min-width:0}
|
|
10
|
+
:where(.acms-section h2){font-family:var(--font-heading);font-size:clamp(1.7rem,4vw,3rem);line-height:1.15}
|
|
11
|
+
:where(.section-text){white-space:pre-line;max-width:65ch;color:var(--muted)}
|
|
12
|
+
:where(.acms-section>.section-copy){max-width:48rem}
|
|
13
|
+
:where(.section-hero.variant-split){display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:2rem}
|
|
14
|
+
:where(.section-hero.variant-centered){text-align:center}:where(.section-hero.variant-centered .section-text){margin-inline:auto}
|
|
15
|
+
:where(.section-image){width:100%;max-height:32rem;object-fit:cover;border-radius:var(--r)}
|
|
16
|
+
:where(.section-items){display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1.25rem;margin-top:1.5rem}
|
|
17
|
+
:where(.variant-list .section-items,.section-faq .section-items){grid-template-columns:1fr}
|
|
18
|
+
:where(.section-items>article:not(.post-card),.section-items>details){background:var(--panel);padding:1.25rem;border:1px solid var(--line);border-radius:var(--r)}
|
|
19
|
+
:where(.section-items summary){cursor:pointer;font-weight:600}:where(.section-cta.variant-panel){background:var(--soft)}
|
|
20
|
+
@media(max-width:640px){:where(.section-hero.variant-split){grid-template-columns:1fr}:where(.acms-section){padding:1rem}}
|
|
21
|
+
:where(.acms-off-schedule){opacity:.55;outline:2px dashed var(--line-2,#ccc);outline-offset:-2px}
|
package/src/theme-sdk/fields.mjs
CHANGED
|
@@ -14,6 +14,8 @@ export const SOURCE_KINDS = /** @type {const} */ (['events', 'posts', 'bookings'
|
|
|
14
14
|
export const SOURCE_LIMIT_MAX = 24;
|
|
15
15
|
|
|
16
16
|
export const SAFE_URL = /^(https?:\/\/|mailto:|tel:|\/(?!\/)|#)/i;
|
|
17
|
+
// a file inside the theme folder, resolved to its built URL when rendered
|
|
18
|
+
export const THEME_ASSET = /^(\.\/)?assets\/(?!.*\.\.)[^?#\s]+$/;
|
|
17
19
|
export const safeUrl = (value) => {
|
|
18
20
|
const s = String(value ?? '').trim();
|
|
19
21
|
return SAFE_URL.test(s) ? s : '';
|
|
@@ -187,7 +189,9 @@ export function valueIssues(field, value, path = field.label) {
|
|
|
187
189
|
case 'number': return typeof value === 'number' && Number.isFinite(value) ? [] : bad();
|
|
188
190
|
case 'toggle': return typeof value === 'boolean' ? [] : bad();
|
|
189
191
|
case 'select': return typeof value === 'string' && (value === '' || field.options?.includes(value)) ? [] : bad();
|
|
190
|
-
case 'url':
|
|
192
|
+
case 'url': return typeof value === 'string' && (value === '' || SAFE_URL.test(value.trim())) ? [] : bad(`${field.label} must be an http(s) or site-relative link`);
|
|
193
|
+
// images may also name a file the theme ships ("assets/hero.jpg")
|
|
194
|
+
case 'image': return typeof value === 'string' && (value === '' || SAFE_URL.test(value.trim()) || THEME_ASSET.test(value.trim())) ? [] : bad(`${field.label} must be an http(s) or site-relative link, or a theme file like assets/hero.jpg`);
|
|
191
195
|
case 'date': return typeof value === 'string' && (value === '' || /^\d{4}-\d{2}-\d{2}$/.test(value)) ? [] : bad(`${field.label} must be a date (YYYY-MM-DD)`);
|
|
192
196
|
case 'time': return typeof value === 'string' && (value === '' || /^([01]?\d|2[0-3]):[0-5]\d$/.test(value)) ? [] : bad(`${field.label} must be a time (HH:MM)`);
|
|
193
197
|
case 'link': {
|
package/src/theme-sdk/index.ts
CHANGED
|
@@ -16,7 +16,11 @@ export interface EventProps { settings: Settings; event: CalEvent; html: string;
|
|
|
16
16
|
* `acms theme types <slug>` writes a typed Data interface per section.
|
|
17
17
|
*/
|
|
18
18
|
export interface SectionProps<D = Record<string, unknown>> { data: D; variant: string; settings: Settings; page: Page }
|
|
19
|
-
export type { LinkValue, EventItem, PostItem, BookingItem } from '../lib/sections';
|
|
19
|
+
export type { LinkValue, EventItem, PostItem, PostAuthor, BookingItem } from '../lib/sections';
|
|
20
|
+
/** Props for templates/header.astro and templates/footer.astro. */
|
|
21
|
+
export type { SiteChrome, ChromeLink } from '../lib/site-chrome';
|
|
22
|
+
import type { SiteChrome } from '../lib/site-chrome';
|
|
23
|
+
export interface ChromeProps { site: SiteChrome }
|
|
20
24
|
|
|
21
25
|
export { slugify, authorSlug } from '../lib/schema';
|
|
22
26
|
|
package/src/virtual.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare module 'virtual:acms-config' {
|
|
|
22
22
|
base: string;
|
|
23
23
|
eventsBase: string;
|
|
24
24
|
bookings: boolean;
|
|
25
|
+
bookingApproval?: 'auto' | 'rules' | 'manual';
|
|
25
26
|
bookBase: string;
|
|
26
27
|
resourceKinds: string[];
|
|
27
28
|
defaultView: 'month' | 'week' | 'list';
|
|
@@ -37,4 +38,6 @@ declare module 'virtual:acms-user-themes' {
|
|
|
37
38
|
export const postTpls: Record<string, { default: unknown }>;
|
|
38
39
|
export const pageTpls: Record<string, { default: unknown }>;
|
|
39
40
|
export const eventTpls: Record<string, { default: unknown }>;
|
|
41
|
+
export const headerTpls: Record<string, { default: unknown }>;
|
|
42
|
+
export const footerTpls: Record<string, { default: unknown }>;
|
|
40
43
|
}
|