diff --git a/openapi.yaml b/openapi.yaml index f9e9abf..f0ee378 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -20786,6 +20786,47 @@ paths: "403": $ref: '#/components/responses/ForbiddenError' + /guidance_panels/illustrations: + get: + tags: [Guidance Panels] + summary: List the illustrations an animation can play + description: | + The flat illustrations of a feature's screens that an Intro's or announcement's animation can play + (an illustration storyboard; see `GuidancePanelStoryboard`). Developers add them to Makerble; they + can't be uploaded through the API. Each has its `name` (the storyboard's `illustration`, or a + `scene` step's), its `view_box` (`[x, y, width, height]`, the units a `crop` is given in) and its + `parts`, which steps target: a `field` is filled in by `type` and `swap`, a `scroll` part is + scrolled by `scroll`, and any part can appear, be pointed at, highlighted, clicked or zoomed on. + Only Makerble staff with System Access, with their own token. + operationId: listGuidancePanelIllustrations + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: Paginated list of illustrations, by name + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGuidancePanelIllustrations' + example: + page: 1 + page_size: 1 + page_count: 3 + total_count: 3 + data: + - name: event_booking + view_box: [0, 0, 1600, 1000] + parts: + - { name: content, kind: part } + - { name: first_name, kind: field } + - { name: confirmation, kind: part } + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + /guidance_panels/{key}: parameters: - name: key @@ -20832,8 +20873,9 @@ paths: (unlisted videos) or `https://player.vimeo.com/video/?h=`. An empty `vimeo_url` puts the 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. + `storyboard` is the Intro's animation, drawn from Makerble building blocks, or from one of the + feature's illustrations (`GET /guidance_panels/illustrations`), when there is no Vimeo link (see + `GuidancePanelStoryboard` for its rules). Send it as an object, or `null` to remove it. `feature_tour_id` chooses the feature tour the Intro offers with "Take the tour" (`null` for none). It sets that tour's `page_key` to this Intro and unlinks any other tour that pointed here, naming it in @@ -33082,7 +33124,22 @@ components: GuidancePanelStoryboardStep: type: object description: | - One step of an Intro animation. Steps play in order, evenly spread across the loop. + One step of an Intro animation. Steps play in order, evenly spread across the loop, or each at its + `at` (seconds from the start of the loop, to one decimal place, in order; on every step or on none). + + In an illustration storyboard, steps work on the illustration's parts: + + - `appear` shows a `part` with a `motion`: `fade`, `rise`, `lift` (the default) or `pop`. Parts that + no `appear` names are there from the start. + - `move_cursor` (with optional `seconds`, 0.2 to 3), `click`, `highlight` and `zoom` act on the part + named in `target`. The cursor glides in from the bottom right corner on a gentle arc. + - `type` and `swap` fill in a `field` part with `text`; `scroll` moves a `scroll` part `to` 0 (the + top) or 1 (the bottom), or between, over `seconds` (0.2 to 10). + - `scene` starts a new scene with another `illustration`, with a `transition` of `cut`, `fade` (the + default) or `slide`. A slide moves the `moving` part, which both illustrations must have, out to + the left and in from the right, while everything else (a header, say) stays put. + + In a building-block storyboard: - `appear` puts a building block on the stage: `block` (required), and optionally an `id` that later steps target, a `text` label, a `value` (required for a `chart_bar`, from 0 to 100, and for a @@ -33104,7 +33161,29 @@ components: properties: type: type: string - enum: [appear, move_cursor, click, type, highlight, check, swap, cut, frame, carry, zoom] + enum: [appear, move_cursor, click, type, highlight, check, swap, cut, frame, carry, zoom, scroll, scene] + at: + type: number + minimum: 0 + description: Seconds from the start of the loop that the step plays at + part: + type: string + description: In an illustration storyboard, the part an `appear` step shows + motion: + type: string + enum: [fade, rise, lift, pop] + seconds: + type: number + description: How long a `move_cursor` (0.2 to 3) or `scroll` (0.2 to 10) takes + illustration: + type: string + description: For `scene`, the next scene's illustration + transition: + type: string + enum: [cut, fade, slide] + moving: + type: string + description: For a `slide`, the part that slides, which both illustrations have block: type: string enum: [top_bar, sidebar_item, table_row, card, button, field, chip, avatar, chart_bar, cell, timeline_item, calendar_event, icon] @@ -33134,9 +33213,15 @@ components: type: string enum: [register, profile, table, web_page, calendar, compare] to: - type: string - pattern: '^[a-z][a-z0-9_]{0,29}$' - description: For `carry`, the `id` of the block the carried block lands on, which appears after the next `cut` + oneOf: + - type: string + pattern: '^[a-z][a-z0-9_]{0,29}$' + - type: number + minimum: 0 + maximum: 1 + description: >- + For `carry`, the `id` of the block the carried block lands on, which appears after the next `cut`. + For `scroll`, how far down to scroll, from 0 (the top) to 1 (the bottom). GuidancePanelStoryboard: @@ -33145,6 +33230,12 @@ components: 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. + + An illustration storyboard names an `illustration` instead, and animates its parts, following the + visitor through the feature across scenes. It may run up to 40 seconds, 40 steps and 12,000 + characters, push the `camera` slowly in across each loop, and `crop` the first illustration for the + small Intro panel (an announcement plays it uncropped). People who turn off motion, or pause it, see + the finished picture of its last scene. required: [archetype, loop_seconds, alt, steps] additionalProperties: false properties: @@ -33158,16 +33249,38 @@ components: loop_seconds: type: integer minimum: 4 - maximum: 20 + maximum: 40 + description: Up to 20 for building blocks, 40 for an illustration storyboard alt: type: string minLength: 10 maxLength: 250 description: What the animation shows, read out by screen readers + illustration: + type: string + description: The first scene's illustration, from `GET /guidance_panels/illustrations` + hold_seconds: + type: number + minimum: 2 + maximum: 8 + description: How long the finished picture holds before the loop starts again; 2.5 if left out + camera: + type: string + enum: [push] + description: Illustration storyboards only. A slow 2.5% zoom in across each loop + crop: + type: array + items: + type: number + minItems: 4 + maxItems: 4 + description: >- + Illustration storyboards only. `[x, y, width, height]` of the first illustration, inside its + `view_box`: the piece the small Intro panel shows steps: type: array minItems: 1 - maxItems: 24 + maxItems: 40 items: $ref: '#/components/schemas/GuidancePanelStoryboardStep' example: @@ -33333,6 +33446,39 @@ components: items: $ref: '#/components/schemas/GuidancePanel' + GuidancePanelIllustration: + type: object + properties: + name: + type: string + example: event_booking + view_box: + type: array + items: + type: number + example: [0, 0, 1600, 1000] + parts: + type: array + items: + type: object + properties: + name: + type: string + example: first_name + kind: + type: string + enum: [part, field, scroll] + + PaginatedGuidancePanelIllustrations: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/GuidancePanelIllustration' + PaginatedApiKeys: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index bd0f584..e1a4994 100644 --- a/server.js +++ b/server.js @@ -4922,6 +4922,7 @@ function buildDocsPage() {

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, journey 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, chart_bar, which needs a value from 0 to 100, cell, timeline_item or calendar_event), 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. For a journey, where one piece of data turns up on page after page by itself: frame, a scene's first step, draws the scene as a simplified page captioned with its text (register, profile, table, web_page, calendar or compare); carry lifts its target and, after the next cut, flies it onto the block whose id is its to; zoom scales in on its target for two beats, then back out. The cell (a tickable Register cell), timeline_item and calendar_event blocks (whose value is the weekday, 1 to 5) belong to those pages, and an avatar, table_row, card or timeline_item can show a face from 1 to 5, one of the Makerble avatars. An icon block shows one of twelve named icons beside its text (its icon is pin, map, calendar, clock, document, chart, people, home, envelope, phone, star or heart), for a concept's metaphor. A chip, card or row shows a tick box only if a check step ticks it. People who turn off motion see the last frame. The response's visual is storyboard while one is showing.

