ferst-core 0.16.0 → 0.17.0
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/NOTICE +63 -31
- package/bin/ferst-modules.mjs +17 -2
- package/components/BlockRenderer.astro +131 -129
- package/components/MembersAccount.astro +370 -0
- package/components/SiteHeader.astro +23 -1
- package/components/islands/BookMonth.tsx +95 -0
- package/components/islands/MembersAccount.tsx +392 -0
- package/components/recipes/Book.astro +1147 -926
- package/components/recipes/MembersContent.astro +176 -0
- package/content/blocks.ts +25 -6
- package/content/cookies.ts +14 -0
- package/content/recipe-questions.ts +81 -80
- package/examples/recipes.ts +1 -0
- package/integration.mjs +319 -253
- package/layouts/Base.astro +1 -0
- package/lib/book.ts +416 -378
- package/lib/members-account.ts +276 -0
- package/lib/members.ts +115 -0
- package/package.json +80 -72
- package/routes/account.astro +16 -0
- package/routes/cookie-policy.astro +28 -28
package/NOTICE
CHANGED
|
@@ -1,31 +1,63 @@
|
|
|
1
|
-
Ferst Core
|
|
2
|
-
Copyright 2026 MyAI4 Ltd
|
|
3
|
-
|
|
4
|
-
This product includes software developed by MyAI4 Ltd (https://ferst.co.uk).
|
|
5
|
-
|
|
6
|
-
Versions 0.2.0 and later are licensed under the Business Source License 1.1
|
|
7
|
-
(see LICENSE). The Licensed Work may be used in production to build, operate
|
|
8
|
-
and maintain individual websites, but not to provide a multi-tenant or hosted
|
|
9
|
-
website service to third parties. Four years after a version is published it
|
|
10
|
-
converts automatically to the Change License, the Apache License, Version 2.0
|
|
11
|
-
(see LICENSE-Apache-2.0).
|
|
12
|
-
|
|
13
|
-
Versions 0.1.x were released under the Apache License, Version 2.0 and remain
|
|
14
|
-
available under that licence.
|
|
15
|
-
|
|
16
|
-
When you redistribute this software or a derivative work, retain this NOTICE
|
|
17
|
-
and the attribution above.
|
|
18
|
-
|
|
19
|
-
--------------------------------------------------------------------------------
|
|
20
|
-
Third-party notices
|
|
21
|
-
|
|
22
|
-
Some inline icon shapes in lib/icons.ts are derived from Lucide
|
|
23
|
-
(https://lucide.dev), used under the ISC License:
|
|
24
|
-
|
|
25
|
-
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part
|
|
26
|
-
of Feather (MIT). All other copyright (c) for Lucide are held by Lucide
|
|
27
|
-
Contributors 2022.
|
|
28
|
-
|
|
29
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
30
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
31
|
-
copyright notice and this permission notice appear in all copies.
|
|
1
|
+
Ferst Core
|
|
2
|
+
Copyright 2026 MyAI4 Ltd
|
|
3
|
+
|
|
4
|
+
This product includes software developed by MyAI4 Ltd (https://ferst.co.uk).
|
|
5
|
+
|
|
6
|
+
Versions 0.2.0 and later are licensed under the Business Source License 1.1
|
|
7
|
+
(see LICENSE). The Licensed Work may be used in production to build, operate
|
|
8
|
+
and maintain individual websites, but not to provide a multi-tenant or hosted
|
|
9
|
+
website service to third parties. Four years after a version is published it
|
|
10
|
+
converts automatically to the Change License, the Apache License, Version 2.0
|
|
11
|
+
(see LICENSE-Apache-2.0).
|
|
12
|
+
|
|
13
|
+
Versions 0.1.x were released under the Apache License, Version 2.0 and remain
|
|
14
|
+
available under that licence.
|
|
15
|
+
|
|
16
|
+
When you redistribute this software or a derivative work, retain this NOTICE
|
|
17
|
+
and the attribution above.
|
|
18
|
+
|
|
19
|
+
--------------------------------------------------------------------------------
|
|
20
|
+
Third-party notices
|
|
21
|
+
|
|
22
|
+
Some inline icon shapes in lib/icons.ts are derived from Lucide
|
|
23
|
+
(https://lucide.dev), used under the ISC License:
|
|
24
|
+
|
|
25
|
+
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part
|
|
26
|
+
of Feather (MIT). All other copyright (c) for Lucide are held by Lucide
|
|
27
|
+
Contributors 2022.
|
|
28
|
+
|
|
29
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
30
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
31
|
+
copyright notice and this permission notice appear in all copies.
|
|
32
|
+
|
|
33
|
+
The Book block's month (look: "calendar") is a React island (docs/BLOCK-ARCHITECTURE.md
|
|
34
|
+
section 8). What it ships to a visitor's browser includes:
|
|
35
|
+
|
|
36
|
+
- React, React DOM, scheduler and use-sync-external-store
|
|
37
|
+
(https://github.com/facebook/react), Copyright (c) Meta Platforms, Inc. and affiliates,
|
|
38
|
+
and @astrojs/react (https://github.com/withastro/astro), Copyright (c) 2021 Fred K.
|
|
39
|
+
Schott (with portions Copyright (c) 2020 SvelteKit contributors), under the MIT License:
|
|
40
|
+
|
|
41
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
42
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
43
|
+
the Software without restriction, including without limitation the rights to
|
|
44
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
45
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
46
|
+
subject to the following conditions:
|
|
47
|
+
|
|
48
|
+
The above copyright notice and this permission notice shall be included in all
|
|
49
|
+
copies or substantial portions of the Software.
|
|
50
|
+
|
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
52
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
53
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
54
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
55
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
56
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
57
|
+
|
|
58
|
+
- React Aria Components, React Aria, React Stately, @internationalized/date,
|
|
59
|
+
@internationalized/string, @internationalized/number and @react-types/shared
|
|
60
|
+
(https://github.com/adobe/react-spectrum), Copyright 2019 Adobe, and @swc/helpers
|
|
61
|
+
(https://github.com/swc-project/swc), Copyright (c) SWC contributors, under the Apache
|
|
62
|
+
License, Version 2.0 (a copy is in LICENSE-Apache-2.0). None of them carries a NOTICE
|
|
63
|
+
file of its own.
|
package/bin/ferst-modules.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// ferst-modules — what this site has from its organisation's modules in the Ferst portal:
|
|
3
|
-
// the forms it can place, what it can take payment for and bookings for,
|
|
3
|
+
// the forms it can place, what it can take payment for and bookings for, its members' pages, and
|
|
4
|
+
// the calendar it shows.
|
|
4
5
|
// Run it in a client repo root:
|
|
5
6
|
//
|
|
6
7
|
// npx --no-install ferst-modules # the site named in ferst-site.json
|
|
@@ -10,7 +11,8 @@
|
|
|
10
11
|
// Forms and calendars live in the portal, never in the repo: place a form with a
|
|
11
12
|
// `{ "type": "form", "form": "<its name on this site>" }` block, take a payment with a
|
|
12
13
|
// `{ "type": "pay", "item": "<its id>" }` block, take bookings with a
|
|
13
|
-
// `{ "type": "book", "service": "<its id>" }` block (or `"resource"`, for a person or a place),
|
|
14
|
+
// `{ "type": "book", "service": "<its id>" }` block (or `"resource"`, for a person or a place), show a
|
|
15
|
+
// members' page with a `{ "type": "membersContent", "page": "<its id>" }` block, and show the calendar by setting
|
|
14
16
|
// calendarSettings.embedUrl to the address printed here.
|
|
15
17
|
import { readFileSync, realpathSync } from 'node:fs';
|
|
16
18
|
import { resolve } from 'node:path';
|
|
@@ -105,6 +107,19 @@ export function formatModules(data) {
|
|
|
105
107
|
out.push('');
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
// Members (platform 2026-11-30+): the members' pages this site shows, titles only (the pages
|
|
111
|
+
// themselves are members-only and never in the repo).
|
|
112
|
+
if (data.modules.members !== undefined || data.members !== undefined) {
|
|
113
|
+
out.push('Members');
|
|
114
|
+
if (!data.modules.members) out.push(' The Members module is off for this site.');
|
|
115
|
+
else if (!data.members?.pages?.length) out.push(' No members’ pages on this site yet. They are written in the portal (Members, Pages).');
|
|
116
|
+
for (const p of data.members?.pages ?? []) {
|
|
117
|
+
out.push(` ${p.title}`);
|
|
118
|
+
out.push(` place it with: { "type": "membersContent", "page": "${p.id}" }`);
|
|
119
|
+
}
|
|
120
|
+
out.push('');
|
|
121
|
+
}
|
|
122
|
+
|
|
108
123
|
// `calendar` since the platform renamed the module (2026-11-19); `events` before it.
|
|
109
124
|
const calendar = data.calendar !== undefined ? data.calendar : data.events;
|
|
110
125
|
out.push('Calendar');
|
|
@@ -1,129 +1,131 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* Renders an ordered list of blocks by mapping each block's `type` to its
|
|
4
|
-
* component via a registry. Disabled blocks are skipped. The registry is typed
|
|
5
|
-
* `Record<BlockType, …>`, so adding a block type to the union without a renderer
|
|
6
|
-
* here is a compile error — no silent `undefined` component at runtime.
|
|
7
|
-
*/
|
|
8
|
-
import type { Block, BlockType } from '../content/blocks';
|
|
9
|
-
import Heading from './blocks/Heading.astro';
|
|
10
|
-
import Prose from './blocks/Prose.astro';
|
|
11
|
-
import ImageBlock from './blocks/ImageBlock.astro';
|
|
12
|
-
import ButtonBlock from './blocks/ButtonBlock.astro';
|
|
13
|
-
import Quote from './blocks/Quote.astro';
|
|
14
|
-
import Divider from './blocks/Divider.astro';
|
|
15
|
-
import Spacer from './blocks/Spacer.astro';
|
|
16
|
-
import Badge from './blocks/Badge.astro';
|
|
17
|
-
import Stat from './blocks/Stat.astro';
|
|
18
|
-
import List from './blocks/List.astro';
|
|
19
|
-
import Section from './blocks/Section.astro';
|
|
20
|
-
import Grid from './blocks/Grid.astro';
|
|
21
|
-
import Stack from './blocks/Stack.astro';
|
|
22
|
-
import Hero from './recipes/Hero.astro';
|
|
23
|
-
import FeatureCards from './recipes/FeatureCards.astro';
|
|
24
|
-
import Cta from './recipes/Cta.astro';
|
|
25
|
-
import Faq from './recipes/Faq.astro';
|
|
26
|
-
import Gallery from './recipes/Gallery.astro';
|
|
27
|
-
import Testimonial from './recipes/Testimonial.astro';
|
|
28
|
-
import ContactForm from './recipes/ContactForm.astro';
|
|
29
|
-
import Form from './recipes/Form.astro';
|
|
30
|
-
import Pay from './recipes/Pay.astro';
|
|
31
|
-
import Book from './recipes/Book.astro';
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* Renders an ordered list of blocks by mapping each block's `type` to its
|
|
4
|
+
* component via a registry. Disabled blocks are skipped. The registry is typed
|
|
5
|
+
* `Record<BlockType, …>`, so adding a block type to the union without a renderer
|
|
6
|
+
* here is a compile error — no silent `undefined` component at runtime.
|
|
7
|
+
*/
|
|
8
|
+
import type { Block, BlockType } from '../content/blocks';
|
|
9
|
+
import Heading from './blocks/Heading.astro';
|
|
10
|
+
import Prose from './blocks/Prose.astro';
|
|
11
|
+
import ImageBlock from './blocks/ImageBlock.astro';
|
|
12
|
+
import ButtonBlock from './blocks/ButtonBlock.astro';
|
|
13
|
+
import Quote from './blocks/Quote.astro';
|
|
14
|
+
import Divider from './blocks/Divider.astro';
|
|
15
|
+
import Spacer from './blocks/Spacer.astro';
|
|
16
|
+
import Badge from './blocks/Badge.astro';
|
|
17
|
+
import Stat from './blocks/Stat.astro';
|
|
18
|
+
import List from './blocks/List.astro';
|
|
19
|
+
import Section from './blocks/Section.astro';
|
|
20
|
+
import Grid from './blocks/Grid.astro';
|
|
21
|
+
import Stack from './blocks/Stack.astro';
|
|
22
|
+
import Hero from './recipes/Hero.astro';
|
|
23
|
+
import FeatureCards from './recipes/FeatureCards.astro';
|
|
24
|
+
import Cta from './recipes/Cta.astro';
|
|
25
|
+
import Faq from './recipes/Faq.astro';
|
|
26
|
+
import Gallery from './recipes/Gallery.astro';
|
|
27
|
+
import Testimonial from './recipes/Testimonial.astro';
|
|
28
|
+
import ContactForm from './recipes/ContactForm.astro';
|
|
29
|
+
import Form from './recipes/Form.astro';
|
|
30
|
+
import Pay from './recipes/Pay.astro';
|
|
31
|
+
import Book from './recipes/Book.astro';
|
|
32
|
+
import MembersContent from './recipes/MembersContent.astro';
|
|
33
|
+
import Accordion from './recipes/Accordion.astro';
|
|
34
|
+
import Tiles from './recipes/Tiles.astro';
|
|
35
|
+
import Banner from './recipes/Banner.astro';
|
|
36
|
+
import Stats from './recipes/Stats.astro';
|
|
37
|
+
import Steps from './recipes/Steps.astro';
|
|
38
|
+
import Pricing from './recipes/Pricing.astro';
|
|
39
|
+
import Logos from './recipes/Logos.astro';
|
|
40
|
+
import Tabs from './recipes/Tabs.astro';
|
|
41
|
+
import Announcement from './recipes/Announcement.astro';
|
|
42
|
+
import Bento from './recipes/Bento.astro';
|
|
43
|
+
import Marquee from './recipes/Marquee.astro';
|
|
44
|
+
import LatestPosts from './recipes/LatestPosts.astro';
|
|
45
|
+
import MapEmbed from './recipes/MapEmbed.astro';
|
|
46
|
+
import Table from './recipes/Table.astro';
|
|
47
|
+
import Notice from './recipes/Notice.astro';
|
|
48
|
+
import MediaCards from './recipes/MediaCards.astro';
|
|
49
|
+
import ContactCard from './recipes/ContactCard.astro';
|
|
50
|
+
import Locations from './recipes/Locations.astro';
|
|
51
|
+
import Video from './recipes/Video.astro';
|
|
52
|
+
import Documents from './recipes/Documents.astro';
|
|
53
|
+
import LinkRow from './recipes/LinkRow.astro';
|
|
54
|
+
import DocumentRecipe from './recipes/Document.astro';
|
|
55
|
+
import Timetable from './recipes/Timetable.astro';
|
|
56
|
+
import Contacts from './recipes/Contacts.astro';
|
|
57
|
+
import MediaText from './recipes/MediaText.astro';
|
|
58
|
+
|
|
59
|
+
interface Props {
|
|
60
|
+
blocks: Block[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const { blocks } = Astro.props;
|
|
64
|
+
|
|
65
|
+
const registry: Record<BlockType, any> = {
|
|
66
|
+
heading: Heading,
|
|
67
|
+
prose: Prose,
|
|
68
|
+
image: ImageBlock,
|
|
69
|
+
button: ButtonBlock,
|
|
70
|
+
quote: Quote,
|
|
71
|
+
divider: Divider,
|
|
72
|
+
spacer: Spacer,
|
|
73
|
+
badge: Badge,
|
|
74
|
+
stat: Stat,
|
|
75
|
+
list: List,
|
|
76
|
+
section: Section,
|
|
77
|
+
grid: Grid,
|
|
78
|
+
stack: Stack,
|
|
79
|
+
hero: Hero,
|
|
80
|
+
featureCards: FeatureCards,
|
|
81
|
+
cta: Cta,
|
|
82
|
+
faq: Faq,
|
|
83
|
+
gallery: Gallery,
|
|
84
|
+
testimonial: Testimonial,
|
|
85
|
+
contactForm: ContactForm,
|
|
86
|
+
form: Form,
|
|
87
|
+
pay: Pay,
|
|
88
|
+
book: Book,
|
|
89
|
+
membersContent: MembersContent,
|
|
90
|
+
accordion: Accordion,
|
|
91
|
+
tiles: Tiles,
|
|
92
|
+
banner: Banner,
|
|
93
|
+
stats: Stats,
|
|
94
|
+
steps: Steps,
|
|
95
|
+
pricing: Pricing,
|
|
96
|
+
logos: Logos,
|
|
97
|
+
tabs: Tabs,
|
|
98
|
+
announcement: Announcement,
|
|
99
|
+
bento: Bento,
|
|
100
|
+
marquee: Marquee,
|
|
101
|
+
latestPosts: LatestPosts,
|
|
102
|
+
mapEmbed: MapEmbed,
|
|
103
|
+
table: Table,
|
|
104
|
+
notice: Notice,
|
|
105
|
+
mediaCards: MediaCards,
|
|
106
|
+
contactCard: ContactCard,
|
|
107
|
+
locations: Locations,
|
|
108
|
+
video: Video,
|
|
109
|
+
documents: Documents,
|
|
110
|
+
linkRow: LinkRow,
|
|
111
|
+
document: DocumentRecipe,
|
|
112
|
+
timetable: Timetable,
|
|
113
|
+
contacts: Contacts,
|
|
114
|
+
mediaText: MediaText,
|
|
115
|
+
};
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
{
|
|
119
|
+
blocks
|
|
120
|
+
.filter((block) => block.enabled !== false)
|
|
121
|
+
.map((block) => {
|
|
122
|
+
const Component = registry[block.type];
|
|
123
|
+
// A block's own `align` sets the alignment cascade for everything inside it. The
|
|
124
|
+
// wrapper is `display: contents`, so it adds no box and the layout is unchanged;
|
|
125
|
+
// heading / banner / section handle their own `align`.
|
|
126
|
+
const own = block.type === 'heading' || block.type === 'banner' || block.type === 'section';
|
|
127
|
+
return block.align && !own
|
|
128
|
+
? <div class="block-align" data-content-align={block.align}><Component {...block} /></div>
|
|
129
|
+
: <Component {...block} />;
|
|
130
|
+
})
|
|
131
|
+
}
|