diff --git a/openapi.yaml b/openapi.yaml index cef82a0..68eb848 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -14842,7 +14842,11 @@ paths: page in the Makerble User Guide (`https://makerble.atlassian.net/wiki/spaces/MCPD/...`); and a `vimeo_url` that is empty or one of `https://vimeo.com/`, `https://vimeo.com//` (unlisted videos) or `https://player.vimeo.com/video/?h=`. An empty `vimeo_url` puts the - page back to its fallback visual. A broken rule answers `422` with every message in `errors`. + page back to its fallback visual. + + `storyboard` is the Intro's animation, drawn from Makerble building blocks when there is no Vimeo + link (see `GuidancePanelStoryboard` for its rules). Send it as an object, or `null` to remove it. + A broken rule answers `422` with every message in `errors`. operationId: updateGuidancePanel security: [{tokenAuth: []}] requestBody: @@ -23951,6 +23955,86 @@ components: name: type: string + GuidancePanelStoryboardStep: + type: object + description: | + One step of an Intro animation. Steps play in order, evenly spread across the loop. + + - `appear` puts a building block on the stage: `block` (required), and optionally an `id` that later + steps target, a `text` label and, for a `chart_bar` only, a `value` from 0 to 100 (required for it). + - `move_cursor`, `click`, `highlight` and `check` act on the block whose `id` is `target`. + - `type` types `text` into the `field` whose `id` is `target`. + - `swap` replaces the label of the block whose `id` is `target` with `text`. + - `cut` clears the stage and starts a new scene; blocks from before it can't be targeted after it. + required: [type] + additionalProperties: false + properties: + type: + type: string + enum: [appear, move_cursor, click, type, highlight, check, swap, cut] + block: + type: string + enum: [top_bar, sidebar_item, table_row, card, button, field, chip, avatar, chart_bar] + id: + type: string + pattern: '^[a-z][a-z0-9_]{0,29}$' + target: + type: string + description: The `id` of a block that has appeared since the last `cut` + text: + type: string + maxLength: 40 + value: + type: integer + minimum: 0 + maximum: 100 + + + GuidancePanelStoryboard: + type: object + nullable: true + description: | + An Intro's animation: a short loop of Makerble building blocks drawn in the panel's module colour, + shown when there is no Vimeo link. Up to 8,000 characters of JSON. + required: [archetype, loop_seconds, alt, steps] + additionalProperties: false + properties: + archetype: + type: string + enum: [assemble, flow, concept] + description: >- + `assemble`: the parts of a page of the feature come together. `flow`: a short walkthrough of using + the feature. `concept`: an animated metaphor for the idea behind it. + loop_seconds: + type: integer + minimum: 4 + maximum: 20 + alt: + type: string + minLength: 10 + maxLength: 250 + description: What the animation shows, read out by screen readers + steps: + type: array + minItems: 1 + maxItems: 24 + items: + $ref: '#/components/schemas/GuidancePanelStoryboardStep' + example: + archetype: flow + loop_seconds: 12 + alt: "A coworker clicks Create a contact, types the contact's name, clicks Save and the contact appears in the list." + steps: + - { type: appear, block: button, id: create, text: "Create a contact" } + - { type: click, target: create } + - { type: cut } + - { type: appear, block: field, id: name, text: "Name" } + - { type: type, target: name, text: "Amira Patel" } + - { type: cut } + - { type: appear, block: table_row, id: amira, text: "Amira Patel" } + - { type: check, target: amira } + + GuidancePanel: type: object description: | @@ -23990,14 +24074,16 @@ components: vimeo_url: type: string nullable: true + storyboard: + $ref: '#/components/schemas/GuidancePanelStoryboard' fallback_visual: type: string nullable: true description: The CSS animation, or the page's current image, shown when there is no Vimeo link visual: type: string - enum: [vimeo, animation, image, none] - description: What the panel shows beside its text now + enum: [vimeo, storyboard, animation, image, none] + description: What the panel shows beside its text now. A Vimeo link wins over a storyboard, and a storyboard over the fallback visual updated_at: type: string format: date-time @@ -24063,6 +24149,8 @@ components: type: string vimeo_url: type: string + storyboard: + $ref: '#/components/schemas/GuidancePanelStoryboard' PaginatedGuidancePanels: allOf: diff --git a/server.js b/server.js index b7b121c..eea157b 100644 --- a/server.js +++ b/server.js @@ -3878,6 +3878,7 @@ function buildDocsPage() {

