@plitzi/sdk-style 0.38.2 → 0.38.4
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,332 @@
|
|
|
1
1
|
# @plitzi/sdk-style
|
|
2
2
|
|
|
3
|
+
## 0.38.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6ae4161: ## `plitzi push`: a self-hosted project back on its space
|
|
8
|
+
|
|
9
|
+
`plitzi create --from` and `plitzi pull` took a space out as a project and kept it in step; nothing put the project's
|
|
10
|
+
own changes back but a command per part, and no command at all for its pages. `plitzi push` is the way back
|
|
11
|
+
(`docs/en/projects-from-spaces.md`):
|
|
12
|
+
|
|
13
|
+
- **What changed, or what is named.** `plitzi push` sends what changed since the project last had the space — at a
|
|
14
|
+
terminal, offered as a ticked list to choose from (`↑/↓`, space, Enter); `plitzi push space functions` sends only
|
|
15
|
+
those parts: `space`, `functions`, `runtime`, `plugins`.
|
|
16
|
+
- **In order:** each changed plugin packed and uploaded (`pack plugin` + `upload plugin`, `--cdn`/`--bucket`), the
|
|
17
|
+
functions, the runtime, then the space — `src/space.ts` authored, the actions `src/actions.ts` serves and the manifests
|
|
18
|
+
in `src/connectors/` — as the space's draft. Never a published environment.
|
|
19
|
+
- **Never over the builder's work unseen.** The export now carries which state the draft is in (`SpaceExport.draft`),
|
|
20
|
+
recorded in `.plitzi/space.json` by `create --from` and `pull`; a push names it, and a draft edited since is refused
|
|
21
|
+
until `--force`. A project that never had the space may take one nobody has worked on; one holding work takes
|
|
22
|
+
`--force`.
|
|
23
|
+
- **Then `pull` follows it.** `.plitzi/space.json` records what was sent — only that, so a builder's change to a part
|
|
24
|
+
not pushed is still the next pull's — and a project that started on its own works with `pull` from then on.
|
|
25
|
+
- `@plitzi/sdk-shared/source`: `SpaceImport` / `SpaceImportResult` (`SPACE_IMPORT_FORMAT`), the push's one shape for
|
|
26
|
+
both ends, beside `SpaceExport`, which gains `draft`.
|
|
27
|
+
- `functions push`, `runtime push` and `upload plugin` keep their behaviour; their cores are what `push` runs.
|
|
28
|
+
|
|
29
|
+
## A project's folders: `tmp/` for what it writes, `.plitzi/` committed, `public/` said to be public
|
|
30
|
+
- **`tmp/` is what a project writes for itself.** `@plitzi/sdk-server` keeps the plugins it builds in `tmp/.sdk-plugins`
|
|
31
|
+
and resized pictures in `tmp/images` by default (were `.sdk-plugins` and `.plitzi/images`). A project the CLI writes
|
|
32
|
+
puts the port it took (`tmp/dev-server.json`), the space as last authored while developing (`tmp/space.json`) and
|
|
33
|
+
Playwright's output (`tmp/visual`) there too, and its `.gitignore` ignores `tmp` — one line for all of it.
|
|
34
|
+
- **`.plitzi/` is committed.** The scaffold ignored it whole, so a clone lost `space.json`, `functions.json` and
|
|
35
|
+
`scaffold.json` — what `pull`, `push`, `functions push` and `upgrade` stand on. Now it holds only what the CLI records.
|
|
36
|
+
`npx plitzi upgrade --write` brings an existing project's `.gitignore` up.
|
|
37
|
+
- **No `space/offline-data.json`.** `npm run author` checks the space and writes nothing; the server asks it for the
|
|
38
|
+
documents with `--out tmp/space.json` while developing. The space is `src/space.ts`, and nothing beside it says
|
|
39
|
+
otherwise.
|
|
40
|
+
- **`public/` is on the internet.** The generated `README.md` and `AGENTS.md`, the CLI and authoring skills, the MCP
|
|
41
|
+
guide, `@plitzi/sdk-server`'s README and the docs now say so where data goes: never a secret, a key or data only
|
|
42
|
+
some visitors may read — in `public/`, or in a space's documents, which reach every visitor too.
|
|
43
|
+
|
|
44
|
+
## An agent leaves the project clean
|
|
45
|
+
|
|
46
|
+
`AGENTS.md` gains **Keep the project clean** — nothing unused left behind, scratch work in `tmp/`, one of everything,
|
|
47
|
+
files a reader can find, and `author`, `typecheck`, `lint`, `format` and `check` passing — and the authoring skill's
|
|
48
|
+
review checklist a **Nothing left behind** section.
|
|
49
|
+
|
|
50
|
+
## The dev tools' X-ray is the outlines too
|
|
51
|
+
|
|
52
|
+
The QA tab had **Outlines** (every element's box, its type and id when pointed at) and **X-ray** (the same boxes,
|
|
53
|
+
fainter, with what is wired to each). They are one tool now: the X-ray draws every box with its type and id, and marks
|
|
54
|
+
the wiring picked — all of it, one kind, or **Boxes only**.
|
|
55
|
+
|
|
56
|
+
## A new space that says where to go
|
|
57
|
+
|
|
58
|
+
The space a new account and `plitzi create` start from keeps its welcome, and gains the three ways to change it — the
|
|
59
|
+
builder, code (with the command to run) and an agent — before the guides, which are shorter. Header, navigation, main
|
|
60
|
+
and footer are landmarks; the grid behind the top fades out instead of ending at an edge; the footer's line spans the
|
|
61
|
+
content; the links say their words and icon themselves, with no suggestion left.
|
|
62
|
+
|
|
63
|
+
## Server data reads the same everywhere
|
|
64
|
+
- **One shape for a provider with a `query`.** A `runtime: 'server'` provider that only reads a JSON file the server
|
|
65
|
+
serves answered the body itself, while the same provider in the browser publishes `{ status, data }` — so moving it
|
|
66
|
+
to the server broke every binding. `publicFileResolver` and the builder's mock now answer `{ status, data }` too:
|
|
67
|
+
`<source>.data.<field>` whichever runtime.
|
|
68
|
+
- **Server data is on unless a space turns it off.** The page render read a missing `rsc` as on and the connector
|
|
69
|
+
resolver as off, so a server provider in a space the builder or the MCP made (neither writes `rsc`) resolved to
|
|
70
|
+
nothing, silently. Both read it as on now; only `rsc: { enabled: false }` turns it off (and is warned with a server
|
|
71
|
+
element). `authorSpace` writes `enabled: true` for a space that has one.
|
|
72
|
+
- **Never inside a component.** The page server resolves a page's tree and its layouts only, so a server provider in a
|
|
73
|
+
component rendered nothing, silently. Refused now (`server-provider-in-component`), with the fix: the provider on
|
|
74
|
+
the page, the rows handed in as a prop.
|
|
75
|
+
- **Bindings held to the data.** `authorSpace` takes `data` — what a provider's `query` answers — and
|
|
76
|
+
`publicData(folder)` (`@plitzi/sdk-authoring/node`) reads it from `public/`. A binding onto a path the file does not
|
|
77
|
+
have is warned (`path-not-in-data`) with the keys it does have. Generated projects pass it.
|
|
78
|
+
- **`plitzi check` reads the data too.** A binding that reads a path its provider's answer lacks, a provider that
|
|
79
|
+
failed (once, not as every element it left empty) and the rows each list rendered (`dataIssues`). `--ssr` names what
|
|
80
|
+
the server's HTML lacks that the hydrated page has. The dev tools' badge and panel (`data-plitzi-devtools`) are hidden
|
|
81
|
+
while `check` and `shot` look.
|
|
82
|
+
|
|
83
|
+
## Authoring, clearer where agents tripped
|
|
84
|
+
- **`controls` on a button** (`aria-controls`): named by the element's id; authoring gives that element the anchor and
|
|
85
|
+
refuses an id the space lacks (`controls-unknown`); a saved document naming no anchor is warned
|
|
86
|
+
(`controls-no-anchor`). The accordion recipe uses it.
|
|
87
|
+
- **`live` on a container** (`aria-live`, `polite` or `assertive`) for words that change while a visitor reads them.
|
|
88
|
+
- **`subType: 'p'`** for a paragraph made of parts; `span-holds-block` covers it.
|
|
89
|
+
- **`formControl` types `search`, `url` and `tel`.**
|
|
90
|
+
- **Images:** no `src` draws the SDK's own placeholder (the CDN one answered 404); `resize: false` keeps a picture as
|
|
91
|
+
written; an SVG is never resized — `/_plitzi/img` redirects to it (`307`) instead of refusing it.
|
|
92
|
+
- **Messages:** an id taken by another page or layout names it and the id to write; a hyphenated source in a template
|
|
93
|
+
(`list_study-plans`) is explained as valid; an unknown CSS property says to write it in `customCss`; an unknown
|
|
94
|
+
variant on `custom` says it is never a prop of the component it hosts.
|
|
95
|
+
- **`plitzi explain` knows the helpers** — `bindTemplate`, `visibleWhen`, `variantFrom`, `activeOn`, `activeWhen`,
|
|
96
|
+
`when`, `named`, `scope`, `source`, `twig` — and `motion`, from the presets the SDK plays (`MOTION_ENTERS`,
|
|
97
|
+
`MOTION_TRIGGERS`, `MOTION_LOOPS`, now exported). `--list helpers` lists them.
|
|
98
|
+
- **`plitzi shot`** writes to `tmp/shots/` by default, and a full page shows the arrivals tied to the scroll as they
|
|
99
|
+
end. `inspectPage` no longer reports an image a hidden ancestor hides.
|
|
100
|
+
- **Style inspector:** `container-type` in Size.
|
|
101
|
+
- **New recipes:** `server-data.ts`, `accordion.ts`.
|
|
102
|
+
|
|
103
|
+
## Matching a page to another, measured
|
|
104
|
+
- **A whole page is the whole page.** The SDK scrolls a pane of its own, so `shot`'s full-page picture was one
|
|
105
|
+
screen; the pane is unrolled now (`unrollPage`) — the viewport untouched, so a `100vh` hero stays one screen.
|
|
106
|
+
- **`plitzi shot --compare` says why, not only how much.** Every lazy picture on both pages is loaded before they are
|
|
107
|
+
taken (`loadImages`), so a section no longer swings between 23 % and 40 % on how many covers had arrived. Each section
|
|
108
|
+
is compared where it is on the other page (`alignPictures` over row profiles): a page 400 px longer is said once, with
|
|
109
|
+
the section the drift starts at, instead of a footer with the same styles reading 100 %. And the texts both pages
|
|
110
|
+
have are paired (`pageTexts`, `compareTexts`), each with what it does differently there —
|
|
111
|
+
`h1 "Learn CSS" — font-size 68px → 60px · y +19px` — position less the drift of its section. `comparePictures` takes
|
|
112
|
+
its options as an object now (`{ regions, tolerance, align }`).
|
|
113
|
+
- **`--scheme` is the space's theme.** A space whose default is dark painted dark under `--scheme light`, and the file
|
|
114
|
+
said light. `check` and `shot` now set the `theme` cookie a visitor's toggle writes; left out, the space's default is
|
|
115
|
+
pictured and the file is named by the theme actually painted.
|
|
116
|
+
|
|
117
|
+
## `motion: { on: 'view' }` arrives once
|
|
118
|
+
|
|
119
|
+
`view` was tied to the scroll both ways: cards faded out again as the reader scrolled back up. Now it plays once, the
|
|
120
|
+
first time the element comes into view, with its `duration`, and stays — `revealOnView` (`@plitzi/sdk-shared/schema/
|
|
121
|
+
motionReveal`), one observer under the SDK's root, marks it `data-motion-seen`. The scroll-driven arrival is
|
|
122
|
+
`on: 'scroll'`. A page read without scripts shows them as they end (`@media (scripting: none)`); the builder's previews
|
|
123
|
+
and the MCP's local screenshots hold motion at its end. The builder's Motion tab has the three.
|
|
124
|
+
|
|
125
|
+
The builder's preview plays motion as the published page does. It held everything at its end, and nothing marked
|
|
126
|
+
the canvas `data-hydrated`, so neither the loops nor a space's own `[data-hydrated]` animations ever started there.
|
|
127
|
+
Now an arrival plays as it comes into view, and the loops and keyframes run; **▶** on the canvas being edited runs the
|
|
128
|
+
space's own `[data-hydrated]` loops too. The motion guide adds the rule this needs from a space: `[data-hydrated]` is for
|
|
129
|
+
loops; an entrance of its own that plays once (`transform`/`opacity` only) plays from the first paint with
|
|
130
|
+
`backwards`, as the presets do — gated on hydration it jumps when the page goes live, and a canvas that never goes
|
|
131
|
+
live holds it on its first frame.
|
|
132
|
+
|
|
133
|
+
## Thirteen ways in, nine loops
|
|
134
|
+
|
|
135
|
+
`motion` grows from six arrivals and four loops to thirteen and nine, all still `opacity` and the transforms:
|
|
136
|
+
|
|
137
|
+
- **Bold arrivals:** `slide-up` (from well below), `zoom-in` (from 60%), `zoom-out` (settling from 125%), `tilt`
|
|
138
|
+
(rising as it turns straight), `spin-in` (half a turn as it grows).
|
|
139
|
+
- **Springy arrivals:** `pop` overshoots and settles; `bounce-in` falls into place and bounces.
|
|
140
|
+
- **Loops:** `bounce`, `wobble`, `orbit` (a slow circle round where it is), `heartbeat`, `drift`.
|
|
141
|
+
|
|
142
|
+
An arrival is now a list of frames (`MOTION_ENTER_FRAMES` in `@plitzi/sdk-shared/schema/motion`; `MOTION_ENTER_FROM`
|
|
143
|
+
is its first), and so is a loop (`MOTION_LOOP_FRAMES[name].frames`, replacing `transform`/`at`). Arrivals move the
|
|
144
|
+
individual `translate`, `scale` and `rotate`, so they still compose with an element's own `transform` and with a loop.
|
|
145
|
+
The builder's Motion tab previews every frame; authoring, the MCP, `explain motion` and GraphQL read the same lists.
|
|
146
|
+
|
|
147
|
+
An arrival from the side no longer scrolls the page sideways. `slide-left` starts 32px to the right of where it lands,
|
|
148
|
+
past a phone's 16px gutter, and until it had played the page could be dragged sideways. The SDK's root clips that way
|
|
149
|
+
now (`overflow-x: clip`, which keeps the window the scroller: sticky bars and scroll timelines are untouched), and the
|
|
150
|
+
builder's preview does the same. Content wider than the page is cut rather than scrolling the page — give it a box of
|
|
151
|
+
its own with `overflow-x: auto`.
|
|
152
|
+
|
|
153
|
+
**3D and the transform parts are style properties.** `transform-style`, `perspective-origin`, `backface-visibility`,
|
|
154
|
+
`translate`, `rotate` and `scale` join the vocabulary (they were refused as `css-property-unknown` and had to go in
|
|
155
|
+
`customCss`); `scale: 0.94` is a factor, not pixels.
|
|
156
|
+
|
|
157
|
+
**The builder's placeholder for an empty element is 24px** (was 50px), one size for every element that has one. It
|
|
158
|
+
is a minimum, so it also grew empty shapes with a size of their own — a dot, a planet — while editing; 24px is still
|
|
159
|
+
a box to see, pick and drop into.
|
|
160
|
+
|
|
161
|
+
The desktop app's window was blank: authoring, run in the renderer to build the rail, asked Vite's `process` shim for
|
|
162
|
+
a working directory it does not have. It reads one only where there is one now — and only when a class conflict is
|
|
163
|
+
reported, rather than for every element of every space it writes.
|
|
164
|
+
|
|
165
|
+
## Authoring advice that knows where and when
|
|
166
|
+
- **`class-conflict` says where both declarations are:** `styles('md-menu-button') at src/components/dropdown.ts:12,
|
|
167
|
+
used by button at …, and styles('md-menu-button') at src/site/layout.ts:8, used by …` — `styles()` records its line as
|
|
168
|
+
an element factory does.
|
|
169
|
+
- **`repeated-shape` leaves controls alone.** Siblings that read different sources or write different state keys — a
|
|
170
|
+
menu for the language, one for the level — are not offered as a list.
|
|
171
|
+
- **`quiet: ['repeated-shape']`** on an element says a suggestion was left on purpose, and it is not offered again.
|
|
172
|
+
Only suggestions' codes (`quiet-unknown`). It is saved on the element (`definition.quiet`), so the builder's problems
|
|
173
|
+
panel, the MCP's `upsertElement`/`patchElement` and a project pulled back with `plitzi pull` all leave it alone.
|
|
174
|
+
|
|
175
|
+
## What the docs say is what the code does
|
|
176
|
+
|
|
177
|
+
A pass across authoring's own messages, the skills, the MCP guide, `docs/en`, the CLI's README and the website, so an
|
|
178
|
+
agent reading two of them is never told two things:
|
|
179
|
+
|
|
180
|
+
- **A binding's `source` is the bound value, and only that.** With no value yet it fell back to the attribute's
|
|
181
|
+
current one — `sourceTo` — so `{{ source|default('…') }}` never took its default and `{{ source ? … }}` read an
|
|
182
|
+
element's placeholder ("Text") as an answer. It is `undefined` until the source has a value now; `sourceTo` is still
|
|
183
|
+
the value before.
|
|
184
|
+
- **`explain` writes a step the way its builder is called:** `delay(ms)`, `openModal('modal-id', data?)`,
|
|
185
|
+
`scrollBy('row-id', { x: '80%' })` — not `delay(…)` above the document's param names, which read as `delay({ time })`.
|
|
186
|
+
- **A page field nobody takes is told what it was probably for** — `seo` → `seoTitle` and `seoDescription` — instead of a
|
|
187
|
+
hint about keeping state appended to every one.
|
|
188
|
+
- Docs set straight: an element's id is `data-plitzi-el` in the page (`data-id` is the builder's, with debugging on);
|
|
189
|
+
a visibility condition writes nothing while its source has no value and is a yes or a no once it has one; `mobile`
|
|
190
|
+
is up to and including 48rem; `loadStrategy` defaults by type (`lazy` for a modal); the accessibility codes listed
|
|
191
|
+
in full everywhere (`embed-without-title`, `dropdown-without-control`, `controls-no-anchor`); the generated
|
|
192
|
+
`AGENTS.md` says a repeated block is a component and rows of data a list, as the skill does; `plitzi runtime` is
|
|
193
|
+
documented in the CLI's README, its skill and the website, which no longer says state across requests needs a
|
|
194
|
+
server of your own.
|
|
195
|
+
|
|
196
|
+
- Updated dependencies [6ae4161]
|
|
197
|
+
- @plitzi/sdk-plugins@0.38.4
|
|
198
|
+
- @plitzi/sdk-shared@0.38.4
|
|
199
|
+
- @plitzi/sdk-variables@0.38.4
|
|
200
|
+
|
|
201
|
+
## 0.38.3
|
|
202
|
+
|
|
203
|
+
### Patch Changes
|
|
204
|
+
|
|
205
|
+
- e047e1d: ## `plitzi upgrade`: a project brought up to its CLI
|
|
206
|
+
|
|
207
|
+
A project written by an older CLI had no way up but `plitzi create` in a scratch folder and a file-by-file comparison:
|
|
208
|
+
`skills update` brought the skills and nothing else, so the `check` and `shot` scripts they teach did not exist.
|
|
209
|
+
`plitzi upgrade` (also `update`) shows what this CLI writes today for what is the CLI's in the project, and `--write`
|
|
210
|
+
makes it. One part or several: `plitzi upgrade skills`, `plitzi upgrade files packages`.
|
|
211
|
+
|
|
212
|
+
- **`files`:** the CLI's machinery — `author.ts`, `main.ts`, the Playwright, TypeScript and lint configs, AGENTS.md. One
|
|
213
|
+
nobody changed since the CLI wrote it is replaced, a missing one added; one the project made its own is shown as a
|
|
214
|
+
diff and left, until `--take <file>` (or `all`). `plitzi create` now records what it wrote, by digest, in
|
|
215
|
+
`.plitzi/scaffold.json`; a project made before that sees every file that differs as its own.
|
|
216
|
+
- **`packages`:** `package.json` merged, never replaced — the scripts and dependencies it lacks added, `@plitzi/*`
|
|
217
|
+
raised to this version, then the install (`--no-install` to leave it). A script of the project's own stays.
|
|
218
|
+
- **`skills`:** `.claude/skills/plitzi-*` from the packages installed, each replaced whole, and the ones a newer CLI
|
|
219
|
+
writes added. `plitzi skills update` is `plitzi upgrade skills --write`.
|
|
220
|
+
- **`renames`:** a name a version renamed with no alias, at its file and line — `canTemplate` → `canSnippet`,
|
|
221
|
+
`authorTemplate` → `authorSnippet` and its kin (renamed only where imported from `@plitzi/sdk-authoring`) — renamed
|
|
222
|
+
with `--write`.
|
|
223
|
+
|
|
224
|
+
`npm run author` says when the skills or the CLI's files are older than the SDK installed, and `plitzi --version`
|
|
225
|
+
prints the CLI's.
|
|
226
|
+
|
|
227
|
+
## Page checks that can be the definition of done
|
|
228
|
+
|
|
229
|
+
`inspectPage`, `plitzi check` and the scaffold's visual test failed pages that were whole, so an agent learnt to ignore
|
|
230
|
+
them:
|
|
231
|
+
|
|
232
|
+
- **A breakpoint hiding an element on purpose** — the desktop navigation on a phone, a bottom bar only a phone shows —
|
|
233
|
+
is no longer "not visible": an element whose `display` or `visibility` a breakpoint rule sets is checked at the width
|
|
234
|
+
it shows at.
|
|
235
|
+
- **A lazy image out of sight** waits whichever side it is out of: below the fold, as before, or beside the screen in a
|
|
236
|
+
carousel's track — cut off by any ancestor that clips, as the browser decides when to fetch it.
|
|
237
|
+
- **A plugin that draws nothing** says so: `drawsNothing: true` in its declaration (a clock that fires a flow), and its
|
|
238
|
+
handle is `boxless`, so no check waits for it on screen.
|
|
239
|
+
|
|
240
|
+
`plitzi check --json` and `PageReport` carry `issues` beside `problems`: each with its `code` (`element-hidden`,
|
|
241
|
+
`image-not-loaded`, `sideways-scroll`…), the `elementId` it is about and, in `check`, the `width`.
|
|
242
|
+
|
|
243
|
+
## Authoring
|
|
244
|
+
- **A link's `content` names it.** `control-without-name` read only a link's `label`, so applying the
|
|
245
|
+
`content-attribute` suggestion as written turned every link into a warning.
|
|
246
|
+
- **`plitzi fix` writes `content-attribute`** where it has one reading: a button's or link's children that are only
|
|
247
|
+
`text(…)` and `fontAwesome({ icon })` become its own `content` and `icon` — the words kept as written, an import left
|
|
248
|
+
unused taken out. A child with an id, options or a class of the space's own stays, and is said. `npm run author`'s
|
|
249
|
+
`[fix]` line counts these too.
|
|
250
|
+
- **The recipes, the skill's examples and the catalog template** hold to the suggestions as well as the warnings, and
|
|
251
|
+
their tests say so: six recipes and the template wrote a link's or a button's words as a child.
|
|
252
|
+
|
|
253
|
+
## Declared motion — in code, in the builder and over MCP
|
|
254
|
+
|
|
255
|
+
An element says how it arrives and whether it keeps moving with `motion`, and the SDK's stylesheet plays it — no
|
|
256
|
+
keyframes to write: `{ enter: 'fade-up', on: 'view' }` arrives as it scrolls into view, `{ enter: 'scale', stagger:
|
|
257
|
+
60 }` brings its children one by one (a grid, a list's rows), `{ loop: 'float' }` keeps it moving. Enters: `fade`,
|
|
258
|
+
`fade-up`, `fade-down`, `slide-left`, `slide-right`, `scale`; loops: `float`, `pulse`, `spin`, `sway`; `duration`,
|
|
259
|
+
`delay`, `stagger` in ms. Opacity and the transforms only — an arrival on `translate`/`scale`, so it composes with an
|
|
260
|
+
element's own `transform` — a loop held until the page is live (`data-hydrated`), and none of it for a visitor who asked
|
|
261
|
+
for less motion. `view` follows the scroll where the browser has scroll timelines and plays on load where not.
|
|
262
|
+
|
|
263
|
+
- **Authoring:** `motion` on any factory; refused where it cannot play (`motion-invalid`, `motion-no-tag`), and carried
|
|
264
|
+
by `specFromSpace` and `compareSpaces`.
|
|
265
|
+
- **Builder:** a **Motion** tab in an element's tools: the presets as chips, a stage that plays the one pointed at (a
|
|
266
|
+
loop shown stronger than the page plays it, and saying so), when and how long, children one by one, and the choices
|
|
267
|
+
read back as a sentence — laid out side by side once the sidebar is wide enough. The canvas holds motion still while
|
|
268
|
+
editing; **▶** in the header (or **Play on the canvas** in the tab) plays it from the start, restarting what already
|
|
269
|
+
played, and an arrival tied to the scroll plays by the clock there, where it is usually in view already.
|
|
270
|
+
- **MCP:** `motion` on `upsertElement` and `patchElement`, checked the same way; the guide names the presets.
|
|
271
|
+
- **Schema:** `definition.motion` (`ElementMotion`, `@plitzi/sdk-shared/schema/motion` — the presets, `motionProblems`,
|
|
272
|
+
`motionAttributes`, `isMotionAnimation`, and each preset's frames, which the stylesheet is tested against), in both
|
|
273
|
+
init queries. **The platform's GraphQL schema has to declare `SpaceElementMotion`
|
|
274
|
+
before this version's builder or SDK queries it.**
|
|
275
|
+
|
|
276
|
+
## Dev tools QA: x-ray and motion
|
|
277
|
+
|
|
278
|
+
The **QA** tab gains an **X-ray**: every element the document wires something to — bound to data, shown on a condition,
|
|
279
|
+
running a flow, moving, behind a flag — outlined in its colour and named on the page, read from the space's document by
|
|
280
|
+
the element's name; its legend counts each kind on the page and picks one to show alone. Beside **Pause**, **Slow**
|
|
281
|
+
plays every animation at a quarter of its speed and **Replay** plays the declared motion again from the start, without
|
|
282
|
+
reloading the page.
|
|
283
|
+
|
|
284
|
+
## Plugins that draw
|
|
285
|
+
|
|
286
|
+
`useCanvas2d`, `useWebGL`, `useWebGL2` and `useAnimationFrame` (`@plitzi/plitzi-sdk`): a canvas sized to the device (at
|
|
287
|
+
most 2×), followed as it resizes, animating only while somebody can see it move — a live page, no reduced motion, the
|
|
288
|
+
tab in front, the canvas on screen — and one still frame otherwise (the builder included). `createShaderProgram`
|
|
289
|
+
compiles and links, and a shader that fails throws a `ShaderError` with the driver's log, printed as
|
|
290
|
+
`[plugin <type> "<id>"] fragment shader failed: …` instead of an empty canvas; `error` and `ready` say where it is.
|
|
291
|
+
`useReducedMotion` for the rest.
|
|
292
|
+
|
|
293
|
+
## A space re-authored without a restart
|
|
294
|
+
|
|
295
|
+
A project's `npm run start:dev` restarts for its server code and its plugins only: a save to the space is re-authored
|
|
296
|
+
in a process of its own and every open page loads again (`server.reloadPages()` over an SSE endpoint, on with
|
|
297
|
+
`createServer({ devReload: true })` — never by `devMode` alone, since every open page holds a connection for it); an
|
|
298
|
+
edit authoring refuses is printed and the page keeps the last space that authored. A shutdown also ends WebSockets at
|
|
299
|
+
once (`1001`, going away) rather than waiting out the grace — the ten seconds a restart used to wait on an open page.
|
|
300
|
+
|
|
301
|
+
## Checks and authoring, from the stripe.com experiment
|
|
302
|
+
- **A component's instance** is found by its own name: its root carries `data-plitzi-instance`, and the instance's
|
|
303
|
+
handle selects it — `inspectPage` no longer reports every named instance as missing.
|
|
304
|
+
- **Hidden at this width on purpose** — the burger on a desktop, the desktop menu on a phone — is listed apart
|
|
305
|
+
(`hiddenAtWidth`, and a dim line under `plitzi check`'s ✓) rather than as a problem.
|
|
306
|
+
- **An element whose every child is conditional** — four flyouts in one list, each opening on the state that names
|
|
307
|
+
it — is conditional too: at rest it shows nothing, and that is it working.
|
|
308
|
+
- **A carousel that scrolls by itself** (`overflow-x: auto`) is not the page scrolling sideways; the page's own pane
|
|
309
|
+
still is.
|
|
310
|
+
- **Templates:** `{{ state.faq ?? -1 }}` — a sign on the right of `??` — reads.
|
|
311
|
+
- **A plugin attribute named as an element field** (`variant`, `class`, `id`…) is warned about
|
|
312
|
+
(`plugin-attribute-reserved`): a factory never hands it to the plugin. A `variant` no class or type style declares is
|
|
313
|
+
`unknown-variant`.
|
|
314
|
+
- **Lists:** a list with `items` renders as the `<ul>` (or `<ol>`) its `subType` says — it was a `<div>` — with no
|
|
315
|
+
markers and the same spacing, so a page looks as it did; the builder offers the list type for it too. Its rows are
|
|
316
|
+
`<li>`s: `list-row-not-li` warns of one that is not — a plain container is made one by `fixSpace`, a link or a button
|
|
317
|
+
is wrapped — and the recipes, the catalog template and the docs write rows as `listItem`.
|
|
318
|
+
- **CSS:** `mask-size`, `mask-position`, `mask-repeat`, `mask-composite`, `-webkit-mask-image`,
|
|
319
|
+
`-webkit-background-clip`, `box-decoration-break` and `-webkit-box-decoration-break`.
|
|
320
|
+
- **`plitzi shot`:** `--clip <element>`, `--scroll-to <element>` and `--viewport`; `--frames` takes the same framing.
|
|
321
|
+
- **SVG from files:** `svgFile` and `svgFiles` (`@plitzi/sdk-authoring/node`) read a logo or a folder of them,
|
|
322
|
+
compacted (`compactSvg`, also on the main entry), instead of strings in the space's source.
|
|
323
|
+
- The plugin scaffolds say that an inline `style` on `RootElement` outranks the element's classes.
|
|
324
|
+
|
|
325
|
+
- Updated dependencies [e047e1d]
|
|
326
|
+
- @plitzi/sdk-plugins@0.38.3
|
|
327
|
+
- @plitzi/sdk-shared@0.38.3
|
|
328
|
+
- @plitzi/sdk-variables@0.38.3
|
|
329
|
+
|
|
3
330
|
## 0.38.2
|
|
4
331
|
|
|
5
332
|
### Patch Changes
|
|
@@ -4,13 +4,14 @@ import n from "../../components/CategoryOption/index.mjs";
|
|
|
4
4
|
import r from "../../components/CategorySection/index.mjs";
|
|
5
5
|
import i from "../../components/CategoryAdvanced/index.mjs";
|
|
6
6
|
import a from "../../components/CategoryContainer/index.mjs";
|
|
7
|
-
import o from "./
|
|
8
|
-
import s from "./
|
|
9
|
-
import c from "./
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
7
|
+
import o from "./SizeContainer.mjs";
|
|
8
|
+
import s from "./SizeFit.mjs";
|
|
9
|
+
import c from "./SizeOverflow.mjs";
|
|
10
|
+
import l from "./SizePosition.mjs";
|
|
11
|
+
import { memo as u, use as d, useCallback as f } from "react";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/StyleInspector/categories/Size/Size.tsx
|
|
13
|
-
var
|
|
14
|
+
var h = [
|
|
14
15
|
"width",
|
|
15
16
|
"height",
|
|
16
17
|
"min-width",
|
|
@@ -21,111 +22,123 @@ var m = [
|
|
|
21
22
|
"box-sizing",
|
|
22
23
|
"overflow",
|
|
23
24
|
"object-fit",
|
|
24
|
-
"object-position"
|
|
25
|
-
|
|
25
|
+
"object-position",
|
|
26
|
+
"container-type",
|
|
27
|
+
"container-name"
|
|
28
|
+
], g = [
|
|
26
29
|
"aspect-ratio",
|
|
27
30
|
"box-sizing",
|
|
28
31
|
"object-position",
|
|
29
|
-
"object-fit"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
"object-fit",
|
|
33
|
+
"container-type",
|
|
34
|
+
"container-name"
|
|
35
|
+
], _ = ["width", "height"], v = ["min-width", "min-height"], y = ["max-width", "max-height"], b = u(({ replaceTokens: u = !1, isCollapsed: b = !0, onCollapse: x }) => {
|
|
36
|
+
let { setValue: S } = d(e), { width: C, height: w, "min-width": T, "min-height": E, "max-width": D, "max-height": O, "aspect-ratio": k, "box-sizing": A, overflow: j, "object-position": M, "object-fit": N, "container-type": P, "container-name": F } = t({
|
|
37
|
+
keys: h,
|
|
33
38
|
asValue: !0,
|
|
34
|
-
replaceTokens:
|
|
35
|
-
}),
|
|
36
|
-
return /* @__PURE__ */
|
|
39
|
+
replaceTokens: u
|
|
40
|
+
}), I = f((e) => x?.("size", e), [x]), L = f((e) => (t) => S(e, t), [S]);
|
|
41
|
+
return /* @__PURE__ */ m(a, {
|
|
37
42
|
title: "Size",
|
|
38
|
-
dotKeys:
|
|
39
|
-
advancedKeys:
|
|
40
|
-
isCollapsed:
|
|
41
|
-
onCollapse:
|
|
43
|
+
dotKeys: h,
|
|
44
|
+
advancedKeys: g,
|
|
45
|
+
isCollapsed: b,
|
|
46
|
+
onCollapse: I,
|
|
42
47
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ m(r, {
|
|
44
49
|
label: "Size",
|
|
45
|
-
keys:
|
|
46
|
-
children: [/* @__PURE__ */
|
|
50
|
+
keys: _,
|
|
51
|
+
children: [/* @__PURE__ */ p(n, {
|
|
47
52
|
keys: ["width"],
|
|
48
53
|
preffix: "W",
|
|
49
|
-
value:
|
|
50
|
-
onChange:
|
|
54
|
+
value: C,
|
|
55
|
+
onChange: L("width"),
|
|
51
56
|
type: "metric"
|
|
52
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ p(n, {
|
|
53
58
|
keys: ["height"],
|
|
54
59
|
preffix: "H",
|
|
55
|
-
value:
|
|
56
|
-
onChange:
|
|
60
|
+
value: w,
|
|
61
|
+
onChange: L("height"),
|
|
57
62
|
type: "metric"
|
|
58
63
|
})]
|
|
59
64
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ m(r, {
|
|
61
66
|
label: "Min Size",
|
|
62
|
-
keys:
|
|
63
|
-
children: [/* @__PURE__ */
|
|
67
|
+
keys: v,
|
|
68
|
+
children: [/* @__PURE__ */ p(n, {
|
|
64
69
|
keys: ["min-width"],
|
|
65
70
|
preffix: "W",
|
|
66
|
-
value:
|
|
67
|
-
onChange:
|
|
71
|
+
value: T,
|
|
72
|
+
onChange: L("min-width"),
|
|
68
73
|
type: "metric"
|
|
69
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ p(n, {
|
|
70
75
|
keys: ["min-height"],
|
|
71
76
|
preffix: "H",
|
|
72
|
-
value:
|
|
73
|
-
onChange:
|
|
77
|
+
value: E,
|
|
78
|
+
onChange: L("min-height"),
|
|
74
79
|
type: "metric"
|
|
75
80
|
})]
|
|
76
81
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ m(r, {
|
|
78
83
|
label: "Max Size",
|
|
79
|
-
keys:
|
|
80
|
-
children: [/* @__PURE__ */
|
|
84
|
+
keys: y,
|
|
85
|
+
children: [/* @__PURE__ */ p(n, {
|
|
81
86
|
keys: ["max-width"],
|
|
82
87
|
preffix: "W",
|
|
83
|
-
value:
|
|
84
|
-
onChange:
|
|
88
|
+
value: D,
|
|
89
|
+
onChange: L("max-width"),
|
|
85
90
|
type: "metric"
|
|
86
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ p(n, {
|
|
87
92
|
keys: ["max-height"],
|
|
88
93
|
preffix: "H",
|
|
89
|
-
value:
|
|
90
|
-
onChange:
|
|
94
|
+
value: O,
|
|
95
|
+
onChange: L("max-height"),
|
|
91
96
|
type: "metric"
|
|
92
97
|
})]
|
|
93
98
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ p(i, { children: /* @__PURE__ */ m(r, {
|
|
95
100
|
label: "",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ p(n, {
|
|
97
102
|
keys: ["aspect-ratio"],
|
|
98
103
|
label: "Ratio",
|
|
99
|
-
value:
|
|
100
|
-
onChange:
|
|
101
|
-
}), /* @__PURE__ */
|
|
104
|
+
value: k,
|
|
105
|
+
onChange: L("aspect-ratio")
|
|
106
|
+
}), /* @__PURE__ */ m(n, {
|
|
102
107
|
keys: ["box-sizing"],
|
|
103
108
|
label: "Box Sizing",
|
|
104
|
-
value:
|
|
105
|
-
onChange:
|
|
109
|
+
value: A,
|
|
110
|
+
onChange: L("box-sizing"),
|
|
106
111
|
type: "select",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ p("option", {
|
|
108
113
|
value: "border-box",
|
|
109
114
|
children: "Border Box"
|
|
110
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ p("option", {
|
|
111
116
|
value: "content-box",
|
|
112
117
|
children: "Content Box"
|
|
113
118
|
})]
|
|
114
119
|
})]
|
|
115
120
|
}) }),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
value: A,
|
|
118
|
-
onChange: P
|
|
119
|
-
}),
|
|
120
|
-
/* @__PURE__ */ p(i, { children: [/* @__PURE__ */ f(c, {
|
|
121
|
+
/* @__PURE__ */ p(c, {
|
|
121
122
|
value: j,
|
|
122
|
-
onChange:
|
|
123
|
-
}),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
onChange: L
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ m(i, { children: [
|
|
126
|
+
/* @__PURE__ */ p(l, {
|
|
127
|
+
value: M,
|
|
128
|
+
onChange: L
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ p(s, {
|
|
131
|
+
value: N,
|
|
132
|
+
onChange: L
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ p(o, {
|
|
135
|
+
containerType: P,
|
|
136
|
+
containerName: F,
|
|
137
|
+
onChange: L
|
|
138
|
+
})
|
|
139
|
+
] })
|
|
127
140
|
]
|
|
128
141
|
});
|
|
129
142
|
});
|
|
130
143
|
//#endregion
|
|
131
|
-
export {
|
|
144
|
+
export { b as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
export type SizeContainerProps = {
|
|
3
|
+
containerType?: StyleValue;
|
|
4
|
+
containerName?: StyleValue;
|
|
5
|
+
onChange?: (type: StyleCategory) => (value: StyleValue | Record<StyleCategory, StyleValue> | boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Whether the element is a container its children measure themselves against — a container query, the `cqw` units —
|
|
9
|
+
* by its width (`inline-size`) or both sides (`size`), and the name a query asks for it by.
|
|
10
|
+
*/
|
|
11
|
+
declare const SizeContainer: ({ containerType, containerName, onChange }: SizeContainerProps) => import('react').JSX.Element;
|
|
12
|
+
export default SizeContainer;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import e from "../../components/CategoryOption/index.mjs";
|
|
2
|
+
import t from "../../components/CategorySection/index.mjs";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/StyleInspector/categories/Size/SizeContainer.tsx
|
|
5
|
+
var i = ({ containerType: i, containerName: a, onChange: o }) => /* @__PURE__ */ r(t, {
|
|
6
|
+
label: "",
|
|
7
|
+
children: [/* @__PURE__ */ r(e, {
|
|
8
|
+
keys: ["container-type"],
|
|
9
|
+
label: "Container",
|
|
10
|
+
value: i,
|
|
11
|
+
onChange: o?.("container-type"),
|
|
12
|
+
type: "select",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ n("option", {
|
|
15
|
+
value: "normal",
|
|
16
|
+
children: "None"
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ n("option", {
|
|
19
|
+
value: "inline-size",
|
|
20
|
+
children: "Width"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ n("option", {
|
|
23
|
+
value: "size",
|
|
24
|
+
children: "Width and height"
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
}), /* @__PURE__ */ n(e, {
|
|
28
|
+
keys: ["container-name"],
|
|
29
|
+
label: "Container name",
|
|
30
|
+
value: a,
|
|
31
|
+
onChange: o?.("container-name"),
|
|
32
|
+
type: "input"
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { i as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-style",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.4",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -594,6 +594,10 @@
|
|
|
594
594
|
"types": "./dist/components/StyleInspector/categories/Size/Size.d.ts",
|
|
595
595
|
"import": "./dist/components/StyleInspector/categories/Size/Size.mjs"
|
|
596
596
|
},
|
|
597
|
+
"./components/StyleInspector/categories/Size/SizeContainer": {
|
|
598
|
+
"types": "./dist/components/StyleInspector/categories/Size/SizeContainer.d.ts",
|
|
599
|
+
"import": "./dist/components/StyleInspector/categories/Size/SizeContainer.mjs"
|
|
600
|
+
},
|
|
597
601
|
"./components/StyleInspector/categories/Size/SizeFit": {
|
|
598
602
|
"types": "./dist/components/StyleInspector/categories/Size/SizeFit.d.ts",
|
|
599
603
|
"import": "./dist/components/StyleInspector/categories/Size/SizeFit.mjs"
|
|
@@ -941,9 +945,9 @@
|
|
|
941
945
|
},
|
|
942
946
|
"dependencies": {
|
|
943
947
|
"@plitzi/plitzi-ui": "^1.6.29",
|
|
944
|
-
"@plitzi/sdk-plugins": "0.38.
|
|
945
|
-
"@plitzi/sdk-shared": "0.38.
|
|
946
|
-
"@plitzi/sdk-variables": "0.38.
|
|
948
|
+
"@plitzi/sdk-plugins": "0.38.4",
|
|
949
|
+
"@plitzi/sdk-shared": "0.38.4",
|
|
950
|
+
"@plitzi/sdk-variables": "0.38.4",
|
|
947
951
|
"clsx": "^2.1.1",
|
|
948
952
|
"immer": "^11.1.21",
|
|
949
953
|
"prop-types": "^15.8.1",
|