@modelform/react-native 0.10.0 → 0.12.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/README.md +4 -2
- package/dist/{chunk-KROS6BLM.js → chunk-G67L7TFK.js} +174 -63
- package/dist/{chunk-QXUFH447.mjs → chunk-YUSXYDXG.mjs} +174 -63
- package/dist/core/authoring.d.ts +37 -1
- package/dist/core/index.js +14 -2
- package/dist/core/index.mjs +13 -1
- package/dist/core/manifest.d.ts +20 -1
- package/dist/index.js +167 -155
- package/dist/index.mjs +13 -1
- package/package.json +1 -1
- package/schema/app.schema.json +3 -2
package/dist/core/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ConfigLoader,
|
|
9
9
|
DASHBOARD_DS,
|
|
10
10
|
DEFAULT_GAZETTEER,
|
|
11
|
+
DOCUMENT_GUIDE,
|
|
11
12
|
EDITABLE_VARIABLE_TYPES,
|
|
12
13
|
EXAMPLE_TEMPLATE,
|
|
13
14
|
GRID_COLUMNS,
|
|
@@ -62,8 +63,10 @@ import {
|
|
|
62
63
|
defaultFetchJson,
|
|
63
64
|
describeRange,
|
|
64
65
|
diffJson,
|
|
66
|
+
documentChanges,
|
|
65
67
|
documentIdFor,
|
|
66
68
|
documentKind,
|
|
69
|
+
documentPrompt,
|
|
67
70
|
documentUses,
|
|
68
71
|
dropTarget,
|
|
69
72
|
duplicatePanel,
|
|
@@ -75,6 +78,7 @@ import {
|
|
|
75
78
|
fetchJsonWithToken,
|
|
76
79
|
fieldDisplayName,
|
|
77
80
|
fieldMatches,
|
|
81
|
+
fixDocumentPrompt,
|
|
78
82
|
fixTemplatePrompt,
|
|
79
83
|
formatClock,
|
|
80
84
|
formatDisplay,
|
|
@@ -161,6 +165,7 @@ import {
|
|
|
161
165
|
queryPanel,
|
|
162
166
|
queryParam,
|
|
163
167
|
readConfigFiles,
|
|
168
|
+
readDocumentAnswer,
|
|
164
169
|
readTemplateAnswer,
|
|
165
170
|
readingOrder,
|
|
166
171
|
reduce,
|
|
@@ -173,6 +178,7 @@ import {
|
|
|
173
178
|
renameVariableInPanels,
|
|
174
179
|
repack,
|
|
175
180
|
repeatOptions,
|
|
181
|
+
requiredManifestVersion,
|
|
176
182
|
resizePanel,
|
|
177
183
|
resolveColor,
|
|
178
184
|
resolveFieldConfig,
|
|
@@ -228,7 +234,7 @@ import {
|
|
|
228
234
|
variableWithType,
|
|
229
235
|
visibleVariables,
|
|
230
236
|
zoomRange
|
|
231
|
-
} from "../chunk-
|
|
237
|
+
} from "../chunk-YUSXYDXG.mjs";
|
|
232
238
|
export {
|
|
233
239
|
ALL,
|
|
234
240
|
AUTHORING_GUIDE,
|
|
@@ -239,6 +245,7 @@ export {
|
|
|
239
245
|
ConfigLoader,
|
|
240
246
|
DASHBOARD_DS,
|
|
241
247
|
DEFAULT_GAZETTEER,
|
|
248
|
+
DOCUMENT_GUIDE,
|
|
242
249
|
EDITABLE_VARIABLE_TYPES,
|
|
243
250
|
EXAMPLE_TEMPLATE,
|
|
244
251
|
GRID_COLUMNS,
|
|
@@ -293,8 +300,10 @@ export {
|
|
|
293
300
|
defaultFetchJson,
|
|
294
301
|
describeRange,
|
|
295
302
|
diffJson,
|
|
303
|
+
documentChanges,
|
|
296
304
|
documentIdFor,
|
|
297
305
|
documentKind,
|
|
306
|
+
documentPrompt,
|
|
298
307
|
documentUses,
|
|
299
308
|
dropTarget,
|
|
300
309
|
duplicatePanel,
|
|
@@ -306,6 +315,7 @@ export {
|
|
|
306
315
|
fetchJsonWithToken,
|
|
307
316
|
fieldDisplayName,
|
|
308
317
|
fieldMatches,
|
|
318
|
+
fixDocumentPrompt,
|
|
309
319
|
fixTemplatePrompt,
|
|
310
320
|
formatClock,
|
|
311
321
|
formatDisplay,
|
|
@@ -392,6 +402,7 @@ export {
|
|
|
392
402
|
queryPanel,
|
|
393
403
|
queryParam,
|
|
394
404
|
readConfigFiles,
|
|
405
|
+
readDocumentAnswer,
|
|
395
406
|
readTemplateAnswer,
|
|
396
407
|
readingOrder,
|
|
397
408
|
reduce,
|
|
@@ -404,6 +415,7 @@ export {
|
|
|
404
415
|
renameVariableInPanels,
|
|
405
416
|
repack,
|
|
406
417
|
repeatOptions,
|
|
418
|
+
requiredManifestVersion,
|
|
407
419
|
resizePanel,
|
|
408
420
|
resolveColor,
|
|
409
421
|
resolveFieldConfig,
|
package/dist/core/manifest.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import type { Dashboard } from './schema';
|
|
2
|
+
/**
|
|
3
|
+
* The newest config format this build can show. A manifest's `version` is the oldest format that
|
|
4
|
+
* can show it, so an app older than the config says to update rather than show it wrong.
|
|
5
|
+
*
|
|
6
|
+
* When a change means older apps would show a config wrong (a new panel or screen type, an
|
|
7
|
+
* option whose absence changes what's recorded), bump this and add a FORMAT_CHANGES entry that
|
|
8
|
+
* spots configs using it. Configs that don't use it keep working in older apps.
|
|
9
|
+
*/
|
|
2
10
|
export declare const MANIFEST_VERSION = 1;
|
|
11
|
+
/** The version a config should declare: the newest format change it uses, or 1. Editors set it when saving. */
|
|
12
|
+
export declare function requiredManifestVersion(bundle: ConfigBundle): number;
|
|
3
13
|
/** The root of an app config: navigation, plus the documents it shows. Annotations here feed schema/app.schema.json. */
|
|
4
14
|
export interface AppManifest {
|
|
5
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The oldest config format that can show this config: 1 unless it uses something newer (see
|
|
17
|
+
* MANIFEST_VERSION). An app that reads only older formats asks to be updated instead.
|
|
18
|
+
* @minimum 1
|
|
19
|
+
* @asType integer
|
|
20
|
+
*/
|
|
6
21
|
version: number;
|
|
7
22
|
/**
|
|
8
23
|
* The app's name.
|
|
@@ -66,6 +81,8 @@ export interface ConfigBundle {
|
|
|
66
81
|
}
|
|
67
82
|
export interface ConfigIssue {
|
|
68
83
|
severity: 'error' | 'warning';
|
|
84
|
+
/** Set on the error for a config newer than this build can show, so an app can ask to be updated. */
|
|
85
|
+
code?: 'newer-version';
|
|
69
86
|
/** Where in the config, e.g. `app.json: tabs[1].screen.dashboard` or `forms/daily.json: panels[3]`. */
|
|
70
87
|
path: string;
|
|
71
88
|
message: string;
|
|
@@ -196,6 +213,8 @@ export interface ConfigState {
|
|
|
196
213
|
error?: string;
|
|
197
214
|
/** True when the last fetch failed because the config couldn't be fetched at all, not because it has errors. */
|
|
198
215
|
unreachable?: boolean;
|
|
216
|
+
/** True when the last fetch got a config newer than this app can show: the app should ask to be updated. */
|
|
217
|
+
needsUpdate?: boolean;
|
|
199
218
|
/** From the last fetch, good or bad. */
|
|
200
219
|
issues: ConfigIssue[];
|
|
201
220
|
}
|