A Guidance Panel is the Show/Hide Guidance introduction at the top of a Manage page, such as Manage Events or Manage Contact Groups: an eyebrow, a one-line headline, 2 to 5 points that each start with a short bold lead, the sentence shown to people who can't use the page's main button, a Learn more link to the page's article in the Makerble User Guide, and an optional Vimeo video. Panels are the same for every Organisation.

Who can use these endpoints: only Makerble staff with System Access, with their own X-User-Email and X-User-Token. Anyone else, an API key and a connected app all get 403. The same changes can be made in Site Overview › Guidance Panels, and every change, wherever it is made, is kept as a version that can be seen and restored.

Rules: a headline of at most 80 characters; 2 to 5 points, each with a lead (up to 40 characters) and text (up to 200); a user_guide_url in the Makerble User Guide (https://makerble.atlassian.net/wiki/spaces/MCPD/…); and a vimeo_url that is empty or one of https://vimeo.com/<id>, https://vimeo.com/<id>/<hash> (unlisted) or https://player.vimeo.com/video/<id>?h=<hash>.

+

Animation storyboard: when there is no Vimeo link, a panel can show a looping animation of Makerble building blocks, drawn in the page's module colour from its storyboard. A storyboard has an archetype (assemble, flow or concept), loop_seconds (4 to 20), alt (10 to 250 characters describing the animation for screen readers) and 1 to 24 steps. An appear step puts a block on the stage (top_bar, sidebar_item, table_row, card, button, field, chip, avatar or chart_bar, which needs a value from 0 to 100), with an optional id and text (up to 40 characters). move_cursor, click, highlight, check, type (into a field) and swap (new text) act on the block whose id is their target; cut clears the stage for the next scene. People who turn off motion see the last frame. The response's visual is storyboard while one is showing.

${endpointCard("GET", "/guidance_panels", "List the Guidance Panels", true, [ @@ -3895,14 +3896,15 @@ function buildDocsPage() { { code: "403", cls: "response-4xx", desc: "No System Access" }, { code: "404", cls: "response-4xx", desc: "No panel with that key" } ])} - ${endpointCard("PATCH", "/guidance_panels/{key}", "Change a Guidance Panel's wording or video", true, [ + ${endpointCard("PATCH", "/guidance_panels/{key}", "Change a Guidance Panel's wording, video or animation", true, [ { name: "key", in: "path", type: "string", required: true, desc: "The panel's key, e.g. events" }, { name: "guidance_panel[eyebrow]", in: "body", type: "string", required: false, desc: "e.g. Makerble® Events" }, { name: "guidance_panel[headline]", in: "body", type: "string", required: false, desc: "One line, at most 80 characters" }, { name: "guidance_panel[points]", in: "body", type: "array", required: false, desc: "2 to 5 {lead, text}, in order; replaces the whole list" }, { name: "guidance_panel[staff_text]", in: "body", type: "string", required: false, desc: "Shown instead of the main action to people who can't use it" }, { name: "guidance_panel[user_guide_url]", in: "body", type: "string", required: false, desc: "A page in the Makerble User Guide" }, - { name: "guidance_panel[vimeo_url]", in: "body", type: "string", required: false, desc: "A Vimeo link, or empty to show the page's own image or animation" } + { name: "guidance_panel[vimeo_url]", in: "body", type: "string", required: false, desc: "A Vimeo link, or empty to show the page's own image or animation" }, + { name: "guidance_panel[storyboard]", in: "body", type: "object", required: false, desc: "The animation shown when there is no Vimeo link (see above), or null to remove it" } ], [ { code: "200", cls: "response-2xx", desc: "The changed panel and its last 10 versions; the page shows the change from its next load" }, { code: "403", cls: "response-4xx", desc: "No System Access" },