tsquare 0.5.0 → 0.6.0
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 +43 -0
- package/dist/catalog.d.ts +78 -0
- package/dist/chunks/{chunk-B6KIVOSH.js → chunk-HDSKRKDL.js} +369 -25
- package/dist/cli.js +3 -3
- package/dist/compile.d.ts +1 -0
- package/dist/components.d.ts +3 -0
- package/dist/flows.d.ts +66 -0
- package/dist/index.js +5 -4
- package/dist/playground/index.d.ts +1 -0
- package/dist/playground/index.html +8 -0
- package/dist/playground/index.js +30 -6
- package/dist/playground/playground.js +17 -17
- package/dist/prompt.d.ts +1 -1
- package/dist/render.d.ts +13 -10
- package/dist/upgrade.d.ts +1 -1
- package/examples/sign-up-flow.tsq +26 -0
- package/package.json +1 -1
- package/skill/tsquare/SKILL.md +4 -3
- package/skill/tsquare/reference.md +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Flow arrows
|
|
6
|
+
|
|
7
|
+
```tsquare
|
|
8
|
+
board "Sign in flow"
|
|
9
|
+
screen phone "Sign in" #signin
|
|
10
|
+
button primary "Sign in" #submit
|
|
11
|
+
screen phone "Home" #home
|
|
12
|
+
heading "Welcome back"
|
|
13
|
+
text lines=3
|
|
14
|
+
button secondary "Sign out" #signout
|
|
15
|
+
flow submit -> home "Sign in"
|
|
16
|
+
flow signout -> signin dashed start=dot
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- **Ids:** `#name` after an element or a screen names it (one word: letters, digits, `-` and `_`, starting with a letter). Ids must be unique on the board and ignore case (`#Home` matches `home`).
|
|
20
|
+
- **Flows:** `flow <from> -> <to> "label"` lines go at the board level, after the screens, and draw an arrow between the two named elements or screens. Lines stay off screens they don't connect: an arrow to a neighboring screen crosses the gap between them (each on its own track), and one that skips a screen runs through its own lane under the screens. An arrow into a screen meets it at the height of the other end, so a button beside it gets a straight line. Labels stay on their line, clear of other labels and line ends, and the gaps between screens widen to fit labels on arrows between neighbors (unless the board sets `gap=`; with flows off the gaps are unchanged).
|
|
21
|
+
- **Options:** `start=` and `end=` pick each end's marker (`none`, `arrow`, `dot`, `circle`, `bar`; default no marker at the start and an arrow at the end), `line=rounded|hard|curved|straight` (default `rounded`), `dashed`, and `color=` with the 8 accent names, a hex color, or `accent` for the board's accent (default gray).
|
|
22
|
+
- **Off switch:** flows are drawn by default. Turn them off at render time with the playground's **Flows** switch (shown when a board has flows; image links copied while it's off leave them out too), `--no-flows` on the CLI, or `{ flows: false }` in the library. The board is then exactly what it would be without its flow lines.
|
|
23
|
+
- **Errors** for an unknown id (with close matches), a duplicate id, a flow with the same id at both ends, a flow nested inside a screen, a flow pointing into a closed accordion (its contents aren't drawn), and an id on a note or the board.
|
|
24
|
+
|
|
25
|
+
- **New example:** `examples/sign-up-flow.tsq` (create an account, verify the email with a code, welcome), with a dashed arrow back for "Wrong email?". It's in the playground's examples.
|
|
26
|
+
|
|
27
|
+
### `#` after an element is now an id
|
|
28
|
+
|
|
29
|
+
Comments still go on their own line, as since 0.3.0. What changed is a `#word` after an element: it used to be an error ("comments go on their own line"), and now it's an id when it looks like one (`button "Go" #cta`). Anything else after `#` is still an error. `avatar #jd` keeps meaning the initials "#jd". Old links keep working: see the new link prefix below.
|
|
30
|
+
|
|
31
|
+
### New link prefix: `y`
|
|
32
|
+
|
|
33
|
+
Share links and image URLs made by 0.6.0 start with `y` instead of `z`. Before 0.3.0, `#cta` after an element was a comment, and a link can't say which version made it. So `z` links keep their old meaning: a trailing `#word` is a comment and moves onto its own line. `y` links read `#word` as an id. Both prefixes decode. A site that renders tsquare links needs 0.6.0 to read `y` links.
|
|
34
|
+
|
|
35
|
+
### Eval
|
|
36
|
+
|
|
37
|
+
Three new requests for multi-screen flows (sign in, a checkout with a dashed path back, onboarding with a curved skip arrow in green), two runs each for Sonnet and Haiku with the final 0.6.0 prompt: every flow was written correctly (24 of 24 checks), and 11 of 12 outputs were valid (the miss was unrelated to flows). See `eval/README.md`.
|
|
38
|
+
|
|
39
|
+
## 0.5.1
|
|
40
|
+
|
|
41
|
+
Docs only: tooltips are easier to find.
|
|
42
|
+
- **Language guide:** the "Tooltips and open states" section starts with a rendered picture of a tooltip, an open select, an open date picker and a row menu. It's generated by `npm run docs`, so it always matches the renderer. The section also now says notes can't take tooltips.
|
|
43
|
+
- **Button page and the playground's Components tab:** a rendered tooltip example.
|
|
44
|
+
- **Components index:** a note that any element inside a screen can take `tooltip="…"`.
|
|
45
|
+
|
|
3
46
|
## 0.5.0
|
|
4
47
|
|
|
5
48
|
### Open states and tooltips
|
package/dist/catalog.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ import { z } from "zod";
|
|
|
6
6
|
export declare const UNIVERSAL_PROPS: {
|
|
7
7
|
readonly tooltip: z.ZodString;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* An element's id, written `#name` after it in text: what flow arrows point at. Any element can
|
|
11
|
+
* have one except the Board, Notes and Flows themselves; Screens can.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ID_PATTERN: RegExp;
|
|
14
|
+
export declare const takesId: (type: string) => boolean;
|
|
9
15
|
/** Not the canvas (Board, Screen) or its annotations (Note): a tooltip there would be meaningless. */
|
|
10
16
|
export declare const takesUniversalProps: (type: string) => boolean;
|
|
11
17
|
/** Why a universal prop isn't allowed here, and what to do instead. */
|
|
@@ -71,6 +77,42 @@ export declare const componentDefinitions: {
|
|
|
71
77
|
color: string;
|
|
72
78
|
};
|
|
73
79
|
};
|
|
80
|
+
Flow: {
|
|
81
|
+
props: z.ZodObject<{
|
|
82
|
+
from: z.ZodString;
|
|
83
|
+
to: z.ZodString;
|
|
84
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
start: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
86
|
+
arrow: "arrow";
|
|
87
|
+
bar: "bar";
|
|
88
|
+
circle: "circle";
|
|
89
|
+
dot: "dot";
|
|
90
|
+
none: "none";
|
|
91
|
+
}>>>;
|
|
92
|
+
end: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
93
|
+
arrow: "arrow";
|
|
94
|
+
bar: "bar";
|
|
95
|
+
circle: "circle";
|
|
96
|
+
dot: "dot";
|
|
97
|
+
none: "none";
|
|
98
|
+
}>>>;
|
|
99
|
+
line: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
100
|
+
curved: "curved";
|
|
101
|
+
hard: "hard";
|
|
102
|
+
rounded: "rounded";
|
|
103
|
+
straight: "straight";
|
|
104
|
+
}>>>;
|
|
105
|
+
dashed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
106
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
slots: never[];
|
|
109
|
+
description: string;
|
|
110
|
+
example: {
|
|
111
|
+
from: string;
|
|
112
|
+
to: string;
|
|
113
|
+
label: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
74
116
|
Stack: {
|
|
75
117
|
props: z.ZodObject<{
|
|
76
118
|
direction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -746,6 +788,42 @@ export declare const catalog: import("@json-render/core").Catalog<{
|
|
|
746
788
|
color: string;
|
|
747
789
|
};
|
|
748
790
|
};
|
|
791
|
+
Flow: {
|
|
792
|
+
props: z.ZodObject<{
|
|
793
|
+
from: z.ZodString;
|
|
794
|
+
to: z.ZodString;
|
|
795
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
796
|
+
start: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
797
|
+
arrow: "arrow";
|
|
798
|
+
bar: "bar";
|
|
799
|
+
circle: "circle";
|
|
800
|
+
dot: "dot";
|
|
801
|
+
none: "none";
|
|
802
|
+
}>>>;
|
|
803
|
+
end: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
804
|
+
arrow: "arrow";
|
|
805
|
+
bar: "bar";
|
|
806
|
+
circle: "circle";
|
|
807
|
+
dot: "dot";
|
|
808
|
+
none: "none";
|
|
809
|
+
}>>>;
|
|
810
|
+
line: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
811
|
+
curved: "curved";
|
|
812
|
+
hard: "hard";
|
|
813
|
+
rounded: "rounded";
|
|
814
|
+
straight: "straight";
|
|
815
|
+
}>>>;
|
|
816
|
+
dashed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
817
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
818
|
+
}, z.core.$strip>;
|
|
819
|
+
slots: never[];
|
|
820
|
+
description: string;
|
|
821
|
+
example: {
|
|
822
|
+
from: string;
|
|
823
|
+
to: string;
|
|
824
|
+
label: string;
|
|
825
|
+
};
|
|
826
|
+
};
|
|
749
827
|
Stack: {
|
|
750
828
|
props: z.ZodObject<{
|
|
751
829
|
direction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|