@mccaskie-labs/workbench-site 0.15.2 → 0.16.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mccaskie-labs/workbench-site
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3ac94ef: Landing page hero designs (docs/hero-and-images.md): thirteen designs harvested from the sample sites (Full screen, Split, Banner, Framed, Card over picture, Search first, Big words, Collage, Shaped picture, Overlap, Panorama, Feature card, Words only), all drawn by `designedHero` from one settings shape: height, width, where the words sit, a shade or panel to make words easier to read, focal point and zoom, picture side and split, shape, gentle movement (off for anyone whose device asks for less motion), a phone picture, phone height and words under the picture on phones, a notice line and a live tool slot. `HERO_STARTS` holds the 35 sample sites' tops as starting points, the owner's kind of site first with `heroStartsFor`. `heroSettingsProblems` names bad settings in plain words. `hero()` draws a design when given `design`; the plain hero is unchanged. Every part has a `wb-site-hero-*` class, drawn phone first.
8
+
9
+ ## 0.15.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Links to other websites open in a new tab.
14
+
3
15
  ## 0.15.2
4
16
 
5
17
  ### Patch Changes
package/dist/frames.js CHANGED
@@ -6,7 +6,7 @@
6
6
  // header carries the admin menu instead of the site's, and its <html> carries
7
7
  // wb-ui-admin, so it takes the project's accent and fonts on Clean's light
8
8
  // neutrals (docs/theming.md, Decisions) however dark or bold the public look.
9
- import { escape, safeHref } from "./html.js";
9
+ import { escape, newTab, safeHref } from "./html.js";
10
10
  /**
11
11
  * - landing: full-width sections, for a home page
12
12
  * - column: one centred column of reading width, for about, legal and most pages
@@ -29,7 +29,7 @@ const links = (items, cls, current) => items
29
29
  .map((l) => {
30
30
  const href = safeHref(l.href);
31
31
  const here = current !== undefined && href === current ? ` aria-current="page"` : "";
32
- return `<a class="${cls}" href="${escape(href)}"${here}>${escape(l.label)}</a>`;
32
+ return `<a class="${cls}" href="${escape(href)}"${here}${newTab(href)}>${escape(l.label)}</a>`;
33
33
  })
34
34
  .join("");
35
35
  /** workbench-ui's preview styles (its PREVIEW_FILE.url): every look a project may choose, as switchable blocks. */
@@ -44,7 +44,7 @@ export function frame(o) {
44
44
  const menu = o.menu?.length ? `<nav class="wb-site-menu" aria-label="Main">${links(o.menu, "wb-site-menu-link", o.current)}</nav>` : "";
45
45
  const headerStyle = pick(HEADERS, o.layout?.header);
46
46
  const footerStyle = pick(FOOTERS, o.layout?.footer);
47
- const action = o.headerAction ? `<a class="wb-site-button wb-site-header-action" href="${escape(safeHref(o.headerAction.href))}">${escape(o.headerAction.label)}</a>` : "";
47
+ const action = o.headerAction ? `<a class="wb-site-button wb-site-header-action" href="${escape(safeHref(o.headerAction.href))}"${newTab(safeHref(o.headerAction.href))}>${escape(o.headerAction.label)}</a>` : "";
48
48
  const header = `<header class="wb-site-header" data-header="${headerStyle}"><div class="wb-site-header-row"><a class="wb-site-name" href="/">${escape(o.site)}</a>${env}${menu}${action}</div></header>`;
49
49
  const [first = "", ...rest] = o.sections;
50
50
  const main = o.frame === "two-columns"
@@ -0,0 +1,40 @@
1
+ import type { HeroDesignId, HeroSettings } from "./hero.ts";
2
+ import type { Action } from "./sections.ts";
3
+ /** A live tool a starting point's slot suits. */
4
+ export type HeroSlotTool = "bookings" | "directory" | "places" | "mailing" | "forms";
5
+ /** One starting point: a design, its settings, and sample words and photos from one sample site. */
6
+ export interface HeroStart {
7
+ id: string;
8
+ /** What owners see on the ‹ › stepper, after the design's name. */
9
+ name: string;
10
+ design: HeroDesignId;
11
+ /** The sample site it comes from (a workbench-ui mockup id). */
12
+ site: string;
13
+ /** That site's kind of business, such as "Yoga studio". */
14
+ title: string;
15
+ /** The New project gallery's starter group, used to show the right ones first. */
16
+ group: string;
17
+ /** The live tool its slot was drawn for, when it has one. */
18
+ tool?: HeroSlotTool;
19
+ settings: HeroSettings;
20
+ words: {
21
+ eyebrow?: string;
22
+ heading: string;
23
+ lead?: string;
24
+ actions?: readonly Action[];
25
+ notice?: {
26
+ text: string;
27
+ link?: Action;
28
+ };
29
+ };
30
+ /** Photo names, as in workbench-ui's mockups/photos. */
31
+ photos: readonly string[];
32
+ }
33
+ /** The starter groups, in the New project gallery's order. */
34
+ export declare const HERO_GROUPS: readonly ["Health, beauty and fitness", "Trades and home", "Food and stays", "Venues, hire and tours", "Community", "Learning and kids", "Professional and creative", "General"];
35
+ export declare const HERO_STARTS: readonly HeroStart[];
36
+ /** The starting points with the given starter group's first, then the rest, each in sample order. */
37
+ export declare function heroStartsFor(group?: string): readonly HeroStart[];
38
+ export declare const heroStart: (id: string) => HeroStart | undefined;
39
+ /** Sample forms for the slot, for previews before a tool draws its own. Plain elements only. */
40
+ export declare const HERO_SAMPLE_SLOTS: Readonly<Record<HeroSlotTool, string>>;