@backgold/template-kit 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/chunk-RJAVFRC6.js +67 -0
- package/dist/constants-BAIo_Q5U.d-lQbj1e1-.d.ts +48 -0
- package/dist/content-api-Cox1-wz5.d.ts +1096 -0
- package/dist/contract/content-api-examples.d.ts +72 -0
- package/dist/contract/content-api-examples.js +926 -0
- package/dist/contract/content-api.d.ts +2 -0
- package/dist/contract/content-api.js +1 -0
- package/dist/contract/site-templates.d.ts +253 -0
- package/dist/contract/site-templates.js +185 -0
- package/package.json +70 -3
- package/src/components/EntryCard.astro +35 -0
- package/src/components/EventMap.astro +118 -0
- package/src/components/EventPage.astro +194 -0
- package/src/components/FieldValue.astro +41 -0
- package/src/components/LeadingHero.astro +21 -0
- package/src/components/NotFound.astro +20 -0
- package/src/components/PageSections.astro +47 -0
- package/src/components/Prose.astro +18 -0
- package/src/components/chrome/Brand.astro +61 -0
- package/src/components/chrome/ClosingCall.astro +94 -0
- package/src/components/chrome/DonateStrip.astro +61 -0
- package/src/components/chrome/FooterColumns.astro +32 -0
- package/src/components/chrome/FooterContact.astro +28 -0
- package/src/components/chrome/MenuList.astro +45 -0
- package/src/components/chrome/ModeToggle.astro +125 -0
- package/src/components/chrome/SignedInNotice.astro +53 -0
- package/src/components/chrome/SignupBand.astro +12 -0
- package/src/components/chrome/TakeoverBanner.astro +56 -0
- package/src/components/chrome/VisitorAccount.astro +82 -0
- package/src/components/entries/AuthorBox.astro +47 -0
- package/src/components/entries/EntryFields.astro +29 -0
- package/src/components/entries/EntryHeader.astro +77 -0
- package/src/components/entries/ListFrame.astro +126 -0
- package/src/components/entries/ListSearch.astro +24 -0
- package/src/components/entries/Share.astro +24 -0
- package/src/components/entries/course/classroom.astro +26 -0
- package/src/components/entries/course/lesson.astro +18 -0
- package/src/components/entries/course/section.ts +20 -0
- package/src/components/entries/course/syllabus.astro +15 -0
- package/src/components/entries/index.ts +77 -0
- package/src/components/entries/newsletter/issue.astro +41 -0
- package/src/components/entries/newsletter/list.astro +26 -0
- package/src/components/entries/podcast/episode.astro +42 -0
- package/src/components/entries/podcast/list.astro +36 -0
- package/src/components/entries/post/article.astro +31 -0
- package/src/components/entries/post/list.astro +85 -0
- package/src/components/entries/props.ts +61 -0
- package/src/components/entries/video/cards.astro +39 -0
- package/src/components/entries/video/grid.astro +15 -0
- package/src/components/entries/video/watch.astro +41 -0
- package/src/components/live/LivePage.astro +215 -0
- package/src/components/live/LocalTime.astro +29 -0
- package/src/components/sections/About/books.astro +188 -0
- package/src/components/sections/About/credentials.ts +80 -0
- package/src/components/sections/About/index.astro +60 -0
- package/src/components/sections/About/left.astro +57 -0
- package/src/components/sections/About/letter.astro +111 -0
- package/src/components/sections/About/portrait.astro +308 -0
- package/src/components/sections/Advocacy/compact.astro +14 -0
- package/src/components/sections/Advocacy/index.astro +14 -0
- package/src/components/sections/Band.astro +39 -0
- package/src/components/sections/Blog/feature.astro +176 -0
- package/src/components/sections/Blog/index.astro +37 -0
- package/src/components/sections/Blog/latest.ts +80 -0
- package/src/components/sections/Blog/list.astro +186 -0
- package/src/components/sections/Booking/index.astro +139 -0
- package/src/components/sections/Booking/list.astro +144 -0
- package/src/components/sections/Booking/types.ts +60 -0
- package/src/components/sections/Calendar/agenda.astro +14 -0
- package/src/components/sections/Calendar/index.astro +14 -0
- package/src/components/sections/CandidateRoster/ballot.astro +394 -0
- package/src/components/sections/CandidateRoster/candidates.ts +69 -0
- package/src/components/sections/CandidateRoster/compact.astro +115 -0
- package/src/components/sections/CandidateRoster/index.astro +57 -0
- package/src/components/sections/CaseStudies/beforeafter.astro +222 -0
- package/src/components/sections/CaseStudies/cases.ts +111 -0
- package/src/components/sections/CaseStudies/grid.astro +261 -0
- package/src/components/sections/CaseStudies/index.astro +333 -0
- package/src/components/sections/Classroom/CourseCard.astro +181 -0
- package/src/components/sections/Classroom/Courses.astro +88 -0
- package/src/components/sections/Classroom/classroom.ts +141 -0
- package/src/components/sections/Classroom/index.astro +20 -0
- package/src/components/sections/Classroom/list.astro +15 -0
- package/src/components/sections/Collection/compact.astro +7 -0
- package/src/components/sections/Collection/entries.ts +62 -0
- package/src/components/sections/Collection/feature.astro +180 -0
- package/src/components/sections/Collection/index.astro +46 -0
- package/src/components/sections/Collection/library.astro +271 -0
- package/src/components/sections/Collection/list.astro +7 -0
- package/src/components/sections/Collection/outline.astro +134 -0
- package/src/components/sections/Collection/shelves.astro +191 -0
- package/src/components/sections/Comparison/Unlisted.astro +6 -0
- package/src/components/sections/Comparison/cards.astro +171 -0
- package/src/components/sections/Comparison/index.astro +191 -0
- package/src/components/sections/Comparison/sides.ts +98 -0
- package/src/components/sections/Comparison/spectrum.astro +261 -0
- package/src/components/sections/ContentPost/banner.astro +152 -0
- package/src/components/sections/ContentPost/index.astro +35 -0
- package/src/components/sections/ContentPost/lesson.ts +126 -0
- package/src/components/sections/ContentPost/player.astro +254 -0
- package/src/components/sections/ContentPost/prose.astro +80 -0
- package/src/components/sections/ContentPost/theater.astro +329 -0
- package/src/components/sections/Countdown/index.astro +53 -0
- package/src/components/sections/Course/Bar.astro +46 -0
- package/src/components/sections/Course/CourseHead.astro +123 -0
- package/src/components/sections/Course/Crumbs.astro +44 -0
- package/src/components/sections/Course/Icon.astro +29 -0
- package/src/components/sections/Course/Ring.astro +62 -0
- package/src/components/sections/Course/Syllabus.astro +146 -0
- package/src/components/sections/Course/course.ts +146 -0
- package/src/components/sections/Course/index.astro +143 -0
- package/src/components/sections/Course/outline.astro +39 -0
- package/src/components/sections/Cta/banner.astro +64 -0
- package/src/components/sections/Cta/card.astro +88 -0
- package/src/components/sections/Cta/index.astro +31 -0
- package/src/components/sections/Cta/photo.astro +114 -0
- package/src/components/sections/Cta/strip.astro +91 -0
- package/src/components/sections/Donate/index.astro +136 -0
- package/src/components/sections/Donate/story.astro +7 -0
- package/src/components/sections/Event/card.astro +14 -0
- package/src/components/sections/Event/index.astro +14 -0
- package/src/components/sections/EventsList/AgendaMonths.astro +105 -0
- package/src/components/sections/EventsList/CalendarLine.astro +23 -0
- package/src/components/sections/EventsList/EventRows.astro +196 -0
- package/src/components/sections/EventsList/LiveCounts.astro +75 -0
- package/src/components/sections/EventsList/TypeTabs.astro +53 -0
- package/src/components/sections/EventsList/agenda.astro +55 -0
- package/src/components/sections/EventsList/calendar.astro +392 -0
- package/src/components/sections/EventsList/cards.astro +186 -0
- package/src/components/sections/EventsList/cohorts.astro +205 -0
- package/src/components/sections/EventsList/compact.astro +163 -0
- package/src/components/sections/EventsList/events.ts +168 -0
- package/src/components/sections/EventsList/index.astro +46 -0
- package/src/components/sections/EventsList/map.astro +436 -0
- package/src/components/sections/EventsList/shifts.astro +355 -0
- package/src/components/sections/EventsList/week.astro +361 -0
- package/src/components/sections/Faq/Contact.astro +63 -0
- package/src/components/sections/Faq/Questions.astro +98 -0
- package/src/components/sections/Faq/cards.astro +74 -0
- package/src/components/sections/Faq/faq.ts +101 -0
- package/src/components/sections/Faq/index.astro +49 -0
- package/src/components/sections/Faq/topics.astro +178 -0
- package/src/components/sections/Financials/Foot.astro +38 -0
- package/src/components/sections/Financials/Head.astro +47 -0
- package/src/components/sections/Financials/donut.astro +197 -0
- package/src/components/sections/Financials/financials.ts +52 -0
- package/src/components/sections/Financials/index.astro +148 -0
- package/src/components/sections/Financials/table.astro +157 -0
- package/src/components/sections/FormBlock/index.astro +33 -0
- package/src/components/sections/FormBlock/wide.astro +7 -0
- package/src/components/sections/Hero/cover.astro +176 -0
- package/src/components/sections/Hero/donate.astro +209 -0
- package/src/components/sections/Hero/field.astro +390 -0
- package/src/components/sections/Hero/index.astro +52 -0
- package/src/components/sections/Hero/overlap.astro +151 -0
- package/src/components/sections/Hero/rotating.astro +30 -0
- package/src/components/sections/Hero/split.astro +99 -0
- package/src/components/sections/Hero/statement.astro +55 -0
- package/src/components/sections/Hero/video.astro +399 -0
- package/src/components/sections/Issues/checklist.astro +204 -0
- package/src/components/sections/Issues/drawer.astro +237 -0
- package/src/components/sections/Issues/index.astro +115 -0
- package/src/components/sections/Issues/issues.ts +37 -0
- package/src/components/sections/Issues/numbered.astro +79 -0
- package/src/components/sections/Issues/rows.astro +137 -0
- package/src/components/sections/Issues/steps.astro +81 -0
- package/src/components/sections/Issues/tabs.astro +322 -0
- package/src/components/sections/Leaderboard/index.astro +29 -0
- package/src/components/sections/Lesson/Door.astro +121 -0
- package/src/components/sections/Lesson/LessonBody.astro +416 -0
- package/src/components/sections/Lesson/Rail.astro +182 -0
- package/src/components/sections/Lesson/Tracker.astro +137 -0
- package/src/components/sections/Lesson/index.astro +27 -0
- package/src/components/sections/Lesson/lesson.ts +233 -0
- package/src/components/sections/Lesson/reading.astro +21 -0
- package/src/components/sections/Map/CoverageLine.astro +19 -0
- package/src/components/sections/Map/RegionMap.astro +109 -0
- package/src/components/sections/Map/bar.astro +160 -0
- package/src/components/sections/Map/index.astro +192 -0
- package/src/components/sections/Map/map.astro +275 -0
- package/src/components/sections/MediaKit/BioCard.astro +108 -0
- package/src/components/sections/MediaKit/Downloads.astro +88 -0
- package/src/components/sections/MediaKit/index.astro +183 -0
- package/src/components/sections/MediaKit/kit.ts +140 -0
- package/src/components/sections/MediaKit/press.astro +189 -0
- package/src/components/sections/MediaKit/speaker.astro +205 -0
- package/src/components/sections/Membership/Benefits.astro +42 -0
- package/src/components/sections/Membership/Check.astro +12 -0
- package/src/components/sections/Membership/Price.astro +61 -0
- package/src/components/sections/Membership/compare.astro +312 -0
- package/src/components/sections/Membership/index.astro +281 -0
- package/src/components/sections/Membership/offers.ts +169 -0
- package/src/components/sections/Membership/tiers.astro +217 -0
- package/src/components/sections/MovementMap/index.astro +50 -0
- package/src/components/sections/MovementTicker/index.astro +43 -0
- package/src/components/sections/Pathways/Doors.astro +147 -0
- package/src/components/sections/Pathways/Head.astro +37 -0
- package/src/components/sections/Pathways/index.astro +27 -0
- package/src/components/sections/Pathways/pathways.ts +100 -0
- package/src/components/sections/Pathways/quiz.astro +286 -0
- package/src/components/sections/Pathways/tabs.astro +271 -0
- package/src/components/sections/PdfEmbed/card.astro +99 -0
- package/src/components/sections/PdfEmbed/index.astro +26 -0
- package/src/components/sections/PdfEmbed/medium.astro +7 -0
- package/src/components/sections/PdfEmbed/tall.astro +7 -0
- package/src/components/sections/Petition/coverage.astro +14 -0
- package/src/components/sections/Petition/image.astro +14 -0
- package/src/components/sections/Petition/index.astro +14 -0
- package/src/components/sections/Petition/map.astro +14 -0
- package/src/components/sections/PlatformPlanks/anchors.ts +66 -0
- package/src/components/sections/PlatformPlanks/columns.astro +171 -0
- package/src/components/sections/PlatformPlanks/index.astro +56 -0
- package/src/components/sections/PlatformPlanks/longread.astro +250 -0
- package/src/components/sections/PollBlock/index.astro +30 -0
- package/src/components/sections/Portfolio/featured.astro +343 -0
- package/src/components/sections/Portfolio/index.astro +571 -0
- package/src/components/sections/Portfolio/strip.astro +173 -0
- package/src/components/sections/Portfolio/work.ts +100 -0
- package/src/components/sections/Progress/MatchClock.astro +166 -0
- package/src/components/sections/Progress/compact.astro +150 -0
- package/src/components/sections/Progress/index.astro +32 -0
- package/src/components/sections/Progress/match.astro +126 -0
- package/src/components/sections/Progress/ring.astro +179 -0
- package/src/components/sections/QuickDonate/DonateCard.astro +149 -0
- package/src/components/sections/QuickDonate/Picker.astro +95 -0
- package/src/components/sections/QuickDonate/band.astro +164 -0
- package/src/components/sections/QuickDonate/bar.astro +208 -0
- package/src/components/sections/QuickDonate/donate.ts +126 -0
- package/src/components/sections/QuickDonate/hero.astro +143 -0
- package/src/components/sections/QuickDonate/index.astro +73 -0
- package/src/components/sections/QuickDonate/jar.astro +225 -0
- package/src/components/sections/QuickDonate/ladder.astro +248 -0
- package/src/components/sections/QuoteStrip/carousel.astro +340 -0
- package/src/components/sections/QuoteStrip/index.astro +58 -0
- package/src/components/sections/QuoteStrip/logos.astro +226 -0
- package/src/components/sections/QuoteStrip/quotes.ts +61 -0
- package/src/components/sections/QuoteStrip/single.astro +92 -0
- package/src/components/sections/QuoteStrip/ticker.astro +319 -0
- package/src/components/sections/QuoteStrip/wall.astro +113 -0
- package/src/components/sections/Resources/band.astro +93 -0
- package/src/components/sections/Resources/featured.astro +239 -0
- package/src/components/sections/Resources/index.astro +225 -0
- package/src/components/sections/Resources/resources.ts +92 -0
- package/src/components/sections/SampleBallot/Position.astro +39 -0
- package/src/components/sections/SampleBallot/ballot.ts +92 -0
- package/src/components/sections/SampleBallot/cards.astro +299 -0
- package/src/components/sections/SampleBallot/index.astro +326 -0
- package/src/components/sections/SampleBallot/measures.astro +172 -0
- package/src/components/sections/Scorecard/grades.astro +141 -0
- package/src/components/sections/Scorecard/index.astro +294 -0
- package/src/components/sections/Scorecard/promise.astro +167 -0
- package/src/components/sections/Scorecard/votes.ts +83 -0
- package/src/components/sections/SectionHead.astro +31 -0
- package/src/components/sections/Services/Button.astro +24 -0
- package/src/components/sections/Services/Check.astro +12 -0
- package/src/components/sections/Services/Includes.astro +42 -0
- package/src/components/sections/Services/compare.astro +328 -0
- package/src/components/sections/Services/index.astro +187 -0
- package/src/components/sections/Services/list.astro +181 -0
- package/src/components/sections/Services/services.ts +80 -0
- package/src/components/sections/ShareKit/Actions.astro +71 -0
- package/src/components/sections/ShareKit/Buttons.astro +62 -0
- package/src/components/sections/ShareKit/compact.astro +123 -0
- package/src/components/sections/ShareKit/index.astro +160 -0
- package/src/components/sections/ShareKit/share.ts +60 -0
- package/src/components/sections/ShareKit/strip.astro +173 -0
- package/src/components/sections/SignupCapture/band.astro +7 -0
- package/src/components/sections/SignupCapture/index.astro +103 -0
- package/src/components/sections/SignupCapture/inline.astro +7 -0
- package/src/components/sections/SocialFeed/index.astro +34 -0
- package/src/components/sections/StatCards/feature.astro +143 -0
- package/src/components/sections/StatCards/index.astro +51 -0
- package/src/components/sections/StatCards/ribbon.astro +113 -0
- package/src/components/sections/StatCards/wall.astro +177 -0
- package/src/components/sections/Store/featured.astro +14 -0
- package/src/components/sections/Store/index.astro +14 -0
- package/src/components/sections/Stories/Status.astro +42 -0
- package/src/components/sections/Stories/StoryCards.astro +171 -0
- package/src/components/sections/Stories/cards.astro +42 -0
- package/src/components/sections/Stories/index.astro +238 -0
- package/src/components/sections/Stories/stories.ts +97 -0
- package/src/components/sections/Stories/timeline.astro +135 -0
- package/src/components/sections/TeamGrid/board.astro +280 -0
- package/src/components/sections/TeamGrid/index.astro +71 -0
- package/src/components/sections/TeamGrid/list.astro +306 -0
- package/src/components/sections/TeamGrid/people.ts +178 -0
- package/src/components/sections/VideoEmbed/index.astro +52 -0
- package/src/components/sections/VideoEmbed/landscape.astro +7 -0
- package/src/components/sections/VideoEmbed/portrait.astro +7 -0
- package/src/components/sections/VideoEmbed/square.astro +7 -0
- package/src/components/sections/VoterTools/DaysLeft.astro +33 -0
- package/src/components/sections/VoterTools/Lookup.astro +43 -0
- package/src/components/sections/VoterTools/dates.astro +153 -0
- package/src/components/sections/VoterTools/index.astro +231 -0
- package/src/components/sections/VoterTools/polling.astro +144 -0
- package/src/components/sections/VoterTools/voter-tools.ts +71 -0
- package/src/components/sections/index.ts +373 -0
- package/src/components/sections/modules/Headed.astro +39 -0
- package/src/components/sections/modules/ModuleFrame.astro +181 -0
- package/src/components/store/CollectionPage.astro +40 -0
- package/src/components/store/ProductCard.astro +32 -0
- package/src/components/store/ProductGrid.astro +16 -0
- package/src/components/store/ProductPage.astro +146 -0
- package/src/components/store/StorePage.astro +137 -0
- package/src/components/store/StoreScript.astro +572 -0
- package/src/components/volunteer/ShiftLive.astro +90 -0
- package/src/components/volunteer/detail.astro +247 -0
- package/src/components/volunteer/list.astro +298 -0
- package/src/components/volunteer/props.ts +21 -0
- package/src/env.d.ts +22 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +63 -0
- package/src/layouts/Site.astro +387 -0
- package/src/lib/academy.ts +146 -0
- package/src/lib/brand.ts +534 -0
- package/src/lib/chrome.ts +121 -0
- package/src/lib/donate-frame.ts +104 -0
- package/src/lib/entries.ts +190 -0
- package/src/lib/env.ts +34 -0
- package/src/lib/event-map-draw.ts +91 -0
- package/src/lib/events.ts +476 -0
- package/src/lib/fonts.ts +116 -0
- package/src/lib/footer.ts +24 -0
- package/src/lib/format.ts +160 -0
- package/src/lib/geo.ts +131 -0
- package/src/lib/live.ts +55 -0
- package/src/lib/menu.ts +48 -0
- package/src/lib/petition-text.ts +29 -0
- package/src/lib/reading.ts +17 -0
- package/src/lib/regions.ts +215 -0
- package/src/lib/section.ts +105 -0
- package/src/lib/shifts.ts +187 -0
- package/src/lib/store.ts +521 -0
- package/src/lib/stream-time.ts +20 -0
- package/src/lib/stream.ts +141 -0
- package/src/lib/visitor.ts +54 -0
- package/src/routes/catch-all.astro +435 -0
- package/src/routes/form.astro +30 -0
- package/src/routes/live.astro +49 -0
- package/src/routes/not-found.astro +18 -0
- package/src/routes/preview.astro +60 -0
- package/src/routes/setup.astro +62 -0
- package/src/routes/volunteer-shift.astro +61 -0
- package/src/styles/entries.css +784 -0
- package/src/styles/site.css +1910 -0
- package/src/styles/store.css +634 -0
- package/src/template.ts +182 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
// Which component renders each section type, by the type's name in BackGold.
|
|
2
|
+
// `<Section components={sections}>` (from @backgold/astro) looks a section up
|
|
3
|
+
// here as '<Type>:<variant>' first, where the variant is the section's stored
|
|
4
|
+
// layout (the Layout chosen in BackGold), then as '<Type>'; a type that is
|
|
5
|
+
// not listed renders through the package's DefaultSection, so a block
|
|
6
|
+
// BackGold adds later still shows. The areas (src/layouts/Site.astro and the
|
|
7
|
+
// Sidebar in src/routes/catch-all.astro) draw their sections through this map
|
|
8
|
+
// too, TakeoverBanner among them. It is `kitSections` (src/template.ts); a
|
|
9
|
+
// template's own `sections` is this map with the layouts it draws itself
|
|
10
|
+
// added.
|
|
11
|
+
//
|
|
12
|
+
// Each type has a directory: `<Type>/index.astro` is its default layout (the
|
|
13
|
+
// first one a template.json lists) and `<Type>/<layout>.astro` each other
|
|
14
|
+
// layout it lists for it. Every layout the kit draws is registered below; a
|
|
15
|
+
// layout BackGold stores that the template's map does not list falls back to
|
|
16
|
+
// `<Type>/index.astro`, which gets the layout as its `variant` prop.
|
|
17
|
+
//
|
|
18
|
+
// BackGold's money and consent modules (Donate, FormBlock, PollBlock,
|
|
19
|
+
// Petition, Store, Event, Calendar, SignupCapture, Advocacy) are listed for
|
|
20
|
+
// their frame only: each draws its section's heading and its card around
|
|
21
|
+
// BackGold's own frame (modules/ModuleFrame.astro),
|
|
22
|
+
// which it asks to wear the site in the chosen layout. The fields, limits,
|
|
23
|
+
// receipts and consent stay inside BackGold's frame; never draw them here.
|
|
24
|
+
// SocialFrame has no frame a site can place and stays unlisted.
|
|
25
|
+
//
|
|
26
|
+
// The academy's sections (Classroom, Course, Lesson) read their courses for
|
|
27
|
+
// the visitor signed in on the site, if any (lib/visitor.ts): a section's
|
|
28
|
+
// baked rows are the public courses only, and a visitor's progress and locks
|
|
29
|
+
// come from the visitor's own reads, never from the cached page data.
|
|
30
|
+
|
|
31
|
+
import About from './About/index.astro'
|
|
32
|
+
import Blog from './Blog/index.astro'
|
|
33
|
+
import CandidateRoster from './CandidateRoster/index.astro'
|
|
34
|
+
import Classroom from './Classroom/index.astro'
|
|
35
|
+
import ClassroomList from './Classroom/list.astro'
|
|
36
|
+
import Collection from './Collection/index.astro'
|
|
37
|
+
import ContentPost from './ContentPost/index.astro'
|
|
38
|
+
import ContentPostPlayer from './ContentPost/player.astro'
|
|
39
|
+
import ContentPostBanner from './ContentPost/banner.astro'
|
|
40
|
+
import ContentPostTheater from './ContentPost/theater.astro'
|
|
41
|
+
import ContentPostProse from './ContentPost/prose.astro'
|
|
42
|
+
import Countdown from './Countdown/index.astro'
|
|
43
|
+
import Course from './Course/index.astro'
|
|
44
|
+
import CourseOutline from './Course/outline.astro'
|
|
45
|
+
import Cta from './Cta/index.astro'
|
|
46
|
+
import EventsList from './EventsList/index.astro'
|
|
47
|
+
import Hero from './Hero/index.astro'
|
|
48
|
+
import Issues from './Issues/index.astro'
|
|
49
|
+
import Leaderboard from './Leaderboard/index.astro'
|
|
50
|
+
import Lesson from './Lesson/index.astro'
|
|
51
|
+
import LessonReading from './Lesson/reading.astro'
|
|
52
|
+
import MapSection from './Map/index.astro'
|
|
53
|
+
import MovementMap from './MovementMap/index.astro'
|
|
54
|
+
import MovementTicker from './MovementTicker/index.astro'
|
|
55
|
+
import PdfEmbed from './PdfEmbed/index.astro'
|
|
56
|
+
import PlatformPlanks from './PlatformPlanks/index.astro'
|
|
57
|
+
import Progress from './Progress/index.astro'
|
|
58
|
+
import QuoteStrip from './QuoteStrip/index.astro'
|
|
59
|
+
import SocialFeed from './SocialFeed/index.astro'
|
|
60
|
+
import StatCards from './StatCards/index.astro'
|
|
61
|
+
import TeamGrid from './TeamGrid/index.astro'
|
|
62
|
+
import VideoEmbed from './VideoEmbed/index.astro'
|
|
63
|
+
|
|
64
|
+
import AboutLeft from './About/left.astro'
|
|
65
|
+
import AboutLetter from './About/letter.astro'
|
|
66
|
+
import AboutPortrait from './About/portrait.astro'
|
|
67
|
+
import AboutBooks from './About/books.astro'
|
|
68
|
+
import BlogList from './Blog/list.astro'
|
|
69
|
+
import BlogFeature from './Blog/feature.astro'
|
|
70
|
+
import CandidateRosterBallot from './CandidateRoster/ballot.astro'
|
|
71
|
+
import CandidateRosterCompact from './CandidateRoster/compact.astro'
|
|
72
|
+
import CollectionList from './Collection/list.astro'
|
|
73
|
+
import CollectionCompact from './Collection/compact.astro'
|
|
74
|
+
import CollectionFeature from './Collection/feature.astro'
|
|
75
|
+
import CollectionLibrary from './Collection/library.astro'
|
|
76
|
+
import CollectionShelves from './Collection/shelves.astro'
|
|
77
|
+
import CollectionOutline from './Collection/outline.astro'
|
|
78
|
+
import CtaBanner from './Cta/banner.astro'
|
|
79
|
+
import CtaCard from './Cta/card.astro'
|
|
80
|
+
import CtaPhoto from './Cta/photo.astro'
|
|
81
|
+
import CtaStrip from './Cta/strip.astro'
|
|
82
|
+
import EventsListCards from './EventsList/cards.astro'
|
|
83
|
+
import EventsListAgenda from './EventsList/agenda.astro'
|
|
84
|
+
import EventsListCalendar from './EventsList/calendar.astro'
|
|
85
|
+
import EventsListCompact from './EventsList/compact.astro'
|
|
86
|
+
import EventsListShifts from './EventsList/shifts.astro'
|
|
87
|
+
import EventsListWeek from './EventsList/week.astro'
|
|
88
|
+
import EventsListCohorts from './EventsList/cohorts.astro'
|
|
89
|
+
import EventsListMap from './EventsList/map.astro'
|
|
90
|
+
import HeroCover from './Hero/cover.astro'
|
|
91
|
+
import HeroSplit from './Hero/split.astro'
|
|
92
|
+
import HeroOverlap from './Hero/overlap.astro'
|
|
93
|
+
import HeroStatement from './Hero/statement.astro'
|
|
94
|
+
import HeroDonate from './Hero/donate.astro'
|
|
95
|
+
import HeroVideo from './Hero/video.astro'
|
|
96
|
+
import HeroRotating from './Hero/rotating.astro'
|
|
97
|
+
import HeroField from './Hero/field.astro'
|
|
98
|
+
import IssuesSteps from './Issues/steps.astro'
|
|
99
|
+
import IssuesNumbered from './Issues/numbered.astro'
|
|
100
|
+
import IssuesRows from './Issues/rows.astro'
|
|
101
|
+
import IssuesChecklist from './Issues/checklist.astro'
|
|
102
|
+
import IssuesTabs from './Issues/tabs.astro'
|
|
103
|
+
import IssuesDrawer from './Issues/drawer.astro'
|
|
104
|
+
import MapSectionMap from './Map/map.astro'
|
|
105
|
+
import MapSectionBar from './Map/bar.astro'
|
|
106
|
+
import PdfEmbedMedium from './PdfEmbed/medium.astro'
|
|
107
|
+
import PdfEmbedTall from './PdfEmbed/tall.astro'
|
|
108
|
+
import PdfEmbedCard from './PdfEmbed/card.astro'
|
|
109
|
+
import PlatformPlanksLongread from './PlatformPlanks/longread.astro'
|
|
110
|
+
import PlatformPlanksColumns from './PlatformPlanks/columns.astro'
|
|
111
|
+
import ProgressMatch from './Progress/match.astro'
|
|
112
|
+
import ProgressRing from './Progress/ring.astro'
|
|
113
|
+
import ProgressCompact from './Progress/compact.astro'
|
|
114
|
+
import QuoteStripSingle from './QuoteStrip/single.astro'
|
|
115
|
+
import QuoteStripTicker from './QuoteStrip/ticker.astro'
|
|
116
|
+
import QuoteStripLogos from './QuoteStrip/logos.astro'
|
|
117
|
+
import QuoteStripCarousel from './QuoteStrip/carousel.astro'
|
|
118
|
+
import QuoteStripWall from './QuoteStrip/wall.astro'
|
|
119
|
+
import StatCardsRibbon from './StatCards/ribbon.astro'
|
|
120
|
+
import StatCardsFeature from './StatCards/feature.astro'
|
|
121
|
+
import StatCardsWall from './StatCards/wall.astro'
|
|
122
|
+
import TeamGridBoard from './TeamGrid/board.astro'
|
|
123
|
+
import TeamGridList from './TeamGrid/list.astro'
|
|
124
|
+
import VideoEmbedLandscape from './VideoEmbed/landscape.astro'
|
|
125
|
+
import VideoEmbedPortrait from './VideoEmbed/portrait.astro'
|
|
126
|
+
import VideoEmbedSquare from './VideoEmbed/square.astro'
|
|
127
|
+
import TakeoverBanner from '../chrome/TakeoverBanner.astro'
|
|
128
|
+
import Donate from './Donate/index.astro'
|
|
129
|
+
import DonateStory from './Donate/story.astro'
|
|
130
|
+
import FormBlock from './FormBlock/index.astro'
|
|
131
|
+
import FormBlockWide from './FormBlock/wide.astro'
|
|
132
|
+
import PollBlock from './PollBlock/index.astro'
|
|
133
|
+
import SignupCapture from './SignupCapture/index.astro'
|
|
134
|
+
import SignupCaptureBand from './SignupCapture/band.astro'
|
|
135
|
+
import SignupCaptureInline from './SignupCapture/inline.astro'
|
|
136
|
+
import Petition from './Petition/index.astro'
|
|
137
|
+
import PetitionImage from './Petition/image.astro'
|
|
138
|
+
import PetitionMap from './Petition/map.astro'
|
|
139
|
+
import PetitionCoverage from './Petition/coverage.astro'
|
|
140
|
+
import Event from './Event/index.astro'
|
|
141
|
+
import EventCard from './Event/card.astro'
|
|
142
|
+
import Store from './Store/index.astro'
|
|
143
|
+
import StoreFeatured from './Store/featured.astro'
|
|
144
|
+
import Calendar from './Calendar/index.astro'
|
|
145
|
+
import CalendarAgenda from './Calendar/agenda.astro'
|
|
146
|
+
import Advocacy from './Advocacy/index.astro'
|
|
147
|
+
import AdvocacyCompact from './Advocacy/compact.astro'
|
|
148
|
+
import QuickDonate from './QuickDonate/index.astro'
|
|
149
|
+
import QuickDonateHero from './QuickDonate/hero.astro'
|
|
150
|
+
import QuickDonateBar from './QuickDonate/bar.astro'
|
|
151
|
+
import QuickDonateJar from './QuickDonate/jar.astro'
|
|
152
|
+
import QuickDonateBand from './QuickDonate/band.astro'
|
|
153
|
+
import QuickDonateLadder from './QuickDonate/ladder.astro'
|
|
154
|
+
import VoterTools from './VoterTools/index.astro'
|
|
155
|
+
import VoterToolsPolling from './VoterTools/polling.astro'
|
|
156
|
+
import VoterToolsDates from './VoterTools/dates.astro'
|
|
157
|
+
import SampleBallot from './SampleBallot/index.astro'
|
|
158
|
+
import SampleBallotCards from './SampleBallot/cards.astro'
|
|
159
|
+
import SampleBallotMeasures from './SampleBallot/measures.astro'
|
|
160
|
+
import Scorecard from './Scorecard/index.astro'
|
|
161
|
+
import ScorecardGrades from './Scorecard/grades.astro'
|
|
162
|
+
import ScorecardPromise from './Scorecard/promise.astro'
|
|
163
|
+
import Membership from './Membership/index.astro'
|
|
164
|
+
import MembershipTiers from './Membership/tiers.astro'
|
|
165
|
+
import MembershipCompare from './Membership/compare.astro'
|
|
166
|
+
import Faq from './Faq/index.astro'
|
|
167
|
+
import FaqTopics from './Faq/topics.astro'
|
|
168
|
+
import FaqCards from './Faq/cards.astro'
|
|
169
|
+
import Comparison from './Comparison/index.astro'
|
|
170
|
+
import ComparisonCards from './Comparison/cards.astro'
|
|
171
|
+
import ComparisonSpectrum from './Comparison/spectrum.astro'
|
|
172
|
+
import Stories from './Stories/index.astro'
|
|
173
|
+
import StoriesCards from './Stories/cards.astro'
|
|
174
|
+
import StoriesTimeline from './Stories/timeline.astro'
|
|
175
|
+
import ShareKit from './ShareKit/index.astro'
|
|
176
|
+
import ShareKitStrip from './ShareKit/strip.astro'
|
|
177
|
+
import ShareKitCompact from './ShareKit/compact.astro'
|
|
178
|
+
import Financials from './Financials/index.astro'
|
|
179
|
+
import FinancialsDonut from './Financials/donut.astro'
|
|
180
|
+
import FinancialsTable from './Financials/table.astro'
|
|
181
|
+
import Services from './Services/index.astro'
|
|
182
|
+
import ServicesList from './Services/list.astro'
|
|
183
|
+
import ServicesCompare from './Services/compare.astro'
|
|
184
|
+
import CaseStudies from './CaseStudies/index.astro'
|
|
185
|
+
import CaseStudiesGrid from './CaseStudies/grid.astro'
|
|
186
|
+
import CaseStudiesBeforeafter from './CaseStudies/beforeafter.astro'
|
|
187
|
+
import Resources from './Resources/index.astro'
|
|
188
|
+
import ResourcesFeatured from './Resources/featured.astro'
|
|
189
|
+
import ResourcesBand from './Resources/band.astro'
|
|
190
|
+
import Pathways from './Pathways/index.astro'
|
|
191
|
+
import PathwaysTabs from './Pathways/tabs.astro'
|
|
192
|
+
import PathwaysQuiz from './Pathways/quiz.astro'
|
|
193
|
+
import Portfolio from './Portfolio/index.astro'
|
|
194
|
+
import PortfolioFeatured from './Portfolio/featured.astro'
|
|
195
|
+
import PortfolioStrip from './Portfolio/strip.astro'
|
|
196
|
+
import MediaKit from './MediaKit/index.astro'
|
|
197
|
+
import MediaKitSpeaker from './MediaKit/speaker.astro'
|
|
198
|
+
import MediaKitPress from './MediaKit/press.astro'
|
|
199
|
+
import Booking from './Booking/index.astro'
|
|
200
|
+
import BookingList from './Booking/list.astro'
|
|
201
|
+
|
|
202
|
+
export const sections = {
|
|
203
|
+
Hero,
|
|
204
|
+
'Hero:cover': HeroCover,
|
|
205
|
+
'Hero:split': HeroSplit,
|
|
206
|
+
'Hero:overlap': HeroOverlap,
|
|
207
|
+
'Hero:statement': HeroStatement,
|
|
208
|
+
'Hero:donate': HeroDonate,
|
|
209
|
+
'Hero:video': HeroVideo,
|
|
210
|
+
'Hero:rotating': HeroRotating,
|
|
211
|
+
'Hero:field': HeroField,
|
|
212
|
+
About,
|
|
213
|
+
'About:left': AboutLeft,
|
|
214
|
+
'About:letter': AboutLetter,
|
|
215
|
+
'About:portrait': AboutPortrait,
|
|
216
|
+
'About:books': AboutBooks,
|
|
217
|
+
Issues,
|
|
218
|
+
'Issues:steps': IssuesSteps,
|
|
219
|
+
'Issues:numbered': IssuesNumbered,
|
|
220
|
+
'Issues:rows': IssuesRows,
|
|
221
|
+
'Issues:checklist': IssuesChecklist,
|
|
222
|
+
'Issues:tabs': IssuesTabs,
|
|
223
|
+
'Issues:drawer': IssuesDrawer,
|
|
224
|
+
StatCards,
|
|
225
|
+
'StatCards:ribbon': StatCardsRibbon,
|
|
226
|
+
'StatCards:feature': StatCardsFeature,
|
|
227
|
+
'StatCards:wall': StatCardsWall,
|
|
228
|
+
Cta,
|
|
229
|
+
'Cta:card': CtaCard,
|
|
230
|
+
'Cta:banner': CtaBanner,
|
|
231
|
+
'Cta:strip': CtaStrip,
|
|
232
|
+
'Cta:photo': CtaPhoto,
|
|
233
|
+
QuoteStrip,
|
|
234
|
+
'QuoteStrip:single': QuoteStripSingle,
|
|
235
|
+
'QuoteStrip:ticker': QuoteStripTicker,
|
|
236
|
+
'QuoteStrip:logos': QuoteStripLogos,
|
|
237
|
+
'QuoteStrip:carousel': QuoteStripCarousel,
|
|
238
|
+
'QuoteStrip:wall': QuoteStripWall,
|
|
239
|
+
Map: MapSection,
|
|
240
|
+
'Map:map': MapSectionMap,
|
|
241
|
+
'Map:bar': MapSectionBar,
|
|
242
|
+
MovementMap,
|
|
243
|
+
VideoEmbed,
|
|
244
|
+
'VideoEmbed:landscape': VideoEmbedLandscape,
|
|
245
|
+
'VideoEmbed:portrait': VideoEmbedPortrait,
|
|
246
|
+
'VideoEmbed:square': VideoEmbedSquare,
|
|
247
|
+
PdfEmbed,
|
|
248
|
+
'PdfEmbed:medium': PdfEmbedMedium,
|
|
249
|
+
'PdfEmbed:tall': PdfEmbedTall,
|
|
250
|
+
'PdfEmbed:card': PdfEmbedCard,
|
|
251
|
+
Progress,
|
|
252
|
+
'Progress:ring': ProgressRing,
|
|
253
|
+
'Progress:compact': ProgressCompact,
|
|
254
|
+
'Progress:match': ProgressMatch,
|
|
255
|
+
Countdown,
|
|
256
|
+
Leaderboard,
|
|
257
|
+
SocialFeed,
|
|
258
|
+
MovementTicker,
|
|
259
|
+
EventsList,
|
|
260
|
+
'EventsList:cards': EventsListCards,
|
|
261
|
+
'EventsList:agenda': EventsListAgenda,
|
|
262
|
+
'EventsList:calendar': EventsListCalendar,
|
|
263
|
+
'EventsList:compact': EventsListCompact,
|
|
264
|
+
'EventsList:shifts': EventsListShifts,
|
|
265
|
+
'EventsList:week': EventsListWeek,
|
|
266
|
+
'EventsList:cohorts': EventsListCohorts,
|
|
267
|
+
'EventsList:map': EventsListMap,
|
|
268
|
+
Blog,
|
|
269
|
+
'Blog:list': BlogList,
|
|
270
|
+
'Blog:feature': BlogFeature,
|
|
271
|
+
Collection,
|
|
272
|
+
'Collection:list': CollectionList,
|
|
273
|
+
'Collection:compact': CollectionCompact,
|
|
274
|
+
'Collection:feature': CollectionFeature,
|
|
275
|
+
'Collection:library': CollectionLibrary,
|
|
276
|
+
'Collection:shelves': CollectionShelves,
|
|
277
|
+
'Collection:outline': CollectionOutline,
|
|
278
|
+
ContentPost,
|
|
279
|
+
'ContentPost:card': ContentPost,
|
|
280
|
+
'ContentPost:banner': ContentPostBanner,
|
|
281
|
+
'ContentPost:player': ContentPostPlayer,
|
|
282
|
+
'ContentPost:theater': ContentPostTheater,
|
|
283
|
+
'ContentPost:prose': ContentPostProse,
|
|
284
|
+
PlatformPlanks,
|
|
285
|
+
'PlatformPlanks:columns': PlatformPlanksColumns,
|
|
286
|
+
'PlatformPlanks:longread': PlatformPlanksLongread,
|
|
287
|
+
CandidateRoster,
|
|
288
|
+
'CandidateRoster:ballot': CandidateRosterBallot,
|
|
289
|
+
'CandidateRoster:compact': CandidateRosterCompact,
|
|
290
|
+
TeamGrid,
|
|
291
|
+
'TeamGrid:board': TeamGridBoard,
|
|
292
|
+
'TeamGrid:list': TeamGridList,
|
|
293
|
+
TakeoverBanner,
|
|
294
|
+
Donate,
|
|
295
|
+
'Donate:story': DonateStory,
|
|
296
|
+
FormBlock,
|
|
297
|
+
'FormBlock:wide': FormBlockWide,
|
|
298
|
+
PollBlock,
|
|
299
|
+
SignupCapture,
|
|
300
|
+
'SignupCapture:band': SignupCaptureBand,
|
|
301
|
+
'SignupCapture:inline': SignupCaptureInline,
|
|
302
|
+
Petition,
|
|
303
|
+
'Petition:image': PetitionImage,
|
|
304
|
+
'Petition:map': PetitionMap,
|
|
305
|
+
'Petition:coverage': PetitionCoverage,
|
|
306
|
+
Event,
|
|
307
|
+
'Event:card': EventCard,
|
|
308
|
+
Store,
|
|
309
|
+
'Store:featured': StoreFeatured,
|
|
310
|
+
Calendar,
|
|
311
|
+
'Calendar:agenda': CalendarAgenda,
|
|
312
|
+
Advocacy,
|
|
313
|
+
'Advocacy:compact': AdvocacyCompact,
|
|
314
|
+
QuickDonate,
|
|
315
|
+
'QuickDonate:hero': QuickDonateHero,
|
|
316
|
+
'QuickDonate:bar': QuickDonateBar,
|
|
317
|
+
'QuickDonate:jar': QuickDonateJar,
|
|
318
|
+
'QuickDonate:band': QuickDonateBand,
|
|
319
|
+
'QuickDonate:ladder': QuickDonateLadder,
|
|
320
|
+
VoterTools,
|
|
321
|
+
'VoterTools:polling': VoterToolsPolling,
|
|
322
|
+
'VoterTools:dates': VoterToolsDates,
|
|
323
|
+
SampleBallot,
|
|
324
|
+
'SampleBallot:cards': SampleBallotCards,
|
|
325
|
+
'SampleBallot:measures': SampleBallotMeasures,
|
|
326
|
+
Scorecard,
|
|
327
|
+
'Scorecard:grades': ScorecardGrades,
|
|
328
|
+
'Scorecard:promise': ScorecardPromise,
|
|
329
|
+
Membership,
|
|
330
|
+
'Membership:tiers': MembershipTiers,
|
|
331
|
+
'Membership:compare': MembershipCompare,
|
|
332
|
+
Faq,
|
|
333
|
+
'Faq:topics': FaqTopics,
|
|
334
|
+
'Faq:cards': FaqCards,
|
|
335
|
+
Comparison,
|
|
336
|
+
'Comparison:cards': ComparisonCards,
|
|
337
|
+
'Comparison:spectrum': ComparisonSpectrum,
|
|
338
|
+
Stories,
|
|
339
|
+
'Stories:cards': StoriesCards,
|
|
340
|
+
'Stories:timeline': StoriesTimeline,
|
|
341
|
+
ShareKit,
|
|
342
|
+
'ShareKit:strip': ShareKitStrip,
|
|
343
|
+
'ShareKit:compact': ShareKitCompact,
|
|
344
|
+
Financials,
|
|
345
|
+
'Financials:donut': FinancialsDonut,
|
|
346
|
+
'Financials:table': FinancialsTable,
|
|
347
|
+
Services,
|
|
348
|
+
'Services:list': ServicesList,
|
|
349
|
+
'Services:compare': ServicesCompare,
|
|
350
|
+
CaseStudies,
|
|
351
|
+
'CaseStudies:grid': CaseStudiesGrid,
|
|
352
|
+
'CaseStudies:beforeafter': CaseStudiesBeforeafter,
|
|
353
|
+
Resources,
|
|
354
|
+
'Resources:featured': ResourcesFeatured,
|
|
355
|
+
'Resources:band': ResourcesBand,
|
|
356
|
+
Pathways,
|
|
357
|
+
'Pathways:tabs': PathwaysTabs,
|
|
358
|
+
'Pathways:quiz': PathwaysQuiz,
|
|
359
|
+
Portfolio,
|
|
360
|
+
'Portfolio:featured': PortfolioFeatured,
|
|
361
|
+
'Portfolio:strip': PortfolioStrip,
|
|
362
|
+
MediaKit,
|
|
363
|
+
'MediaKit:speaker': MediaKitSpeaker,
|
|
364
|
+
'MediaKit:press': MediaKitPress,
|
|
365
|
+
Booking,
|
|
366
|
+
'Booking:list': BookingList,
|
|
367
|
+
Classroom,
|
|
368
|
+
'Classroom:list': ClassroomList,
|
|
369
|
+
Course,
|
|
370
|
+
'Course:outline': CourseOutline,
|
|
371
|
+
Lesson,
|
|
372
|
+
'Lesson:reading': LessonReading,
|
|
373
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
// A BackGold module under its section head: the kicker and heading the
|
|
3
|
+
// section carries, then the module's frame (ModuleFrame). Petition, One event,
|
|
4
|
+
// Store, Calendar and Contact your legislators draw through this, each with
|
|
5
|
+
// its own card and starting height. A module with nothing to frame keeps its
|
|
6
|
+
// head and says it is not available (ModuleFrame).
|
|
7
|
+
import type { Section } from '@backgold/content'
|
|
8
|
+
import Band from '../Band.astro'
|
|
9
|
+
import SectionHead from '../SectionHead.astro'
|
|
10
|
+
import ModuleFrame from './ModuleFrame.astro'
|
|
11
|
+
import { text } from '../../../lib/format'
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
section: Section
|
|
15
|
+
layout: string
|
|
16
|
+
card?: boolean
|
|
17
|
+
height?: string
|
|
18
|
+
/** Draw the heading (false where the module draws its own header, a petition's image, map or coverage). */
|
|
19
|
+
head?: boolean
|
|
20
|
+
/** The width the module keeps on a wide screen; none is the full content width. */
|
|
21
|
+
narrow?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const { section, layout, card = false, height, head = true, narrow = false } = Astro.props
|
|
25
|
+
const kicker = text(section.copy.kicker)
|
|
26
|
+
const heading = text(section.copy.heading)
|
|
27
|
+
---
|
|
28
|
+
<Band section={section} class:list={['headed-module', narrow && 'headed-module-narrow']}>
|
|
29
|
+
{(head || !section.embed) && <SectionHead kicker={kicker} heading={heading} more={[]} />}
|
|
30
|
+
<ModuleFrame embed={section.embed} band={section.band} type={section.type} layout={layout} card={card} title={heading ?? section.type} height={height} />
|
|
31
|
+
</Band>
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
:global(.headed-module-narrow .section-head),
|
|
35
|
+
:global(.headed-module-narrow .module) {
|
|
36
|
+
max-width: 40rem;
|
|
37
|
+
margin-inline: auto;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
// BackGold's own module (donate, a form, a sign-up, a petition, an event's
|
|
3
|
+
// RSVP and tickets, the store, the calendar, a poll, contacting legislators)
|
|
4
|
+
// as the boards draw it "first-party, in the site's tokens" (A7–A12): the
|
|
5
|
+
// module's frame, asked to wear this site (BackGold's embed look: the section's
|
|
6
|
+
// layout, the colours where it sits, light and dark, the radius and the type)
|
|
7
|
+
// so it draws no ground, card, heading or platform footer of its own. The
|
|
8
|
+
// face is the template's `frameFont` when it is one the embed look accepts
|
|
9
|
+
// (FRAME_FONTS), read from `Astro.locals.template` (the routes set it);
|
|
10
|
+
// where that is unset, Public Sans, as it is for a template that names none.
|
|
11
|
+
// An unknown value is never sent:
|
|
12
|
+
// the api drops a look with a malformed `font` as a whole. The corners are
|
|
13
|
+
// the template's `frameRadius` (a whole number of pixels, 0 to 40, the embed look's bounds), else 12,
|
|
14
|
+
// read the same way. The colours are the band's through the template's
|
|
15
|
+
// `frameColors` when it has one, and a template with `frameSkin` asks the
|
|
16
|
+
// frame to load its stylesheet (`skin`, the site's own https origin, where the
|
|
17
|
+
// template serves /_backgold/frame.css), read the same way. The
|
|
18
|
+
// site credits BackGold once, as "Powered by BackGold" in the footer's bottom
|
|
19
|
+
// row, never per module.
|
|
20
|
+
//
|
|
21
|
+
// The fields, limits, receipts, consent and every write stay BackGold's, in
|
|
22
|
+
// its frame: nothing here builds, covers or imitates a field. `card` sets the
|
|
23
|
+
// module on a raised card (its frame then sits on the card colour, the panel
|
|
24
|
+
// band's); without it the module sits straight on the section's band. The
|
|
25
|
+
// default slot is drawn inside the card above the module (a form's title).
|
|
26
|
+
// Advocacy has no frame, only a container its script fills: it is placed as
|
|
27
|
+
// BackGold sends it.
|
|
28
|
+
//
|
|
29
|
+
// `params` adds the frame's own options to its address beside the look, the
|
|
30
|
+
// allowlisted keys only (FRAME_PARAMS: `text`, `full` or `collapsed`, a
|
|
31
|
+
// petition sheet's text drawn whole or as a closed disclosure); any other key
|
|
32
|
+
// or value is never sent.
|
|
33
|
+
//
|
|
34
|
+
// A Donate frame also carries the page address's donate names (an ask
|
|
35
|
+
// amount, a donate place, `utm_*`, lib/donate-frame.ts) that its address from
|
|
36
|
+
// BackGold does not already name; a form frame carries the page's `pick`,
|
|
37
|
+
// the choice it opens on (lib/donate-frame.ts withPickQuery).
|
|
38
|
+
//
|
|
39
|
+
// A section BackGold sends with no embed has nothing to frame (no donation
|
|
40
|
+
// form for the organization, no petition picked, an event no longer public):
|
|
41
|
+
// it draws one line saying the module is not available, where the module
|
|
42
|
+
// would be, never nothing, in the words a hosted BackGold page uses for a
|
|
43
|
+
// donate module with no form.
|
|
44
|
+
import type { SectionEmbed } from '@backgold/content'
|
|
45
|
+
import { Embed } from '@backgold/astro/components'
|
|
46
|
+
import { SECTION_BANDS, appearanceOf, moduleLook, type SectionBand } from '../../../lib/brand'
|
|
47
|
+
import { isDonateFrame, isFormFrame, withDonateQuery, withPickQuery } from '../../../lib/donate-frame'
|
|
48
|
+
|
|
49
|
+
interface Props {
|
|
50
|
+
/** The section's (or the event page's) embed, as BackGold sends it. */
|
|
51
|
+
embed: SectionEmbed | null | undefined
|
|
52
|
+
/** The ground the module sits on when it has no card: the section's band. */
|
|
53
|
+
band: string
|
|
54
|
+
/** The module's type, kept as `data-module`. */
|
|
55
|
+
type: string
|
|
56
|
+
/** The layout the frame arranges itself for (the section's, else the type's default). */
|
|
57
|
+
layout: string
|
|
58
|
+
card?: boolean
|
|
59
|
+
/** The frame's accessible name. */
|
|
60
|
+
title: string
|
|
61
|
+
/** How tall the frame starts before it reports its own height. */
|
|
62
|
+
height?: string
|
|
63
|
+
class?: string
|
|
64
|
+
/** The frame's own options, appended to its address (FRAME_PARAMS keys and values only). */
|
|
65
|
+
params?: Record<string, string>
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const { embed: sent, band: sectionBand, type, layout, card = false, title, height = '32rem', class: className, params = {} } = Astro.props
|
|
69
|
+
/** The frame options a template may send, each with the values the frame takes. */
|
|
70
|
+
const FRAME_PARAMS: Record<string, readonly string[]> = { text: ['full', 'collapsed'] }
|
|
71
|
+
const bg = Astro.locals.backgold
|
|
72
|
+
const brand = bg.setup === null ? bg.site.brand : null
|
|
73
|
+
const theme = bg.setup === null ? bg.site.theme : null
|
|
74
|
+
const appearance = bg.setup === null ? appearanceOf(bg.site.style) : 'auto'
|
|
75
|
+
/** The faces BackGold's embed look accepts (the api's EMBED_LOOK_FONTS). */
|
|
76
|
+
const FRAME_FONTS = ['public-sans', 'inter', 'system-sans', 'system-serif', 'ubuntu-sans-mono', 'jetbrains-mono']
|
|
77
|
+
const frameFont = Astro.locals.template?.frameFont
|
|
78
|
+
const font = frameFont && FRAME_FONTS.includes(frameFont) ? frameFont : 'public-sans'
|
|
79
|
+
const frameRadius = Astro.locals.template?.frameRadius
|
|
80
|
+
const radius = typeof frameRadius === 'number' && Number.isInteger(frameRadius) && frameRadius >= 0 && frameRadius <= 40 ? frameRadius : 12
|
|
81
|
+
/** The site's own https origin for a template that serves the frames its stylesheet; null otherwise (an http dev server cannot be one). */
|
|
82
|
+
function skinOrigin(): string | null {
|
|
83
|
+
if (!Astro.locals.template?.frameSkin) return null
|
|
84
|
+
const site = bg.setup === null && bg.siteUrl ? bg.siteUrl : Astro.url.origin
|
|
85
|
+
try {
|
|
86
|
+
const url = new URL(site)
|
|
87
|
+
return url.protocol === 'https:' ? url.origin : null
|
|
88
|
+
} catch {
|
|
89
|
+
return null
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const skin = skinOrigin()
|
|
93
|
+
const band: SectionBand = card ? 'panel' : SECTION_BANDS.includes(sectionBand as SectionBand) ? (sectionBand as SectionBand) : 'plain'
|
|
94
|
+
|
|
95
|
+
/** The module's address with the look query (and a Donate frame's donate names), or as sent when it is not one we can read. */
|
|
96
|
+
function framed(iframe: string | null): string | null {
|
|
97
|
+
if (!iframe) return iframe
|
|
98
|
+
let url: URL
|
|
99
|
+
try {
|
|
100
|
+
url = new URL(iframe)
|
|
101
|
+
} catch {
|
|
102
|
+
return iframe
|
|
103
|
+
}
|
|
104
|
+
if (isDonateFrame(type)) withDonateQuery(url, Astro.url.searchParams)
|
|
105
|
+
if (isFormFrame(type)) withPickQuery(url, Astro.url.searchParams)
|
|
106
|
+
url.searchParams.set('layout', layout)
|
|
107
|
+
for (const [key, value] of Object.entries(moduleLook(brand, band, appearance, theme, Astro.locals.template?.frameColors ?? null))) url.searchParams.set(key, value)
|
|
108
|
+
url.searchParams.set('radius', String(radius))
|
|
109
|
+
url.searchParams.set('font', font)
|
|
110
|
+
if (skin) url.searchParams.set('skin', skin)
|
|
111
|
+
for (const [key, value] of Object.entries(params)) if (Object.hasOwn(FRAME_PARAMS, key) && FRAME_PARAMS[key]!.includes(value)) url.searchParams.set(key, value)
|
|
112
|
+
return url.toString()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const embed = sent ? { ...sent, iframe: framed(sent.iframe) } : null
|
|
116
|
+
/** The frame's name as words: a heading's starred word (`*helps*`, a template's marked word) without its stars. */
|
|
117
|
+
const name = title.replace(/\*([^*\n]+)\*/g, '$1')
|
|
118
|
+
const hasHead = Astro.slots.has('default')
|
|
119
|
+
|
|
120
|
+
/** What a visitor reads where a module with nothing to frame would be. */
|
|
121
|
+
const UNAVAILABLE: Record<string, string> = {
|
|
122
|
+
Donate: 'Online donations are not available right now.',
|
|
123
|
+
FormBlock: 'This form is not available right now.',
|
|
124
|
+
PollBlock: 'This poll is not available right now.',
|
|
125
|
+
SignupCapture: 'Signing up is not available right now.',
|
|
126
|
+
Petition: 'This petition is not available right now.',
|
|
127
|
+
Store: 'The store is not available right now.',
|
|
128
|
+
Event: 'This event is not available right now.',
|
|
129
|
+
Calendar: 'The calendar is not available right now.',
|
|
130
|
+
Advocacy: 'Contacting your legislators is not available right now.',
|
|
131
|
+
}
|
|
132
|
+
const unavailable = UNAVAILABLE[type] ?? 'This is not available right now.'
|
|
133
|
+
---
|
|
134
|
+
{embed ? (
|
|
135
|
+
<div class:list={['module', card && 'module-card', className]} data-module={type} style={`--bg-embed-height:${height}`}>
|
|
136
|
+
{hasHead && <div class="module-head"><slot /></div>}
|
|
137
|
+
<Embed embed={embed} title={name} />
|
|
138
|
+
</div>
|
|
139
|
+
) : (
|
|
140
|
+
<div class:list={['module', 'module-unavailable', card && 'module-card', className]} data-module={type} data-module-unavailable>
|
|
141
|
+
{hasHead && <div class="module-head"><slot /></div>}
|
|
142
|
+
<p class="module-unavailable-line">{unavailable}</p>
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
<style>
|
|
147
|
+
.module {
|
|
148
|
+
min-width: 0;
|
|
149
|
+
}
|
|
150
|
+
.module-card {
|
|
151
|
+
padding: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
|
|
152
|
+
border: 1px solid var(--band-panel-line);
|
|
153
|
+
border-radius: var(--radius-card);
|
|
154
|
+
background: var(--band-panel);
|
|
155
|
+
color: var(--band-panel-ink);
|
|
156
|
+
box-shadow: var(--shadow);
|
|
157
|
+
}
|
|
158
|
+
.module-head :global(h3) {
|
|
159
|
+
margin: 0 0 0.875rem;
|
|
160
|
+
font-size: var(--h3);
|
|
161
|
+
font-weight: 600;
|
|
162
|
+
}
|
|
163
|
+
.module-unavailable-line {
|
|
164
|
+
margin: 0;
|
|
165
|
+
padding: 1rem 1.125rem;
|
|
166
|
+
border: 1px dashed var(--line-strong);
|
|
167
|
+
border-radius: var(--radius-card);
|
|
168
|
+
color: var(--muted);
|
|
169
|
+
font-size: var(--text-sm);
|
|
170
|
+
}
|
|
171
|
+
.module-card .module-unavailable-line {
|
|
172
|
+
padding: 0;
|
|
173
|
+
border: 0;
|
|
174
|
+
}
|
|
175
|
+
.module :global(.bg-embed) {
|
|
176
|
+
display: block;
|
|
177
|
+
width: 100%;
|
|
178
|
+
background: transparent;
|
|
179
|
+
color-scheme: light dark;
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One collection at /collections/<slug> (board 06, "/collections/:slug"):
|
|
3
|
+
// its cover, "Collection · N items" over its title as the page's one <h1>,
|
|
4
|
+
// its intro, the grid in the collection's own order (a member that is not
|
|
5
|
+
// published is not in the answer, so it is simply absent), then a closing
|
|
6
|
+
// band with the collection's body and the page's one call, back to the
|
|
7
|
+
// whole store.
|
|
8
|
+
import type { CollectionDetail } from '@backgold/content'
|
|
9
|
+
import { renderMarkdown, safeSrc } from '@backgold/astro/server'
|
|
10
|
+
import ProductGrid from './ProductGrid.astro'
|
|
11
|
+
import { STORE_PATH } from '../../lib/store'
|
|
12
|
+
import '../../styles/store.css'
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
collection: CollectionDetail
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { collection } = Astro.props
|
|
19
|
+
const cover = collection.cover ? safeSrc(collection.cover.url) : null
|
|
20
|
+
const count = collection.products.length
|
|
21
|
+
const body = collection.body.markdown.trim() ? renderMarkdown(collection.body.markdown) : ''
|
|
22
|
+
---
|
|
23
|
+
<div class="store-page collection-page">
|
|
24
|
+
<nav class="crumbs" aria-label="Breadcrumb">
|
|
25
|
+
<a href={STORE_PATH}>Store</a><span aria-hidden="true"> › </span><span>{collection.title}</span>
|
|
26
|
+
</nav>
|
|
27
|
+
{cover && <img class="collection-cover" src={cover} alt="" decoding="async" />}
|
|
28
|
+
<header class="store-head">
|
|
29
|
+
<p class="kicker">Collection · {count} {count === 1 ? 'item' : 'items'}</p>
|
|
30
|
+
<h1>{collection.title}</h1>
|
|
31
|
+
{collection.intro && <p class="lede">{collection.intro}</p>}
|
|
32
|
+
</header>
|
|
33
|
+
{count > 0 ? <ProductGrid products={collection.products} label={collection.title} /> : <p class="empty">Nothing in this collection yet.</p>}
|
|
34
|
+
<section class="store-band store-band-closing">
|
|
35
|
+
<div class="store-band-words">
|
|
36
|
+
{body && <div class="prose" set:html={body} />}
|
|
37
|
+
<p class="store-band-call"><a class="button" href={STORE_PATH}>See everything in the store</a></p>
|
|
38
|
+
</div>
|
|
39
|
+
</section>
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One listing in a storefront grid (board 06): the whole card is the link to
|
|
3
|
+
// its page, with its first photo, its name, its price as built ("From $X"
|
|
4
|
+
// when its items differ) and its availability word; a listing that is few
|
|
5
|
+
// left or sold out says so on its photo. No button: the page's one call is
|
|
6
|
+
// elsewhere.
|
|
7
|
+
import type { ProductSummary } from '@backgold/content'
|
|
8
|
+
import { safeSrc } from '@backgold/astro/server'
|
|
9
|
+
import { AVAILABILITY_WORDS, priceLabel, productPath } from '../../lib/store'
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
product: ProductSummary
|
|
13
|
+
/** The card title's level: 2 under the page's h1, 3 under a section's h2. */
|
|
14
|
+
level?: 2 | 3
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { product, level = 2 } = Astro.props
|
|
18
|
+
const Heading = level === 2 ? 'h2' : 'h3'
|
|
19
|
+
const photo = safeSrc(product.photos[0]?.url)
|
|
20
|
+
const flagged = product.availability === 'low' || product.availability === 'out'
|
|
21
|
+
---
|
|
22
|
+
<a class="product-card" href={productPath(product.slug)} data-availability={product.availability}>
|
|
23
|
+
<span class="product-card-photo">
|
|
24
|
+
{photo ? <img src={photo} alt="" loading="lazy" decoding="async" /> : <span class="product-card-blank" aria-hidden="true"></span>}
|
|
25
|
+
{flagged && <span class="product-card-flag">{AVAILABILITY_WORDS[product.availability]}</span>}
|
|
26
|
+
</span>
|
|
27
|
+
<span class="product-card-body">
|
|
28
|
+
<Heading class="product-card-name">{product.name}</Heading>
|
|
29
|
+
<span class="product-card-price">{priceLabel(product)}</span>
|
|
30
|
+
{!flagged && <span class="product-card-word">{AVAILABILITY_WORDS[product.availability]}</span>}
|
|
31
|
+
</span>
|
|
32
|
+
</a>
|