@cratis/pi 8.15.0 → 8.16.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/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +5 -4
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/csharp-host-api.md +12 -1
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/csharp.md +1 -0
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/localized-strings.md +2 -0
- package/package.json +1 -1
|
@@ -170,13 +170,14 @@ See [Shell and design](references/shell-and-data.md) for the shell skeleton, `ar
|
|
|
170
170
|
|
|
171
171
|
### Profiles, design, sample data and strings
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
Rules: [Localized strings](references/localized-strings.md).
|
|
174
174
|
|
|
175
|
-
- `ui profile <Name>` (top level; several allowed) — `target platform`, `target size compact|regular|expanded`, `theme`, `root template [blueprint <Bp>] <Name> [version "<range>"]` with `option <n> <v>`, `identity` (`name`, `logo initials|icon|image`, `show name`), `appearance` → `color scheme light|dark|system`, `new screens use template …`, `packages` (in priority order, `core` as fallback), `icons` and `sample data` (`active <Pack>`, `shape <S> maps to <ReadModel>`, `bind <ReadModel> to <Pack>`). A screen never names
|
|
176
|
-
- `design system <Name>` (top level, once) — `modes`, `default theme` (required), `tokens` by category (color, space, size, radius, border, shadow, font, type, motion, opacity, z), `components` with `parts`, `variant` and `state`, `words`
|
|
175
|
+
- `ui profile <Name>` (top level; several allowed) — `target platform`, `target size compact|regular|expanded`, `theme`, `root template [blueprint <Bp>] <Name> [version "<range>"]` with `option <n> <v>`, `identity` (`name`, `logo initials|icon|image`, `show name`), `appearance` → `color scheme light|dark|system`, `new screens use template …`, `packages` (in priority order, `core` as fallback), `icons` and `sample data` (`active <Pack>`, `shape <S> maps to <ReadModel>`, `bind <ReadModel> to <Pack>`). A screen never names one.
|
|
176
|
+
- `design system <Name>` (top level, once) — `modes`, `default theme` (required), `tokens` by category (color, space, size, radius, border, shadow, font, type, motion, opacity, z), `components` with `parts`, `variant` and `state`, `words` and `rules contrast <part> on <part> at least <ratio>`.
|
|
177
177
|
- `theme <Name>` (top level) — `implements <DesignSystem>`, `compatible with <Package>`, `palette`, `values`, and per-mode blocks. Every color token needs a value in every mode. A profile's theme must implement the design system.
|
|
178
178
|
- `sample data <Name>` (top level) — `title`, `locale`, and `shape <ReadModel>` with `row` and `<field> = <literal>` (nested rows for collections). Activate it from a profile.
|
|
179
|
-
- `<base>.<locale>.strings` companion files with `key = "value"` — use `$strings.<key>` for
|
|
179
|
+
- `<base>.<locale>.strings` companion files with `key = "value"` — use `$strings.<key>` for titles, labels, toolbar button titles, notify, confirm and validation messages.
|
|
180
|
+
- Values use ICU 1 apostrophe quoting (`''`, `'{'`); a placeholder is one name or number, no plural or select.
|
|
180
181
|
|
|
181
182
|
### Tools and SDK surfaces
|
|
182
183
|
|
package/package/corpus/skills/cratis-screenplay-model-interaction/references/csharp-host-api.md
CHANGED
|
@@ -170,8 +170,19 @@ foreach (var file in files.FindIn("models/helpdesk"))
|
|
|
170
170
|
|
|
171
171
|
var english = new StringsFile([new StringsEntry("tickets.fields.subject", "Subject")]);
|
|
172
172
|
File.WriteAllText("models/helpdesk/tickets.en.strings", english.Write());
|
|
173
|
+
|
|
174
|
+
var entry = new StringsEntry("tickets.assigned", "Assigned to {assignee}, don''t reply");
|
|
175
|
+
foreach (var part in entry.Parts())
|
|
176
|
+
{
|
|
177
|
+
switch (part)
|
|
178
|
+
{
|
|
179
|
+
case StringsText text: Console.Write(text.Text); break;
|
|
180
|
+
case StringsPlaceholder placeholder: Console.Write($"<{placeholder.Name}>"); break;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
173
183
|
```
|
|
174
184
|
|
|
175
185
|
- `FindIn(root)` matches `StringsFiles.Pattern` (`**/*.strings`) and orders results by `RelativePath`; `Path` is absolute. `BaseName` and `Locale` come from `<base>.<locale>.strings`; `Locale` is `null` without a locale segment.
|
|
176
|
-
- `Parse` skips blank lines and `//` comments and throws `InvalidStringsLine` (with the line number) for anything else. A key starts with a letter or underscore and continues in dotted word segments. A value is double-quoted, cannot contain `"` and has no escapes
|
|
186
|
+
- `Parse` skips blank lines and `//` comments and throws `InvalidStringsLine` (with the line number) for anything else. A key starts with a letter or underscore and continues in dotted word segments. A value is double-quoted, cannot contain `"` and has no escapes. Values stay verbatim: `Parse` applies no placeholder or quoting rules.
|
|
187
|
+
- `StringsValue.Parse(value)` and `StringsEntry.Parts()` return the value as ordered `StringsText` (`Text`) and `StringsPlaceholder` (`Name`) parts with ICU MessageFormat 1 apostrophe quoting removed: `''` is an apostrophe, `'{'` and `'}'` are literal braces, an unclosed quote runs to the end. A placeholder is one name or a number 0–32767 without leading zeros. They throw `InvalidStringsValue` (with `Position`, the 0-based index of the offending character) for an unbalanced brace, braces around anything but one name or number, or an apostrophe directly before `<` or `>`.
|
|
177
188
|
- `Write()` emits the canonical form: one entry per line, keys padded to the longest. It drops comments and blank lines, so don't round-trip a hand-commented file through it.
|
|
@@ -118,6 +118,7 @@ return 0;
|
|
|
118
118
|
| `DesignSystemResolver.SelectTheme` / `.SelectMode` / `.Resolve` | Flatten a profile's theme and mode into tokens and component parts. |
|
|
119
119
|
| `UiProfileShellBinder.Bind` | Check profile shells against the blueprints a host has installed. |
|
|
120
120
|
| `StringsFile` / `StringsFiles` | Find, parse and write `.strings` files. |
|
|
121
|
+
| `StringsValue.Parse` / `StringsEntry.Parts` | Split a value into ordered `StringsText` and `StringsPlaceholder` parts; throws `InvalidStringsValue` with a `Position`. `StringsFile.Parse` keeps values verbatim. |
|
|
121
122
|
|
|
122
123
|
## Not supported in this SDK
|
|
123
124
|
|
package/package/corpus/skills/cratis-screenplay-model-interaction/references/localized-strings.md
CHANGED
|
@@ -8,6 +8,8 @@ invoices.fields.number = "Invoice number"
|
|
|
8
8
|
notifications.invoiceRegistered = "Invoice {number} from Acme"
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
A value uses ICU MessageFormat 1 apostrophe quoting: `''` is an apostrophe, `'{'` and `'}'` are literal braces, so `'{number}'` is the text `{number}`, and an apostrophe directly before `<` or `>` is refused (write `''<`). A placeholder is a single name, or a number 0–32767 without leading zeros. Plural, select and typed forms such as `{count, number}` are not supported. Every locale of a key uses the same placeholder names.
|
|
12
|
+
|
|
11
13
|
Use the same dotted keys and preserve `{number}` and any other placeholders in each locale's file, such as `invoicing.nb.strings`. At a screen label or title, use the unquoted reference; for example, a form field can use:
|
|
12
14
|
|
|
13
15
|
```play
|