@reqquest/ui 1.12.0 → 1.12.1
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/README.md
CHANGED
|
@@ -2,7 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
This library provides a set of Svelte components and utilities for building ReqQuest projects. You'll especially find the `api` useful for creating graphQL queries. In the future we will provide a small component library to help you build your prompts.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Registering your prompts
|
|
6
|
+
|
|
7
|
+
Every prompt your API defines needs a Svelte component registered here, and nothing links the two
|
|
8
|
+
automatically. Use the keyed form of `UIConfig` so a prompt you forget to register is a build error
|
|
9
|
+
rather than a broken screen:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
const config = {
|
|
13
|
+
appName: 'My Program',
|
|
14
|
+
prompts: {
|
|
15
|
+
proof_of_residence_prompt: { formComponent: ResidencePrompt, displayComponent: ResidenceDisplay }
|
|
16
|
+
}
|
|
17
|
+
} satisfies UIConfig
|
|
18
|
+
export const uiRegistry = new UIRegistry(config)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
That check only has teeth once a key declaration augmenting `@reqquest/ui` is in your `src`. It is
|
|
22
|
+
generated on the **API** side, by the analyzer that ships with `@reqquest/api` — see
|
|
23
|
+
[docs/downstream-setup.md](../docs/downstream-setup.md). Without it, keys stay `string`, an
|
|
24
|
+
unregistered prompt renders an inline "unavailable" notice at runtime, and you find out when a user
|
|
25
|
+
reaches the screen.
|
|
26
|
+
|
|
27
|
+
# Developing this library
|
|
6
28
|
|
|
7
29
|
To develop the UI library, you'll want to work with the full demo, so `docker compose up --build` in the root of the repo. Similarly the test suite is combined with API tests, so run `./test.sh` in the root of the repo.
|
|
8
30
|
|
|
@@ -767,6 +767,8 @@ export interface RequirementPrompt {
|
|
|
767
767
|
moot: Scalars['Boolean'];
|
|
768
768
|
/** A human readable title for the prompt in the navigation. You probably want it to be shorter than the full title. If not provided, the title will be used. */
|
|
769
769
|
navTitle: Scalars['String'];
|
|
770
|
+
/** True when this row exists only because its requirement listed the prompt in `promptKeysNoDisplay` - a dependency it reads but does not own. Such a row must not be rendered beneath that requirement; the prompt is displayed under the requirement that does own it. This is not derivable from `visibility`: a no-display row is UNREACHABLE, but so is a prompt whose own requirement resolved before reaching it, and that one is still the requirement's to show. */
|
|
771
|
+
noDisplay: Scalars['Boolean'];
|
|
770
772
|
optOut: Scalars['Boolean'];
|
|
771
773
|
/** Preload data that has been generated according to the prompt definition. For example, a prompt might query the database for answers given in previous requests or query an external API to learn facts about the user. */
|
|
772
774
|
preloadData: (Scalars['JsonData'] | null);
|
|
@@ -1107,7 +1109,7 @@ export interface AnnouncementUpdate {
|
|
|
1107
1109
|
/** Short headline for the announcement. */
|
|
1108
1110
|
subject?: (Scalars['String'] | null);
|
|
1109
1111
|
/** The type of announcement, toggleable or date range */
|
|
1110
|
-
type?: (Scalars['
|
|
1112
|
+
type?: (Scalars['String'] | null);
|
|
1111
1113
|
}
|
|
1112
1114
|
/** Represents a group of applications all being applied for at the same time. As part of the request, multiple applications will be created and either eliminated as ineligible or submitted for approval. */
|
|
1113
1115
|
export interface AppRequestGenqlSelection {
|
|
@@ -2122,6 +2124,8 @@ export interface RequirementPromptGenqlSelection {
|
|
|
2122
2124
|
moot?: boolean | number;
|
|
2123
2125
|
/** A human readable title for the prompt in the navigation. You probably want it to be shorter than the full title. If not provided, the title will be used. */
|
|
2124
2126
|
navTitle?: boolean | number;
|
|
2127
|
+
/** True when this row exists only because its requirement listed the prompt in `promptKeysNoDisplay` - a dependency it reads but does not own. Such a row must not be rendered beneath that requirement; the prompt is displayed under the requirement that does own it. This is not derivable from `visibility`: a no-display row is UNREACHABLE, but so is a prompt whose own requirement resolved before reaching it, and that one is still the requirement's to show. */
|
|
2128
|
+
noDisplay?: boolean | number;
|
|
2125
2129
|
optOut?: boolean | number;
|
|
2126
2130
|
/** Preload data that has been generated according to the prompt definition. For example, a prompt might query the database for answers given in previous requests or query an external API to learn facts about the user. */
|
|
2127
2131
|
preloadData?: {
|
|
@@ -363,7 +363,7 @@ input AnnouncementUpdate {
|
|
|
363
363
|
subject: String
|
|
364
364
|
|
|
365
365
|
"""The type of announcement, toggleable or date range"""
|
|
366
|
-
type:
|
|
366
|
+
type: String
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
"""
|
|
@@ -1954,6 +1954,11 @@ type RequirementPrompt {
|
|
|
1954
1954
|
A human readable title for the prompt in the navigation. You probably want it to be shorter than the full title. If not provided, the title will be used.
|
|
1955
1955
|
"""
|
|
1956
1956
|
navTitle: String!
|
|
1957
|
+
|
|
1958
|
+
"""
|
|
1959
|
+
True when this row exists only because its requirement listed the prompt in `promptKeysNoDisplay` - a dependency it reads but does not own. Such a row must not be rendered beneath that requirement; the prompt is displayed under the requirement that does own it. This is not derivable from `visibility`: a no-display row is UNREACHABLE, but so is a prompt whose own requirement resolved before reaching it, and that one is still the requirement's to show.
|
|
1960
|
+
"""
|
|
1961
|
+
noDisplay: Boolean!
|
|
1957
1962
|
optOut: Boolean!
|
|
1958
1963
|
|
|
1959
1964
|
"""
|
|
@@ -487,7 +487,7 @@ export default {
|
|
|
487
487
|
89
|
|
488
488
|
],
|
|
489
489
|
"type": [
|
|
490
|
-
|
|
490
|
+
89
|
|
491
491
|
],
|
|
492
492
|
"__typename": [
|
|
493
493
|
89
|
|
@@ -1004,10 +1004,7 @@ export default {
|
|
|
1004
1004
|
36
|
|
1005
1005
|
],
|
|
1006
1006
|
"blame": [
|
|
1007
|
-
|
|
1008
|
-
],
|
|
1009
|
-
"blame": [
|
|
1010
|
-
86
|
|
1007
|
+
89
|
|
1011
1008
|
],
|
|
1012
1009
|
"configurationData": [
|
|
1013
1010
|
58
|
|
@@ -2227,6 +2224,9 @@ export default {
|
|
|
2227
2224
|
"navTitle": [
|
|
2228
2225
|
89
|
|
2229
2226
|
],
|
|
2227
|
+
"noDisplay": [
|
|
2228
|
+
45
|
|
2229
|
+
],
|
|
2230
2230
|
"optOut": [
|
|
2231
2231
|
45
|
|
2232
2232
|
],
|