@plitzi/plitzi-builder 0.38.2 → 0.38.3

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.
Files changed (24) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/dist/modules/App/AppContext.d.ts +10 -0
  3. package/dist/modules/App/components/AppHeader/MotionButton.d.ts +6 -0
  4. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/ElementMotion.d.ts +19 -0
  5. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionPresets/MotionPresets.d.ts +20 -0
  6. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionPresets/components/MotionPresetChip/MotionPresetChip.d.ts +12 -0
  7. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionPresets/components/MotionPresetChip/index.d.ts +3 -0
  8. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionPresets/index.d.ts +3 -0
  9. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionSection/MotionSection.d.ts +8 -0
  10. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionSection/index.d.ts +3 -0
  11. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionSummary/MotionSummary.d.ts +11 -0
  12. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionSummary/index.d.ts +3 -0
  13. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionTiming/MotionTiming.d.ts +10 -0
  14. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionTiming/components/MotionTriggerOption/MotionTriggerOption.d.ts +9 -0
  15. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionTiming/components/MotionTriggerOption/index.d.ts +3 -0
  16. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/components/MotionTiming/index.d.ts +3 -0
  17. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/helpers.d.ts +46 -0
  18. package/dist/modules/Builder/components/BuilderElementTools/ElementMotion/index.d.ts +2 -0
  19. package/dist/package.json.d.ts +1 -1
  20. package/dist/plitzi-builder.css +1 -1
  21. package/dist/plitzi-builder.css.gz +0 -0
  22. package/dist/plitzi-builder.js +1406 -1376
  23. package/dist/plitzi-builder.js.gz +0 -0
  24. package/package.json +15 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,144 @@
1
1
  # @plitzi/plitzi-builder
2
2
 