+

Illustration storyboards: instead of blocks, a storyboard can name an illustration, one of the flat drawings of a feature's screens listed by GET /guidance_panels/illustrations, and animate its parts across scenes. appear shows a part with a motion (fade, rise, lift or pop); move_cursor (optional seconds), click, highlight and zoom act on a part; type and swap fill in a field part; scroll moves a scroll part to 0 (top) or 1 (bottom) over seconds; and scene moves to another illustration with a cut, fade or slide (whose moving part slides out left and in from the right while the header stays put). Any storyboard can time its steps with at (seconds from the start of the loop, on every step or none) and set hold_seconds (2 to 8). An illustration storyboard can also push the camera in slowly, and crop its first illustration for the small Intro panel; announcements play it uncropped. It may run up to 40 seconds, 40 steps and 12,000 characters.

${endpointCard("GET", "/guidance_panels", "List the Guidance Panels", true, [ @@ -4932,6 +4933,13 @@ function buildDocsPage() { { code: "200", cls: "response-2xx", desc: "Paginated list of panels, by page name" }, { code: "403", cls: "response-4xx", desc: "No System Access, or called with an API key or connected app" } ])} + ${endpointCard("GET", "/guidance_panels/illustrations", "List the illustrations an animation can play", true, [ + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Records per page" } + ], [ + { code: "200", cls: "response-2xx", desc: "Paginated list of illustrations: each one's name, view_box and parts, each a {name, kind} where kind is part, field or scroll" }, + { code: "403", cls: "response-4xx", desc: "No System Access" } + ])} ${endpointCard("GET", "/guidance_panels/{key}", "Get a Guidance Panel and its recent changes", true, [ { name: "key", in: "path", type: "string", required: true, desc: "The panel's key, e.g. events" } ], [