@softure-ai/marketing-kit 0.1.11 → 0.1.12
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 +9 -0
- package/README.md +35 -5
- package/dist/config/schema.d.ts +693 -71
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +3 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/config/shot-steps.d.ts +156 -0
- package/dist/config/shot-steps.d.ts.map +1 -1
- package/dist/config/shot-steps.js +9 -1
- package/dist/config/shot-steps.js.map +1 -1
- package/dist/screenshot/screenshot.d.ts.map +1 -1
- package/dist/screenshot/screenshot.js +39 -2
- package/dist/screenshot/screenshot.js.map +1 -1
- package/dist/screenshot/steps.d.ts +1 -1
- package/dist/screenshot/steps.d.ts.map +1 -1
- package/dist/screenshot/steps.js +15 -1
- package/dist/screenshot/steps.js.map +1 -1
- package/package.json +1 -1
- package/schema/marketing.schema.json +497 -0
- package/src/config/schema.ts +3 -0
- package/src/config/shot-steps.ts +9 -1
- package/src/screenshot/screenshot.ts +35 -2
- package/src/screenshot/steps.ts +15 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ Newest first. Each version lists what changed for an app that uses `@softure-ai/
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done"). Versions before the first one below are described in their GitHub Releases (`marketing-kit@x.y.z`).
|
|
6
6
|
|
|
7
|
+
## 0.1.12
|
|
8
|
+
|
|
9
|
+
- `shots` frames one row of a card that is shorter than its crop (#371):
|
|
10
|
+
- `crop.fill: true`: a target shorter than its frame is stretched to the frame's bottom edge for the capture and
|
|
11
|
+
its content centred vertically, so no page background or next card shows below it. Refused (gate `crop`) when
|
|
12
|
+
the target still ends above the frame's bottom edge; excludes `crop.top`.
|
|
13
|
+
- Step `flatten`: removes the top border and top margin of every match, e.g. the line above the first row a print
|
|
14
|
+
state still shows; fails when nothing matches.
|
|
15
|
+
|
|
7
16
|
## 0.1.11
|
|
8
17
|
|
|
9
18
|
- `shots` entries take a print state (#333):
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ TTS providers (MK-7), screenshots (MK-4) and OG images (MK-5) build on it. Backg
|
|
|
17
17
|
An app runs the kit through `npx` with a pinned version, not as a dependency:
|
|
18
18
|
|
|
19
19
|
```json
|
|
20
|
-
{ "scripts": { "marketing": "npx -y @softure-ai/marketing-kit@0.1.
|
|
20
|
+
{ "scripts": { "marketing": "npx -y @softure-ai/marketing-kit@0.1.12" } }
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
`npm run marketing -- all <video>` then runs the CLI. As a `devDependency` the kit would add more than 100 MB
|
|
@@ -90,19 +90,19 @@ folder of `marketing.json`, written by the app's own login script (`await contex
|
|
|
90
90
|
`npx playwright codegen --save-storage=<file> <url>`. It holds a live session, so keep it out of git and regenerate
|
|
91
91
|
it when the session expires; a missing or broken file stops `shots` before the browser starts. To have `shots` sign
|
|
92
92
|
in itself, see [Signed-in screens](#signed-in-screens). `steps` run on the page after it loaded, before any gate
|
|
93
|
-
reads it: `click` (open a collapsed section), `fill`, `check`, `press`, `open` and `
|
|
93
|
+
reads it: `click` (open a collapsed section), `fill`, `check`, `press`, `open`, `hide` and `flatten`, each with 10 s. `crop`
|
|
94
94
|
frames one element at a fixed aspect ratio instead of the viewport, see [A frame around one element](#a-frame-around-one-element);
|
|
95
|
-
`hide` and the `open` and `
|
|
95
|
+
`hide`, `crop.fill` and the `open`, `hide` and `flatten` steps give a frame its print state, see [A still image of an interactive card](#a-still-image-of-an-interactive-card).
|
|
96
96
|
A screenshot is kept only when it passes every gate:
|
|
97
97
|
|
|
98
98
|
| Gate | Refused when |
|
|
99
99
|
| --- | --- |
|
|
100
100
|
| `sign-in` | a `signedIn` entry, and the run's sign-in failed (the reason is printed with every such file) |
|
|
101
101
|
| `status` | the page answers with HTTP 400 or above, or not at all (`load`: it did not load within 30 s) |
|
|
102
|
-
| `steps` | a step could not be done (its element never appeared, matched several, is not an input, is not a `<details>`, left nothing to hide) |
|
|
102
|
+
| `steps` | a step could not be done (its element never appeared, matched several, is not an input, is not a `<details>`, left nothing to hide, matched nothing to flatten) |
|
|
103
103
|
| `scroll` | the page cannot scroll as far as `scrollTo` (the frame would show another place) |
|
|
104
104
|
| `phrase` | the page does not show `expect` within 5 s of loading (hidden elements do not count) |
|
|
105
|
-
| `crop` | the crop's target (or `crop.top`) matches no element or several, `crop.top` lies outside the target, its frame runs past the page, or the file is not the frame's size |
|
|
105
|
+
| `crop` | the crop's target (or `crop.top`) matches no element or several, `crop.top` lies outside the target, `crop.fill` could not stretch the target to the frame, its frame runs past the page, or the file is not the frame's size |
|
|
106
106
|
| `hide` | a selector of the entry's `hide` still shows an element inside the frame (an inline `!important` beat it), or the browser cannot parse it |
|
|
107
107
|
| `size` | the file is smaller than `minBytes` (40 kB by default: a blank or broken page); the file is deleted |
|
|
108
108
|
| `duplicate` | an earlier file of the same run has the same bytes (the page did not change between the two shots); deleted |
|
|
@@ -182,6 +182,12 @@ a page, so set `minBytes` for it (15000 is a fair floor for a filled card).
|
|
|
182
182
|
e.g. a row inside a card, while the width stays the target's. Its top edge must lie inside the target, or the crop
|
|
183
183
|
is refused: the frame would no longer show the target.
|
|
184
184
|
|
|
185
|
+
`crop.fill: true` stretches a target that is shorter than its frame down to the frame's bottom edge and centres its
|
|
186
|
+
content vertically (`min-height` and a centred flex column, inline with `!important`, in the capture browser only), so
|
|
187
|
+
no page background or next card shows below it. A target that is already as tall as the frame is left as it is. The
|
|
188
|
+
`crop` gate refuses the file when the target still ends above the frame's bottom edge (an SVG, or a script that resets
|
|
189
|
+
its style). `crop.fill` excludes `crop.top`: centring would move the row the frame starts at.
|
|
190
|
+
|
|
185
191
|
#### A still image of an interactive card
|
|
186
192
|
|
|
187
193
|
A frame of a signed-in card shows controls that mean nothing in a still image: hint `?` buttons, disclosure arrows,
|
|
@@ -208,6 +214,24 @@ print state:
|
|
|
208
214
|
- `{ "do": "hide", "target": …, "keepLast": N }` hides every match but the last `N` (default 0: all of them), e.g. all
|
|
209
215
|
but the last three columns of a chart that scrolls sideways, so no amount is cut at the frame's edge. It fails when
|
|
210
216
|
there are not more matches than `keepLast`, which hides nothing.
|
|
217
|
+
- `{ "do": "flatten", "target": … }` removes the top border and top margin of every match, e.g. the line a list's
|
|
218
|
+
`border-top` draws above the first row a print state still shows. It fails when nothing matches.
|
|
219
|
+
|
|
220
|
+
One row of a card, when the rest is hidden and the card is shorter than its frame: `crop.fill` stretches the card to
|
|
221
|
+
the frame and centres the row, and `flatten` drops the border the list kept above it.
|
|
222
|
+
|
|
223
|
+
```jsonc
|
|
224
|
+
{ "id": "frame-change", "path": "/dashboard", "width": 390, "height": 900, "scale": 2, "signedIn": true,
|
|
225
|
+
"expect": "Change since last month", "minBytes": 15000,
|
|
226
|
+
"steps": [
|
|
227
|
+
{ "do": "open", "target": { "css": "details.change" } },
|
|
228
|
+
{ "do": "hide", "target": { "css": "section.rail > header" } },
|
|
229
|
+
{ "do": "hide", "target": { "css": "section.rail > div" } },
|
|
230
|
+
{ "do": "hide", "target": { "css": "section.rail > dl > div" }, "keepLast": 1 },
|
|
231
|
+
{ "do": "flatten", "target": { "css": "section.rail > dl" } }
|
|
232
|
+
],
|
|
233
|
+
"crop": { "target": { "css": "section.rail" }, "aspect": "6:5", "fill": true } }
|
|
234
|
+
```
|
|
211
235
|
|
|
212
236
|
#### One page anywhere: `shots --page`
|
|
213
237
|
|
|
@@ -487,6 +511,12 @@ format, so its paid recordings are reused as they are, with no re-keying and no
|
|
|
487
511
|
`from the cache`; an estimate line means the text, voice or model differs from FIRE's, and nothing
|
|
488
512
|
was spent.
|
|
489
513
|
|
|
514
|
+
### Upgrading to 0.1.12
|
|
515
|
+
|
|
516
|
+
- A 0.1.11 `marketing.json` works as it is. New: `crop.fill` and the step `flatten`. An app that frames one row of a
|
|
517
|
+
card with its own capture styles (a `min-height` on the card, a dropped `border-top`) can move that frame to
|
|
518
|
+
`marketing.json`.
|
|
519
|
+
|
|
490
520
|
### Upgrading to 0.1.11
|
|
491
521
|
|
|
492
522
|
- A 0.1.10 `marketing.json` works as it is. New: `hide` on entries (with the `hide` gate), `crop.top`, and the steps
|