3
+ ## 0.38.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e047e1d: ## `plitzi upgrade`: a project brought up to its CLI
8
+
9
+ A project written by an older CLI had no way up but `plitzi create` in a scratch folder and a file-by-file comparison:
10
+ `skills update` brought the skills and nothing else, so the `check` and `shot` scripts they teach did not exist.
11
+ `plitzi upgrade` (also `update`) shows what this CLI writes today for what is the CLI's in the project, and `--write`
12
+ makes it. One part or several: `plitzi upgrade skills`, `plitzi upgrade files packages`.
13
+
14
+ - **`files`:** the CLI's machinery — `author.ts`, `main.ts`, the Playwright, TypeScript and lint configs, AGENTS.md. One
15
+ nobody changed since the CLI wrote it is replaced, a missing one added; one the project made its own is shown as a
16
+ diff and left, until `--take <file>` (or `all`). `plitzi create` now records what it wrote, by digest, in
17
+ `.plitzi/scaffold.json`; a project made before that sees every file that differs as its own.
18
+ - **`packages`:** `package.json` merged, never replaced — the scripts and dependencies it lacks added, `@plitzi/*`
19
+ raised to this version, then the install (`--no-install` to leave it). A script of the project's own stays.
20
+ - **`skills`:** `.claude/skills/plitzi-*` from the packages installed, each replaced whole, and the ones a newer CLI
21
+ writes added. `plitzi skills update` is `plitzi upgrade skills --write`.
22
+ - **`renames`:** a name a version renamed with no alias, at its file and line — `canTemplate` → `canSnippet`,
23
+ `authorTemplate` → `authorSnippet` and its kin (renamed only where imported from `@plitzi/sdk-authoring`) — renamed
24
+ with `--write`.
25
+
26
+ `npm run author` says when the skills or the CLI's files are older than the SDK installed, and `plitzi --version`
27
+ prints the CLI's.
28
+
29
+ ## Page checks that can be the definition of done
30
+
31
+ `inspectPage`, `plitzi check` and the scaffold's visual test failed pages that were whole, so an agent learnt to ignore
32
+ them:
33
+
34
+ - **A breakpoint hiding an element on purpose** — the desktop navigation on a phone, a bottom bar only a phone shows —
35
+ is no longer "not visible": an element whose `display` or `visibility` a breakpoint rule sets is checked at the width
36
+ it shows at.
37
+ - **A lazy image out of sight** waits whichever side it is out of: below the fold, as before, or beside the screen in a
38
+ carousel's track — cut off by any ancestor that clips, as the browser decides when to fetch it.
39
+ - **A plugin that draws nothing** says so: `drawsNothing: true` in its declaration (a clock that fires a flow), and its
40
+ handle is `boxless`, so no check waits for it on screen.
41
+
42
+ `plitzi check --json` and `PageReport` carry `issues` beside `problems`: each with its `code` (`element-hidden`,
43
+ `image-not-loaded`, `sideways-scroll`…), the `elementId` it is about and, in `check`, the `width`.
44
+
45
+ ## Authoring
46
+ - **A link's `content` names it.** `control-without-name` read only a link's `label`, so applying the
47
+ `content-attribute` suggestion as written turned every link into a warning.
48
+ - **`plitzi fix` writes `content-attribute`** where it has one reading: a button's or link's children that are only
49
+ `text(…)` and `fontAwesome({ icon })` become its own `content` and `icon` — the words kept as written, an import left
50
+ 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
51
+ `[fix]` line counts these too.
52
+ - **The recipes, the skill's examples and the catalog template** hold to the suggestions as well as the warnings, and
53
+ their tests say so: six recipes and the template wrote a link's or a button's words as a child.
54
+
55
+ ## Declared motion — in code, in the builder and over MCP
56
+
57
+ An element says how it arrives and whether it keeps moving with `motion`, and the SDK's stylesheet plays it — no
58
+ keyframes to write: `{ enter: 'fade-up', on: 'view' }` arrives as it scrolls into view, `{ enter: 'scale', stagger:
59
+ 60 }` brings its children one by one (a grid, a list's rows), `{ loop: 'float' }` keeps it moving. Enters: `fade`,
60
+ `fade-up`, `fade-down`, `slide-left`, `slide-right`, `scale`; loops: `float`, `pulse`, `spin`, `sway`; `duration`,
61
+ `delay`, `stagger` in ms. Opacity and the transforms only — an arrival on `translate`/`scale`, so it composes with an
62
+ element's own `transform` — a loop held until the page is live (`data-hydrated`), and none of it for a visitor who asked
63
+ for less motion. `view` follows the scroll where the browser has scroll timelines and plays on load where not.
64
+
65
+ - **Authoring:** `motion` on any factory; refused where it cannot play (`motion-invalid`, `motion-no-tag`), and carried
66
+ by `specFromSpace` and `compareSpaces`.
67
+ - **Builder:** a **Motion** tab in an element's tools: the presets as chips, a stage that plays the one pointed at (a
68
+ loop shown stronger than the page plays it, and saying so), when and how long, children one by one, and the choices
69
+ read back as a sentence — laid out side by side once the sidebar is wide enough. The canvas holds motion still while
70
+ editing; **▶** in the header (or **Play on the canvas** in the tab) plays it from the start, restarting what already
71
+ played, and an arrival tied to the scroll plays by the clock there, where it is usually in view already.
72
+ - **MCP:** `motion` on `upsertElement` and `patchElement`, checked the same way; the guide names the presets.
73
+ - **Schema:** `definition.motion` (`ElementMotion`, `@plitzi/sdk-shared/schema/motion` — the presets, `motionProblems`,
74
+ `motionAttributes`, `isMotionAnimation`, and each preset's frames, which the stylesheet is tested against), in both
75
+ init queries. **The platform's GraphQL schema has to declare `SpaceElementMotion`
76
+ before this version's builder or SDK queries it.**
77
+
78
+ ## Dev tools QA: x-ray and motion
79
+
80
+ The **QA** tab gains an **X-ray**: every element the document wires something to — bound to data, shown on a condition,
81
+ running a flow, moving, behind a flag — outlined in its colour and named on the page, read from the space's document by
82
+ the element's name; its legend counts each kind on the page and picks one to show alone. Beside **Pause**, **Slow**
83
+ plays every animation at a quarter of its speed and **Replay** plays the declared motion again from the start, without
84
+ reloading the page.
85
+
86
+ ## Plugins that draw
87
+
88
+ `useCanvas2d`, `useWebGL`, `useWebGL2` and `useAnimationFrame` (`@plitzi/plitzi-sdk`): a canvas sized to the device (at
89
+ most 2×), followed as it resizes, animating only while somebody can see it move — a live page, no reduced motion, the
90
+ tab in front, the canvas on screen — and one still frame otherwise (the builder included). `createShaderProgram`
91
+ compiles and links, and a shader that fails throws a `ShaderError` with the driver's log, printed as
92
+ `[plugin <type> "<id>"] fragment shader failed: …` instead of an empty canvas; `error` and `ready` say where it is.
93
+ `useReducedMotion` for the rest.
94
+
95
+ ## A space re-authored without a restart
96
+
97
+ A project's `npm run start:dev` restarts for its server code and its plugins only: a save to the space is re-authored
98
+ in a process of its own and every open page loads again (`server.reloadPages()` over an SSE endpoint, on with
99
+ `createServer({ devReload: true })` — never by `devMode` alone, since every open page holds a connection for it); an
100
+ edit authoring refuses is printed and the page keeps the last space that authored. A shutdown also ends WebSockets at
101
+ once (`1001`, going away) rather than waiting out the grace — the ten seconds a restart used to wait on an open page.
102
+
103
+ ## Checks and authoring, from the stripe.com experiment
104
+ - **A component's instance** is found by its own name: its root carries `data-plitzi-instance`, and the instance's
105
+ handle selects it — `inspectPage` no longer reports every named instance as missing.
106
+ - **Hidden at this width on purpose** — the burger on a desktop, the desktop menu on a phone — is listed apart
107
+ (`hiddenAtWidth`, and a dim line under `plitzi check`'s ✓) rather than as a problem.
108
+ - **An element whose every child is conditional** — four flyouts in one list, each opening on the state that names
109
+ it — is conditional too: at rest it shows nothing, and that is it working.
110
+ - **A carousel that scrolls by itself** (`overflow-x: auto`) is not the page scrolling sideways; the page's own pane
111
+ still is.
112
+ - **Templates:** `{{ state.faq ?? -1 }}` — a sign on the right of `??` — reads.
113
+ - **A plugin attribute named as an element field** (`variant`, `class`, `id`…) is warned about
114
+ (`plugin-attribute-reserved`): a factory never hands it to the plugin. A `variant` no class or type style declares is
115
+ `unknown-variant`.
116
+ - **Lists:** a list with `items` renders as the `<ul>` (or `<ol>`) its `subType` says — it was a `<div>` — with no
117
+ markers and the same spacing, so a page looks as it did; the builder offers the list type for it too. Its rows are
118
+ `<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
119
+ is wrapped — and the recipes, the catalog template and the docs write rows as `listItem`.
120
+ - **CSS:** `mask-size`, `mask-position`, `mask-repeat`, `mask-composite`, `-webkit-mask-image`,
121
+ `-webkit-background-clip`, `box-decoration-break` and `-webkit-box-decoration-break`.
122
+ - **`plitzi shot`:** `--clip <element>`, `--scroll-to <element>` and `--viewport`; `--frames` takes the same framing.
123
+ - **SVG from files:** `svgFile` and `svgFiles` (`@plitzi/sdk-authoring/node`) read a logo or a folder of them,
124
+ compacted (`compactSvg`, also on the main entry), instead of strings in the space's source.
125
+ - The plugin scaffolds say that an inline `style` on `RootElement` outranks the element's classes.
126
+
127
+ - Updated dependencies [e047e1d]
128
+ - @plitzi/sdk-auth@0.38.3
129
+ - @plitzi/sdk-authoring@0.38.3
130
+ - @plitzi/sdk-dev-tools@0.38.3
131
+ - @plitzi/sdk-elements@0.38.3
132
+ - @plitzi/sdk-event-bridge@0.38.3
133
+ - @plitzi/sdk-interactions@0.38.3
134
+ - @plitzi/sdk-navigation@0.38.3
135
+ - @plitzi/sdk-plugins@0.38.3
136
+ - @plitzi/sdk-schema@0.38.3
137
+ - @plitzi/sdk-shared@0.38.3
138
+ - @plitzi/sdk-style@0.38.3
139
+ - @plitzi/sdk-variables@0.38.3
140
+ - @plitzi/plitzi-sdk@0.38.3
141
+
3
142
  ## 0.38.2
4
143
 
5
144
  ### Patch Changes
@@ -9,6 +9,16 @@ export type AppContextValue = {
9
9
  /** The layout grid over the canvas: the columns a page is laid out on, to line an element up by eye. */
10
10
  displayGrid: boolean;
11
11
  setDisplayGrid: Dispatch<SetStateAction<boolean>>;
12
+ /**
13
+ * Whether the canvas plays the elements' declared motion. Still by default — what is edited is shown as it ends up,
14
+ * rather than arriving again on every change — and played on asking.
15
+ */
16
+ motionPlaying: boolean;
17
+ setMotionPlaying: Dispatch<SetStateAction<boolean>>;
18
+ /** How many times the motion was asked to play from its start — what the canvas restarts its animations on. */
19
+ motionReplays: number;
20
+ /** Plays every motion on the canvas from its start, and leaves it playing. */
21
+ replayMotion: () => void;
12
22
  zoom: number;
13
23
  setZoom: Dispatch<SetStateAction<number>>;
14
24
  displayMode: DisplayMode;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The elements' declared motion on the canvas: still while editing — each element shown as it ends up — and played
3
+ * from the start on asking, loops included.
4
+ */
5
+ declare const MotionButton: () => import('react').JSX.Element;
6
+ export default MotionButton;
@@ -0,0 +1,19 @@
1
+ import { ElementMotion as Motion } from '@plitzi/sdk-shared/schema/motion';
2
+ export type ElementMotionProps = {
3
+ motion?: Motion;
4
+ /** Whether the element holds children — what arriving one by one is about. */
5
+ canHoldItems?: boolean;
6
+ /** A page does not move: what is in it does. */
7
+ isPage?: boolean;
8
+ /** `undefined` removes it: the element does not move. */
9
+ onUpdate?: (key: string, value: Motion | undefined, isDefinition?: boolean) => void;
10
+ };
11
+ /**
12
+ * How the element arrives — and when, and whether its children follow one by one — and whether it keeps moving: the
13
+ * presets the SDK's stylesheet plays, each previewed on its tile, and the choices read back as a sentence. Opacity and
14
+ * transforms only, stilled for a visitor who asked for less motion.
15
+ *
16
+ * Saved as soon as it is one the page can play; while it is not, the tab says why and the element keeps the one it had.
17
+ */
18
+ declare const ElementMotion: ({ motion, canHoldItems, isPage, onUpdate }: ElementMotionProps) => import('react').JSX.Element;
19
+ export default ElementMotion;
@@ -0,0 +1,20 @@
1
+ import { PresetCopy, PresetKind } from '../../helpers';
2
+ export type MotionPresetsProps = {
3
+ kind: PresetKind;
4
+ /** The question the presets answer, which names the group. */
5
+ title: string;
6
+ /** What choosing none is called here, and what it looks like. */
7
+ none: PresetCopy;
8
+ presets: Record<string, PresetCopy>;
9
+ value: string;
10
+ /** The person asked their system for less motion: the stage shows where a preset ends, without playing it. */
11
+ still: boolean;
12
+ onChange: (value: string) => void;
13
+ };
14
+ /**
15
+ * One of the tab's two questions — how it arrives, whether it keeps moving — answered by picking a preset, with a stage
16
+ * that plays the one being looked at on a card (over and over while the pointer or the focus rests on it) and otherwise
17
+ * the chosen one, once. The stage is as wide as the sidebar; the chips wrap into as many columns as it fits.
18
+ */
19
+ declare const MotionPresets: ({ kind, title, none, presets, value, still, onChange }: MotionPresetsProps) => import('react').JSX.Element;
20
+ export default MotionPresets;
@@ -0,0 +1,12 @@
1
+ export type MotionPresetChipProps = {
2
+ /** The preset, or `''` for none. */
3
+ value: string;
4
+ label: string;
5
+ selected: boolean;
6
+ onSelect: (value: string) => void;
7
+ /** The pointer or the focus came to it: the section's stage shows it. */
8
+ onLook: (value: string) => void;
9
+ onLookAway: () => void;
10
+ };
11
+ declare const MotionPresetChip: ({ value, label, selected, onSelect, onLook, onLookAway }: MotionPresetChipProps) => import('react').JSX.Element;
12
+ export default MotionPresetChip;
@@ -0,0 +1,3 @@
1
+ import { default as MotionPresetChip } from './MotionPresetChip';
2
+ export * from './MotionPresetChip';
3
+ export default MotionPresetChip;
@@ -0,0 +1,3 @@
1
+ import { default as MotionPresets } from './MotionPresets';
2
+ export * from './MotionPresets';
3
+ export default MotionPresets;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export type MotionSectionProps = {
3
+ title: string;
4
+ children: ReactNode;
5
+ };
6
+ /** A band of the tab, headed the way the style inspector's categories are. */
7
+ declare const MotionSection: ({ title, children }: MotionSectionProps) => import('react').JSX.Element;
8
+ export default MotionSection;
@@ -0,0 +1,3 @@
1
+ import { default as MotionSection } from './MotionSection';
2
+ export * from './MotionSection';
3
+ export default MotionSection;
@@ -0,0 +1,11 @@
1
+ export type MotionSummaryProps = {
2
+ /** What the element will do, in words — or why it cannot yet. */
3
+ sentence: string;
4
+ problems: string[];
5
+ /** Whether the canvas is playing the motion, rather than holding it still. */
6
+ playing: boolean;
7
+ onPlay: () => void;
8
+ };
9
+ /** The choices read back as one sentence, and the way to watch them on the canvas, which is otherwise still. */
10
+ declare const MotionSummary: ({ sentence, problems, playing, onPlay }: MotionSummaryProps) => import('react').JSX.Element;
11
+ export default MotionSummary;
@@ -0,0 +1,3 @@
1
+ import { default as MotionSummary } from './MotionSummary';
2
+ export * from './MotionSummary';
3
+ export default MotionSummary;
@@ -0,0 +1,10 @@
1
+ import { Draft } from '../../helpers';
2
+ export type MotionTimingProps = {
3
+ draft: Draft;
4
+ /** Whether the element holds children — what arriving one by one is about. */
5
+ canHoldItems: boolean;
6
+ onChange: (key: keyof Draft, value: string) => void;
7
+ };
8
+ /** When the arrival plays and how long it takes — and, for an element with children, whether they come one by one. */
9
+ declare const MotionTiming: ({ draft, canHoldItems, onChange }: MotionTimingProps) => import('react').JSX.Element;
10
+ export default MotionTiming;
@@ -0,0 +1,9 @@
1
+ import { MotionTrigger } from '@plitzi/sdk-shared/schema/motion';
2
+ export type MotionTriggerOptionProps = {
3
+ trigger: MotionTrigger;
4
+ label: string;
5
+ selected: boolean;
6
+ onSelect: (trigger: MotionTrigger) => void;
7
+ };
8
+ declare const MotionTriggerOption: ({ trigger, label, selected, onSelect }: MotionTriggerOptionProps) => import('react').JSX.Element;
9
+ export default MotionTriggerOption;
@@ -0,0 +1,3 @@
1
+ import { default as MotionTriggerOption } from './MotionTriggerOption';
2
+ export * from './MotionTriggerOption';
3
+ export default MotionTriggerOption;
@@ -0,0 +1,3 @@
1
+ import { default as MotionTiming } from './MotionTiming';
2
+ export * from './MotionTiming';
3
+ export default MotionTiming;
@@ -0,0 +1,46 @@
1
+ import { ElementMotion, MotionEnter, MotionLoop, MotionTrigger } from '@plitzi/sdk-shared/schema/motion';
2
+ export type Timing = 'duration' | 'delay' | 'stagger';
3
+ /** What the fields hold while typed: the presets as chosen, the timings as written. */
4
+ export type Draft = {
5
+ enter: string;
6
+ on: string;
7
+ loop: string;
8
+ } & Record<Timing, string>;
9
+ export type PresetKind = 'enter' | 'loop';
10
+ /** A preset as a person reads it: its name, what it looks like, and the words the summary says it with. */
11
+ export type PresetCopy = {
12
+ label: string;
13
+ hint: string;
14
+ phrase: string;
15
+ };
16
+ export declare const ENTER_COPY: Record<MotionEnter, PresetCopy>;
17
+ export declare const LOOP_COPY: Record<MotionLoop, PresetCopy>;
18
+ export declare const ARRIVES_NONE: PresetCopy;
19
+ export declare const LOOP_NONE: PresetCopy;
20
+ export declare const TRIGGER_COPY: Record<MotionTrigger, {
21
+ label: string;
22
+ hint: string;
23
+ }>;
24
+ /** The gap a person gets on asking for children one by one, before they say another. */
25
+ export declare const DEFAULT_STAGGER = 80;
26
+ export declare const draftOf: (motion: ElementMotion | undefined) => Draft;
27
+ /** The draft as a motion: the fields left empty are left out, and `on` only beside an arrival it times. */
28
+ export declare const motionOf: (draft: Draft) => Record<string, unknown>;
29
+ /** What the element will do, in one or two sentences — what a person checks their choices against. */
30
+ export declare const describeMotion: (motion: ElementMotion) => string;
31
+ /**
32
+ * How much stronger a loop is played on the stage than on the page. A loop is meant to be barely noticed — 8 px of
33
+ * float, 4% of pulse, 2° of sway — and on a card a few dozen pixels wide that reads as nothing at all.
34
+ */
35
+ export declare const LOOP_PREVIEW_EMPHASIS = 3;
36
+ /** Whether the stage plays this preset stronger than the page does — what its caption owns up to. */
37
+ export declare const isEmphasised: (kind: PresetKind, name: string) => boolean;
38
+ /**
39
+ * A preset played on a tile: the frames the SDK's stylesheet plays (sdk-shared), an arrival at its default duration,
40
+ * a loop at a third of its period — a 6 s float is too slow to read while a pointer rests on it — and, one that swings
41
+ * back, `LOOP_PREVIEW_EMPHASIS` times stronger. A full turn is a turn at any strength.
42
+ */
43
+ export declare const previewOf: (kind: PresetKind, name: string, repeat: boolean) => {
44
+ keyframes: Keyframe[];
45
+ options: KeyframeAnimationOptions;
46
+ } | undefined;
@@ -0,0 +1,2 @@
1
+ export { default } from './ElementMotion';
2
+ export type { ElementMotionProps } from './ElementMotion';
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@plitzi/plitzi-builder",
3
- "version": "0.38.2",
3
+ "version": "0.38.3",
4
4
  "homepage": "./",
5
5
  "license": "AGPL-3.0",
6
6
  "files": [