@nocobase/test 1.4.0-beta.1 → 1.4.0-beta.2

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.
@@ -0,0 +1,1600 @@
1
+ import { observer, useForm, useFieldSchema } from "@formily/react";
2
+ import MockAdapter from "axios-mock-adapter";
3
+ import _, { get, set, pick } from "lodash";
4
+ import React from "react";
5
+ import { Application, AntdSchemaComponentPlugin, SchemaSettingsPlugin, CollectionPlugin, LocalDataSource, SchemaSettings, SchemaComponent, DataBlockProvider } from "@nocobase/client";
6
+ const key = "data-source2";
7
+ const displayName = "Data Source 2";
8
+ const status = "loaded";
9
+ const type = "postgres";
10
+ const isDBInstance = true;
11
+ const collections = [
12
+ {
13
+ name: "test",
14
+ title: "test",
15
+ tableName: "test",
16
+ timestamps: false,
17
+ autoGenId: false,
18
+ filterTargetKey: "id",
19
+ fields: [
20
+ {
21
+ name: "id",
22
+ type: "integer",
23
+ allowNull: false,
24
+ primaryKey: false,
25
+ unique: false,
26
+ autoIncrement: true,
27
+ possibleTypes: [
28
+ "integer",
29
+ "sort"
30
+ ],
31
+ rawType: "INTEGER",
32
+ "interface": "integer",
33
+ uiSchema: {
34
+ type: "number",
35
+ "x-component": "InputNumber",
36
+ "x-component-props": {
37
+ stringMode: true,
38
+ step: "1"
39
+ },
40
+ "x-validator": "integer",
41
+ title: "id"
42
+ }
43
+ },
44
+ {
45
+ name: "title",
46
+ type: "string",
47
+ allowNull: false,
48
+ primaryKey: false,
49
+ unique: false,
50
+ possibleTypes: [
51
+ "string",
52
+ "uuid",
53
+ "nanoid"
54
+ ],
55
+ rawType: "CHARACTER VARYING(255)",
56
+ "interface": "input",
57
+ uiSchema: {
58
+ "x-component": "Input",
59
+ "x-component-props": {
60
+ style: {
61
+ width: "100%"
62
+ }
63
+ },
64
+ title: "title"
65
+ }
66
+ },
67
+ {
68
+ name: "content",
69
+ type: "text",
70
+ allowNull: true,
71
+ primaryKey: false,
72
+ unique: false,
73
+ rawType: "TEXT",
74
+ "interface": "textarea",
75
+ uiSchema: {
76
+ type: "string",
77
+ "x-component": "Input.TextArea",
78
+ title: "content"
79
+ }
80
+ }
81
+ ],
82
+ introspected: true
83
+ },
84
+ {
85
+ name: "test2",
86
+ title: "test2",
87
+ tableName: "test2",
88
+ timestamps: false,
89
+ autoGenId: false,
90
+ filterTargetKey: "id",
91
+ fields: [
92
+ {
93
+ name: "id",
94
+ type: "integer",
95
+ allowNull: false,
96
+ primaryKey: true,
97
+ unique: false,
98
+ autoIncrement: true,
99
+ possibleTypes: [
100
+ "integer",
101
+ "sort"
102
+ ],
103
+ rawType: "INTEGER",
104
+ "interface": "integer",
105
+ uiSchema: {
106
+ type: "number",
107
+ "x-component": "InputNumber",
108
+ "x-component-props": {
109
+ stringMode: true,
110
+ step: "1"
111
+ },
112
+ "x-validator": "integer",
113
+ title: "id"
114
+ }
115
+ },
116
+ {
117
+ name: "title",
118
+ type: "string",
119
+ allowNull: true,
120
+ primaryKey: false,
121
+ unique: false,
122
+ possibleTypes: [
123
+ "string",
124
+ "uuid",
125
+ "nanoid"
126
+ ],
127
+ rawType: "CHARACTER VARYING(255)",
128
+ "interface": "input",
129
+ uiSchema: {
130
+ "x-component": "Input",
131
+ "x-component-props": {
132
+ style: {
133
+ width: "100%"
134
+ }
135
+ },
136
+ title: "title"
137
+ }
138
+ },
139
+ {
140
+ name: "content",
141
+ type: "text",
142
+ allowNull: true,
143
+ primaryKey: false,
144
+ unique: false,
145
+ rawType: "TEXT",
146
+ "interface": "textarea",
147
+ uiSchema: {
148
+ type: "string",
149
+ "x-component": "Input.TextArea",
150
+ title: "content"
151
+ }
152
+ }
153
+ ],
154
+ introspected: true
155
+ }
156
+ ];
157
+ const dataSource2 = {
158
+ key,
159
+ displayName,
160
+ status,
161
+ type,
162
+ isDBInstance,
163
+ collections
164
+ };
165
+ const dataSourceMainCollections = [
166
+ {
167
+ key: "yzowed2vee0",
168
+ name: "users",
169
+ title: '{{t("Users")}}',
170
+ inherit: false,
171
+ hidden: false,
172
+ description: null,
173
+ fields: [
174
+ {
175
+ key: "6m3kn2pytkc",
176
+ name: "id",
177
+ type: "bigInt",
178
+ "interface": "id",
179
+ description: null,
180
+ collectionName: "users",
181
+ parentKey: null,
182
+ reverseKey: null,
183
+ autoIncrement: true,
184
+ primaryKey: true,
185
+ allowNull: false,
186
+ uiSchema: {
187
+ type: "number",
188
+ title: '{{t("ID")}}',
189
+ "x-component": "InputNumber",
190
+ "x-read-pretty": true
191
+ }
192
+ },
193
+ {
194
+ key: "8douy9r69x5",
195
+ name: "nickname",
196
+ type: "string",
197
+ "interface": "input",
198
+ description: null,
199
+ collectionName: "users",
200
+ parentKey: null,
201
+ reverseKey: null,
202
+ uiSchema: {
203
+ type: "string",
204
+ title: '{{t("Nickname")}}',
205
+ "x-component": "Input"
206
+ }
207
+ },
208
+ {
209
+ key: "vp191ptc0d7",
210
+ name: "username",
211
+ type: "string",
212
+ "interface": "input",
213
+ description: null,
214
+ collectionName: "users",
215
+ parentKey: null,
216
+ reverseKey: null,
217
+ unique: true,
218
+ uiSchema: {
219
+ type: "string",
220
+ title: '{{t("Username")}}',
221
+ "x-component": "Input",
222
+ "x-validator": {
223
+ username: true
224
+ },
225
+ required: true
226
+ }
227
+ },
228
+ {
229
+ key: "47o82qhkvdm",
230
+ name: "email",
231
+ type: "string",
232
+ "interface": "email",
233
+ description: null,
234
+ collectionName: "users",
235
+ parentKey: null,
236
+ reverseKey: null,
237
+ unique: true,
238
+ uiSchema: {
239
+ type: "string",
240
+ title: '{{t("Email")}}',
241
+ "x-component": "Input",
242
+ "x-validator": "email",
243
+ required: true
244
+ }
245
+ },
246
+ {
247
+ key: "q5i9ynhq325",
248
+ name: "phone",
249
+ type: "string",
250
+ "interface": "phone",
251
+ description: null,
252
+ collectionName: "users",
253
+ parentKey: null,
254
+ reverseKey: null,
255
+ unique: true,
256
+ uiSchema: {
257
+ type: "string",
258
+ title: '{{t("Phone")}}',
259
+ "x-component": "Input",
260
+ "x-validator": "phone",
261
+ required: true
262
+ }
263
+ },
264
+ {
265
+ key: "cc4aslvh9dv",
266
+ name: "password",
267
+ type: "password",
268
+ "interface": "password",
269
+ description: null,
270
+ collectionName: "users",
271
+ parentKey: null,
272
+ reverseKey: null,
273
+ hidden: true,
274
+ uiSchema: {
275
+ type: "string",
276
+ title: '{{t("Password")}}',
277
+ "x-component": "Password"
278
+ }
279
+ },
280
+ {
281
+ key: "e87ndyttazh",
282
+ name: "appLang",
283
+ type: "string",
284
+ "interface": null,
285
+ description: null,
286
+ collectionName: "users",
287
+ parentKey: null,
288
+ reverseKey: null
289
+ },
290
+ {
291
+ key: "snfbet0pe49",
292
+ name: "resetToken",
293
+ type: "string",
294
+ "interface": null,
295
+ description: null,
296
+ collectionName: "users",
297
+ parentKey: null,
298
+ reverseKey: null,
299
+ unique: true,
300
+ hidden: true
301
+ },
302
+ {
303
+ key: "j78yhz6wifd",
304
+ name: "systemSettings",
305
+ type: "json",
306
+ "interface": null,
307
+ description: null,
308
+ collectionName: "users",
309
+ parentKey: null,
310
+ reverseKey: null,
311
+ defaultValue: {}
312
+ },
313
+ {
314
+ key: "lkxqml8gchd",
315
+ name: "sort",
316
+ type: "sort",
317
+ "interface": null,
318
+ description: null,
319
+ collectionName: "users",
320
+ parentKey: null,
321
+ reverseKey: null,
322
+ hidden: true
323
+ },
324
+ {
325
+ key: "lt3pcrjngzc",
326
+ name: "createdById",
327
+ type: "context",
328
+ "interface": null,
329
+ description: null,
330
+ collectionName: "users",
331
+ parentKey: null,
332
+ reverseKey: null,
333
+ dataType: "bigInt",
334
+ dataIndex: "state.currentUser.id",
335
+ createOnly: true,
336
+ visible: true,
337
+ index: true
338
+ },
339
+ {
340
+ key: "lcfaf27uxyz",
341
+ name: "createdBy",
342
+ type: "belongsTo",
343
+ "interface": null,
344
+ description: null,
345
+ collectionName: "users",
346
+ parentKey: null,
347
+ reverseKey: null,
348
+ target: "users",
349
+ foreignKey: "createdById",
350
+ targetKey: "id"
351
+ },
352
+ {
353
+ key: "y6lwdb31r5t",
354
+ name: "updatedById",
355
+ type: "context",
356
+ "interface": null,
357
+ description: null,
358
+ collectionName: "users",
359
+ parentKey: null,
360
+ reverseKey: null,
361
+ dataType: "bigInt",
362
+ dataIndex: "state.currentUser.id",
363
+ visible: true,
364
+ index: true
365
+ },
366
+ {
367
+ key: "exhbmthsin0",
368
+ name: "updatedBy",
369
+ type: "belongsTo",
370
+ "interface": null,
371
+ description: null,
372
+ collectionName: "users",
373
+ parentKey: null,
374
+ reverseKey: null,
375
+ target: "users",
376
+ foreignKey: "updatedById",
377
+ targetKey: "id"
378
+ },
379
+ {
380
+ key: "s921nnlzdwi",
381
+ name: "roles",
382
+ type: "belongsToMany",
383
+ "interface": "m2m",
384
+ description: null,
385
+ collectionName: "users",
386
+ parentKey: null,
387
+ reverseKey: null,
388
+ target: "roles",
389
+ foreignKey: "userId",
390
+ otherKey: "roleName",
391
+ onDelete: "CASCADE",
392
+ sourceKey: "id",
393
+ targetKey: "name",
394
+ through: "rolesUsers",
395
+ uiSchema: {
396
+ type: "array",
397
+ title: '{{t("Roles")}}',
398
+ "x-component": "AssociationField",
399
+ "x-component-props": {
400
+ multiple: true,
401
+ fieldNames: {
402
+ label: "title",
403
+ value: "name"
404
+ }
405
+ }
406
+ }
407
+ },
408
+ {
409
+ key: "qe7b1rsct5h",
410
+ name: "jobs",
411
+ type: "belongsToMany",
412
+ "interface": null,
413
+ description: null,
414
+ collectionName: "users",
415
+ parentKey: null,
416
+ reverseKey: null,
417
+ through: "users_jobs",
418
+ foreignKey: "userId",
419
+ sourceKey: "id",
420
+ otherKey: "jobId",
421
+ targetKey: "id",
422
+ target: "jobs"
423
+ },
424
+ {
425
+ key: "vt0n1l1ruyz",
426
+ name: "usersJobs",
427
+ type: "hasMany",
428
+ "interface": null,
429
+ description: null,
430
+ collectionName: "users",
431
+ parentKey: null,
432
+ reverseKey: null,
433
+ target: "users_jobs",
434
+ foreignKey: "userId",
435
+ sourceKey: "id",
436
+ targetKey: "id"
437
+ },
438
+ {
439
+ key: "ekol7p60nry",
440
+ name: "sortName",
441
+ type: "sort",
442
+ "interface": "sort",
443
+ description: null,
444
+ collectionName: "users",
445
+ parentKey: null,
446
+ reverseKey: null,
447
+ uiSchema: {
448
+ type: "number",
449
+ "x-component": "InputNumber",
450
+ "x-component-props": {
451
+ stringMode: true,
452
+ step: "1"
453
+ },
454
+ "x-validator": "integer",
455
+ title: "sort"
456
+ }
457
+ }
458
+ ],
459
+ category: [],
460
+ origin: "@nocobase/plugin-users",
461
+ dumpRules: {
462
+ group: "user"
463
+ },
464
+ sortable: "sort",
465
+ model: "UserModel",
466
+ createdBy: true,
467
+ updatedBy: true,
468
+ logging: true,
469
+ shared: true,
470
+ from: "db2cm",
471
+ filterTargetKey: "id"
472
+ },
473
+ {
474
+ key: "rmx938ttbue",
475
+ name: "roles",
476
+ title: '{{t("Roles")}}',
477
+ inherit: false,
478
+ hidden: false,
479
+ description: null,
480
+ fields: [
481
+ {
482
+ key: "l6thu4n5u6x",
483
+ name: "name",
484
+ type: "uid",
485
+ "interface": "input",
486
+ description: null,
487
+ collectionName: "roles",
488
+ parentKey: null,
489
+ reverseKey: null,
490
+ prefix: "r_",
491
+ primaryKey: true,
492
+ uiSchema: {
493
+ type: "string",
494
+ title: '{{t("Role UID")}}',
495
+ "x-component": "Input"
496
+ }
497
+ },
498
+ {
499
+ key: "yhfq9yv8z0p",
500
+ name: "title",
501
+ type: "string",
502
+ "interface": "input",
503
+ description: null,
504
+ collectionName: "roles",
505
+ parentKey: null,
506
+ reverseKey: null,
507
+ unique: true,
508
+ uiSchema: {
509
+ type: "string",
510
+ title: '{{t("Role name")}}',
511
+ "x-component": "Input"
512
+ },
513
+ translation: true
514
+ },
515
+ {
516
+ key: "vnhjlmopfuz",
517
+ name: "description",
518
+ type: "string",
519
+ "interface": null,
520
+ description: null,
521
+ collectionName: "roles",
522
+ parentKey: null,
523
+ reverseKey: null
524
+ },
525
+ {
526
+ key: "s4iqsehgxo6",
527
+ name: "strategy",
528
+ type: "json",
529
+ "interface": null,
530
+ description: null,
531
+ collectionName: "roles",
532
+ parentKey: null,
533
+ reverseKey: null
534
+ },
535
+ {
536
+ key: "75e4wnv873m",
537
+ name: "default",
538
+ type: "boolean",
539
+ "interface": null,
540
+ description: null,
541
+ collectionName: "roles",
542
+ parentKey: null,
543
+ reverseKey: null,
544
+ defaultValue: false
545
+ },
546
+ {
547
+ key: "nofdv0gte68",
548
+ name: "hidden",
549
+ type: "boolean",
550
+ "interface": null,
551
+ description: null,
552
+ collectionName: "roles",
553
+ parentKey: null,
554
+ reverseKey: null,
555
+ defaultValue: false
556
+ },
557
+ {
558
+ key: "bogzo1uvk84",
559
+ name: "allowConfigure",
560
+ type: "boolean",
561
+ "interface": null,
562
+ description: null,
563
+ collectionName: "roles",
564
+ parentKey: null,
565
+ reverseKey: null
566
+ },
567
+ {
568
+ key: "k3fvj8ddpp9",
569
+ name: "allowNewMenu",
570
+ type: "boolean",
571
+ "interface": null,
572
+ description: null,
573
+ collectionName: "roles",
574
+ parentKey: null,
575
+ reverseKey: null
576
+ },
577
+ {
578
+ key: "v1ditqsv1uk",
579
+ name: "menuUiSchemas",
580
+ type: "belongsToMany",
581
+ "interface": null,
582
+ description: null,
583
+ collectionName: "roles",
584
+ parentKey: null,
585
+ reverseKey: null,
586
+ target: "uiSchemas",
587
+ targetKey: "x-uid",
588
+ foreignKey: "roleName",
589
+ sourceKey: "name",
590
+ otherKey: "uiSchemaXUid",
591
+ through: "rolesUischemas"
592
+ },
593
+ {
594
+ key: "ccqhlcvgnz8",
595
+ name: "resources",
596
+ type: "hasMany",
597
+ "interface": null,
598
+ description: null,
599
+ collectionName: "roles",
600
+ parentKey: null,
601
+ reverseKey: null,
602
+ target: "dataSourcesRolesResources",
603
+ sourceKey: "name",
604
+ foreignKey: "roleName",
605
+ targetKey: "id"
606
+ },
607
+ {
608
+ key: "s4fshtx7oxv",
609
+ name: "snippets",
610
+ type: "set",
611
+ "interface": null,
612
+ description: null,
613
+ collectionName: "roles",
614
+ parentKey: null,
615
+ reverseKey: null,
616
+ defaultValue: [
617
+ "!ui.*",
618
+ "!pm",
619
+ "!pm.*"
620
+ ]
621
+ },
622
+ {
623
+ key: "oyzvbhc60mp",
624
+ name: "users",
625
+ type: "belongsToMany",
626
+ "interface": null,
627
+ description: null,
628
+ collectionName: "roles",
629
+ parentKey: null,
630
+ reverseKey: null,
631
+ target: "users",
632
+ foreignKey: "roleName",
633
+ otherKey: "userId",
634
+ onDelete: "CASCADE",
635
+ sourceKey: "name",
636
+ targetKey: "id",
637
+ through: "rolesUsers"
638
+ },
639
+ {
640
+ key: "89yklh7lm3p",
641
+ name: "sort",
642
+ type: "sort",
643
+ "interface": null,
644
+ description: null,
645
+ collectionName: "roles",
646
+ parentKey: null,
647
+ reverseKey: null,
648
+ hidden: true
649
+ },
650
+ {
651
+ key: "iz5s22dinui",
652
+ name: "color",
653
+ type: "string",
654
+ "interface": "color",
655
+ description: null,
656
+ collectionName: "roles",
657
+ parentKey: null,
658
+ reverseKey: null,
659
+ defaultValue: "#1677FF",
660
+ uiSchema: {
661
+ type: "string",
662
+ "x-component": "ColorPicker",
663
+ "default": "#1677FF",
664
+ title: "color"
665
+ }
666
+ },
667
+ {
668
+ key: "o5nyb6isl62",
669
+ name: "long-text",
670
+ type: "text",
671
+ "interface": "textarea",
672
+ description: null,
673
+ collectionName: "roles",
674
+ parentKey: null,
675
+ reverseKey: null,
676
+ uiSchema: {
677
+ type: "string",
678
+ "x-component": "Input.TextArea",
679
+ title: "Long text"
680
+ }
681
+ }
682
+ ],
683
+ category: [],
684
+ origin: "@nocobase/plugin-acl",
685
+ dumpRules: "required",
686
+ autoGenId: false,
687
+ model: "RoleModel",
688
+ filterTargetKey: "name",
689
+ sortable: true,
690
+ from: "db2cm"
691
+ },
692
+ {
693
+ key: "24gntrrr5a6",
694
+ name: "tree",
695
+ title: "TreeCollection",
696
+ inherit: false,
697
+ hidden: false,
698
+ description: null,
699
+ fields: [
700
+ {
701
+ key: "pcea3h3ivkg",
702
+ name: "parentId",
703
+ type: "bigInt",
704
+ "interface": "integer",
705
+ description: null,
706
+ collectionName: "t_4uamm7v51dj",
707
+ parentKey: null,
708
+ reverseKey: null,
709
+ isForeignKey: true,
710
+ uiSchema: {
711
+ type: "number",
712
+ title: '{{t("Parent ID")}}',
713
+ "x-component": "InputNumber",
714
+ "x-read-pretty": true
715
+ },
716
+ target: "t_4uamm7v51dj"
717
+ },
718
+ {
719
+ key: "185j2rf7o68",
720
+ name: "parent",
721
+ type: "belongsTo",
722
+ "interface": "m2o",
723
+ description: null,
724
+ collectionName: "t_4uamm7v51dj",
725
+ parentKey: null,
726
+ reverseKey: null,
727
+ foreignKey: "parentId",
728
+ treeParent: true,
729
+ onDelete: "CASCADE",
730
+ uiSchema: {
731
+ title: '{{t("Parent")}}',
732
+ "x-component": "AssociationField",
733
+ "x-component-props": {
734
+ multiple: false,
735
+ fieldNames: {
736
+ label: "id",
737
+ value: "id"
738
+ }
739
+ }
740
+ },
741
+ target: "t_4uamm7v51dj",
742
+ targetKey: "id"
743
+ },
744
+ {
745
+ key: "gjvso3p9sjn",
746
+ name: "children",
747
+ type: "hasMany",
748
+ "interface": "o2m",
749
+ description: null,
750
+ collectionName: "t_4uamm7v51dj",
751
+ parentKey: null,
752
+ reverseKey: null,
753
+ foreignKey: "parentId",
754
+ treeChildren: true,
755
+ onDelete: "CASCADE",
756
+ uiSchema: {
757
+ title: '{{t("Children")}}',
758
+ "x-component": "AssociationField",
759
+ "x-component-props": {
760
+ multiple: true,
761
+ fieldNames: {
762
+ label: "id",
763
+ value: "id"
764
+ }
765
+ }
766
+ },
767
+ target: "t_4uamm7v51dj",
768
+ targetKey: "id",
769
+ sourceKey: "id"
770
+ },
771
+ {
772
+ key: "j50f3am3c88",
773
+ name: "id",
774
+ type: "bigInt",
775
+ "interface": "integer",
776
+ description: null,
777
+ collectionName: "t_4uamm7v51dj",
778
+ parentKey: null,
779
+ reverseKey: null,
780
+ autoIncrement: true,
781
+ primaryKey: true,
782
+ allowNull: false,
783
+ uiSchema: {
784
+ type: "number",
785
+ title: '{{t("ID")}}',
786
+ "x-component": "InputNumber",
787
+ "x-read-pretty": true
788
+ },
789
+ target: "t_4uamm7v51dj"
790
+ },
791
+ {
792
+ key: "9szmn2ecqgs",
793
+ name: "f_y99u3pyj0bt",
794
+ type: "string",
795
+ "interface": "input",
796
+ description: null,
797
+ collectionName: "t_4uamm7v51dj",
798
+ parentKey: null,
799
+ reverseKey: null,
800
+ uiSchema: {
801
+ type: "string",
802
+ "x-component": "Input",
803
+ title: "Single line text"
804
+ }
805
+ }
806
+ ],
807
+ category: [],
808
+ logging: true,
809
+ autoGenId: true,
810
+ createdAt: false,
811
+ createdBy: false,
812
+ updatedAt: false,
813
+ updatedBy: false,
814
+ template: "tree",
815
+ view: false,
816
+ tree: "adjacencyList",
817
+ filterTargetKey: "id"
818
+ },
819
+ {
820
+ key: "16ocj2rsg3t",
821
+ name: "interfaces",
822
+ title: "Interfaces",
823
+ inherit: false,
824
+ hidden: false,
825
+ description: null,
826
+ fields: [
827
+ {
828
+ key: "k2v39l19inp",
829
+ name: "id",
830
+ type: "bigInt",
831
+ "interface": "integer",
832
+ description: null,
833
+ collectionName: "interfaces",
834
+ parentKey: null,
835
+ reverseKey: null,
836
+ autoIncrement: true,
837
+ primaryKey: true,
838
+ allowNull: false,
839
+ uiSchema: {
840
+ type: "number",
841
+ title: '{{t("ID")}}',
842
+ "x-component": "InputNumber",
843
+ "x-read-pretty": true
844
+ }
845
+ },
846
+ {
847
+ key: "gfnqdj8sd01",
848
+ name: "createdAt",
849
+ type: "date",
850
+ "interface": "createdAt",
851
+ description: null,
852
+ collectionName: "interfaces",
853
+ parentKey: null,
854
+ reverseKey: null,
855
+ field: "createdAt",
856
+ uiSchema: {
857
+ type: "datetime",
858
+ title: '{{t("Created at")}}',
859
+ "x-component": "DatePicker",
860
+ "x-component-props": {},
861
+ "x-read-pretty": true
862
+ }
863
+ },
864
+ {
865
+ key: "3ddqrb1lle5",
866
+ name: "createdBy",
867
+ type: "belongsTo",
868
+ "interface": "createdBy",
869
+ description: null,
870
+ collectionName: "interfaces",
871
+ parentKey: null,
872
+ reverseKey: null,
873
+ target: "users",
874
+ foreignKey: "createdById",
875
+ uiSchema: {
876
+ type: "object",
877
+ title: '{{t("Created by")}}',
878
+ "x-component": "AssociationField",
879
+ "x-component-props": {
880
+ fieldNames: {
881
+ value: "id",
882
+ label: "nickname"
883
+ }
884
+ },
885
+ "x-read-pretty": true
886
+ },
887
+ targetKey: "id"
888
+ },
889
+ {
890
+ key: "9nc7gqqw0ht",
891
+ name: "updatedAt",
892
+ type: "date",
893
+ "interface": "updatedAt",
894
+ description: null,
895
+ collectionName: "interfaces",
896
+ parentKey: null,
897
+ reverseKey: null,
898
+ field: "updatedAt",
899
+ uiSchema: {
900
+ type: "string",
901
+ title: '{{t("Last updated at")}}',
902
+ "x-component": "DatePicker",
903
+ "x-component-props": {},
904
+ "x-read-pretty": true
905
+ }
906
+ },
907
+ {
908
+ key: "06wr4f2qi4w",
909
+ name: "updatedBy",
910
+ type: "belongsTo",
911
+ "interface": "updatedBy",
912
+ description: null,
913
+ collectionName: "interfaces",
914
+ parentKey: null,
915
+ reverseKey: null,
916
+ target: "users",
917
+ foreignKey: "updatedById",
918
+ uiSchema: {
919
+ type: "object",
920
+ title: '{{t("Last updated by")}}',
921
+ "x-component": "AssociationField",
922
+ "x-component-props": {
923
+ fieldNames: {
924
+ value: "id",
925
+ label: "nickname"
926
+ }
927
+ },
928
+ "x-read-pretty": true
929
+ },
930
+ targetKey: "id"
931
+ },
932
+ {
933
+ key: "g5beggm3aln",
934
+ name: "nano-iD",
935
+ type: "nanoid",
936
+ "interface": "nanoid",
937
+ description: null,
938
+ collectionName: "interfaces",
939
+ parentKey: null,
940
+ reverseKey: null,
941
+ customAlphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
942
+ size: 21,
943
+ autoFill: true,
944
+ uiSchema: {
945
+ type: "string",
946
+ "x-component": "NanoIDInput",
947
+ title: "Nano ID"
948
+ }
949
+ },
950
+ {
951
+ key: "wchbz23orvg",
952
+ name: "attachment",
953
+ type: "belongsToMany",
954
+ "interface": "attachment",
955
+ description: null,
956
+ collectionName: "interfaces",
957
+ parentKey: null,
958
+ reverseKey: null,
959
+ uiSchema: {
960
+ "x-component-props": {
961
+ accept: "image/*",
962
+ multiple: true
963
+ },
964
+ type: "array",
965
+ "x-component": "Upload.Attachment",
966
+ title: "Attachment"
967
+ },
968
+ target: "attachments",
969
+ through: "t_zj0zu7maytd",
970
+ foreignKey: "f_iek1e32gsq0",
971
+ otherKey: "f_dtc6w8dzyoo",
972
+ targetKey: "id",
973
+ sourceKey: "id"
974
+ }
975
+ ],
976
+ category: [],
977
+ logging: true,
978
+ autoGenId: true,
979
+ createdAt: true,
980
+ createdBy: true,
981
+ updatedAt: true,
982
+ updatedBy: true,
983
+ template: "general",
984
+ view: false,
985
+ filterTargetKey: "id"
986
+ }
987
+ ];
988
+ const dataSourceMainData = {
989
+ "users:list": {
990
+ data: [
991
+ {
992
+ createdAt: "2024-04-07T06:50:37.797Z",
993
+ updatedAt: "2024-04-07T06:50:37.797Z",
994
+ appLang: null,
995
+ createdById: null,
996
+ email: "admin@nocobase.com",
997
+ f_1gx8uyn3wva: 1,
998
+ id: 1,
999
+ nickname: "Super Admin",
1000
+ phone: null,
1001
+ systemSettings: {},
1002
+ updatedById: null,
1003
+ username: "nocobase",
1004
+ roles: [
1005
+ {
1006
+ createdAt: "2024-04-07T06:50:37.700Z",
1007
+ updatedAt: "2024-04-07T06:50:37.700Z",
1008
+ allowConfigure: null,
1009
+ allowNewMenu: true,
1010
+ "default": true,
1011
+ description: null,
1012
+ hidden: false,
1013
+ color: "#1677FF",
1014
+ name: "member",
1015
+ snippets: [
1016
+ "!pm",
1017
+ "!pm.*",
1018
+ "!ui.*"
1019
+ ],
1020
+ strategy: {
1021
+ actions: [
1022
+ "view",
1023
+ "update:own",
1024
+ "destroy:own",
1025
+ "create"
1026
+ ]
1027
+ },
1028
+ title: '{{t("Member")}}',
1029
+ rolesUsers: {
1030
+ createdAt: "2024-04-07T06:50:37.854Z",
1031
+ updatedAt: "2024-04-07T06:50:37.854Z",
1032
+ "default": null,
1033
+ roleName: "member",
1034
+ userId: 1
1035
+ }
1036
+ },
1037
+ {
1038
+ createdAt: "2024-04-07T06:50:37.622Z",
1039
+ updatedAt: "2024-04-07T06:50:37.622Z",
1040
+ allowConfigure: null,
1041
+ allowNewMenu: null,
1042
+ "default": false,
1043
+ description: null,
1044
+ hidden: true,
1045
+ color: "#1677FF",
1046
+ name: "root",
1047
+ snippets: [
1048
+ "pm",
1049
+ "pm.*",
1050
+ "ui.*"
1051
+ ],
1052
+ strategy: null,
1053
+ title: '{{t("Root")}}',
1054
+ rolesUsers: {
1055
+ createdAt: "2024-04-07T06:50:38.152Z",
1056
+ updatedAt: "2024-04-07T06:50:38.186Z",
1057
+ "default": true,
1058
+ roleName: "root",
1059
+ userId: 1
1060
+ }
1061
+ },
1062
+ {
1063
+ createdAt: "2024-04-07T06:50:37.657Z",
1064
+ updatedAt: "2024-04-07T06:50:37.657Z",
1065
+ allowConfigure: true,
1066
+ allowNewMenu: true,
1067
+ "default": false,
1068
+ description: null,
1069
+ hidden: false,
1070
+ name: "admin",
1071
+ color: "#1677FF",
1072
+ snippets: [
1073
+ "pm",
1074
+ "pm.*",
1075
+ "ui.*"
1076
+ ],
1077
+ strategy: {
1078
+ actions: [
1079
+ "create",
1080
+ "view",
1081
+ "update",
1082
+ "destroy"
1083
+ ]
1084
+ },
1085
+ title: '{{t("Admin")}}',
1086
+ rolesUsers: {
1087
+ createdAt: "2024-04-07T06:50:38.152Z",
1088
+ updatedAt: "2024-04-07T06:50:38.152Z",
1089
+ "default": null,
1090
+ roleName: "admin",
1091
+ userId: 1
1092
+ }
1093
+ }
1094
+ ]
1095
+ }
1096
+ ],
1097
+ meta: {
1098
+ count: 1,
1099
+ page: 1,
1100
+ pageSize: 20,
1101
+ totalPage: 1,
1102
+ allowedActions: {
1103
+ view: [
1104
+ 1
1105
+ ],
1106
+ update: [
1107
+ 1
1108
+ ],
1109
+ destroy: []
1110
+ }
1111
+ }
1112
+ },
1113
+ "users:get": {
1114
+ data: {
1115
+ createdAt: "2024-04-07T06:50:37.797Z",
1116
+ updatedAt: "2024-04-07T06:50:37.797Z",
1117
+ appLang: null,
1118
+ createdById: null,
1119
+ email: "admin@nocobase.com",
1120
+ f_1gx8uyn3wva: 1,
1121
+ id: 1,
1122
+ nickname: "Super Admin",
1123
+ phone: null,
1124
+ systemSettings: {},
1125
+ updatedById: null,
1126
+ username: "nocobase",
1127
+ roles: [
1128
+ {
1129
+ createdAt: "2024-04-07T06:50:37.700Z",
1130
+ updatedAt: "2024-04-07T06:50:37.700Z",
1131
+ allowConfigure: null,
1132
+ allowNewMenu: true,
1133
+ "default": true,
1134
+ description: null,
1135
+ hidden: false,
1136
+ color: "#1677FF",
1137
+ name: "member",
1138
+ snippets: [
1139
+ "!pm",
1140
+ "!pm.*",
1141
+ "!ui.*"
1142
+ ],
1143
+ strategy: {
1144
+ actions: [
1145
+ "view",
1146
+ "update:own",
1147
+ "destroy:own",
1148
+ "create"
1149
+ ]
1150
+ },
1151
+ title: '{{t("Member")}}',
1152
+ rolesUsers: {
1153
+ createdAt: "2024-04-07T06:50:37.854Z",
1154
+ updatedAt: "2024-04-07T06:50:37.854Z",
1155
+ "default": null,
1156
+ roleName: "member",
1157
+ userId: 1
1158
+ }
1159
+ },
1160
+ {
1161
+ createdAt: "2024-04-07T06:50:37.622Z",
1162
+ updatedAt: "2024-04-07T06:50:37.622Z",
1163
+ allowConfigure: null,
1164
+ allowNewMenu: null,
1165
+ "default": false,
1166
+ description: null,
1167
+ hidden: true,
1168
+ color: "#1677FF",
1169
+ name: "root",
1170
+ snippets: [
1171
+ "pm",
1172
+ "pm.*",
1173
+ "ui.*"
1174
+ ],
1175
+ strategy: null,
1176
+ title: '{{t("Root")}}',
1177
+ rolesUsers: {
1178
+ createdAt: "2024-04-07T06:50:38.152Z",
1179
+ updatedAt: "2024-04-07T06:50:38.186Z",
1180
+ "default": true,
1181
+ roleName: "root",
1182
+ userId: 1
1183
+ }
1184
+ },
1185
+ {
1186
+ createdAt: "2024-04-07T06:50:37.657Z",
1187
+ updatedAt: "2024-04-07T06:50:37.657Z",
1188
+ allowConfigure: true,
1189
+ allowNewMenu: true,
1190
+ "default": false,
1191
+ description: null,
1192
+ hidden: false,
1193
+ name: "admin",
1194
+ color: "#1677FF",
1195
+ snippets: [
1196
+ "pm",
1197
+ "pm.*",
1198
+ "ui.*"
1199
+ ],
1200
+ strategy: {
1201
+ actions: [
1202
+ "create",
1203
+ "view",
1204
+ "update",
1205
+ "destroy"
1206
+ ]
1207
+ },
1208
+ title: '{{t("Admin")}}',
1209
+ rolesUsers: {
1210
+ createdAt: "2024-04-07T06:50:38.152Z",
1211
+ updatedAt: "2024-04-07T06:50:38.152Z",
1212
+ "default": null,
1213
+ roleName: "admin",
1214
+ userId: 1
1215
+ }
1216
+ }
1217
+ ]
1218
+ }
1219
+ },
1220
+ "roles:list": {
1221
+ data: [
1222
+ {
1223
+ createdAt: "2024-04-07T06:50:37.622Z",
1224
+ updatedAt: "2024-04-07T06:50:37.622Z",
1225
+ allowConfigure: null,
1226
+ allowNewMenu: null,
1227
+ "default": false,
1228
+ description: null,
1229
+ hidden: true,
1230
+ name: "root",
1231
+ color: "#1677FF",
1232
+ snippets: [
1233
+ "pm",
1234
+ "pm.*",
1235
+ "ui.*"
1236
+ ],
1237
+ strategy: null,
1238
+ title: '{{t("Root")}}'
1239
+ },
1240
+ {
1241
+ createdAt: "2024-04-07T06:50:37.657Z",
1242
+ updatedAt: "2024-04-07T06:50:37.657Z",
1243
+ allowConfigure: true,
1244
+ allowNewMenu: true,
1245
+ "default": false,
1246
+ description: null,
1247
+ hidden: false,
1248
+ color: "#1677FF",
1249
+ name: "admin",
1250
+ snippets: [
1251
+ "pm",
1252
+ "pm.*",
1253
+ "ui.*"
1254
+ ],
1255
+ strategy: {
1256
+ actions: [
1257
+ "create",
1258
+ "view",
1259
+ "update",
1260
+ "destroy"
1261
+ ]
1262
+ },
1263
+ title: '{{t("Admin")}}'
1264
+ },
1265
+ {
1266
+ createdAt: "2024-04-07T06:50:37.700Z",
1267
+ updatedAt: "2024-04-07T06:50:37.700Z",
1268
+ allowConfigure: null,
1269
+ allowNewMenu: true,
1270
+ "default": true,
1271
+ description: null,
1272
+ color: "#1677FF",
1273
+ hidden: false,
1274
+ name: "member",
1275
+ snippets: [
1276
+ "!pm",
1277
+ "!pm.*",
1278
+ "!ui.*"
1279
+ ],
1280
+ strategy: {
1281
+ actions: [
1282
+ "view",
1283
+ "update:own",
1284
+ "destroy:own",
1285
+ "create"
1286
+ ]
1287
+ },
1288
+ title: '{{t("Member")}}'
1289
+ }
1290
+ ],
1291
+ meta: {
1292
+ count: 3,
1293
+ page: 1,
1294
+ pageSize: 20,
1295
+ totalPage: 1,
1296
+ allowedActions: {
1297
+ view: [
1298
+ "root",
1299
+ "admin",
1300
+ "member"
1301
+ ],
1302
+ update: [
1303
+ "root",
1304
+ "admin",
1305
+ "member"
1306
+ ],
1307
+ destroy: []
1308
+ }
1309
+ }
1310
+ },
1311
+ "roles:get": {
1312
+ data: {
1313
+ createdAt: "2024-04-07T06:50:37.622Z",
1314
+ updatedAt: "2024-04-07T06:50:37.622Z",
1315
+ allowConfigure: null,
1316
+ allowNewMenu: null,
1317
+ "default": false,
1318
+ description: null,
1319
+ hidden: true,
1320
+ name: "root",
1321
+ color: "#1677FF",
1322
+ snippets: [
1323
+ "pm",
1324
+ "pm.*",
1325
+ "ui.*"
1326
+ ],
1327
+ strategy: null,
1328
+ title: '{{t("Root")}}'
1329
+ }
1330
+ },
1331
+ "tree:list": {
1332
+ data: [
1333
+ {
1334
+ id: 1,
1335
+ parentId: null,
1336
+ f_y99u3pyj0bt: "1"
1337
+ },
1338
+ {
1339
+ id: 2,
1340
+ parentId: 1,
1341
+ f_y99u3pyj0bt: "2"
1342
+ }
1343
+ ],
1344
+ meta: {
1345
+ count: 2,
1346
+ page: 1,
1347
+ pageSize: 20,
1348
+ totalPage: 1,
1349
+ allowedActions: {
1350
+ view: [
1351
+ 1,
1352
+ 2
1353
+ ],
1354
+ update: [
1355
+ 1,
1356
+ 2
1357
+ ],
1358
+ destroy: [
1359
+ 1,
1360
+ 2
1361
+ ]
1362
+ }
1363
+ }
1364
+ }
1365
+ };
1366
+ const sleep = async (timeout = 0) => {
1367
+ return new Promise((resolve) => {
1368
+ setTimeout(resolve, timeout);
1369
+ });
1370
+ };
1371
+ const defaultApis = {
1372
+ "uiSchemas:patch": { data: { result: "ok" } },
1373
+ "uiSchemas:batchPatch": { data: { result: "ok" } },
1374
+ "uiSchemas:saveAsTemplate": { data: { result: "ok" } },
1375
+ "users:update": { data: { result: "ok" } },
1376
+ "roles:update": { data: { result: "ok" } },
1377
+ ...dataSourceMainData
1378
+ };
1379
+ function getProcessMockData(apis, key2) {
1380
+ if (typeof apis[key2] === "function") {
1381
+ return apis[key2];
1382
+ }
1383
+ return (config) => {
1384
+ var _a, _b;
1385
+ if (!apis[key2])
1386
+ return [404, { data: { message: "mock data not found" } }];
1387
+ if (((_a = config == null ? void 0 : config.params) == null ? void 0 : _a.pageSize) || ((_b = config == null ? void 0 : config.params) == null ? void 0 : _b.page)) {
1388
+ const { data, meta } = apis[key2];
1389
+ const pageSize = config.params.pageSize || (meta == null ? void 0 : meta.pageSize) || 20;
1390
+ const page = config.params.page || (meta == null ? void 0 : meta.page) || 1;
1391
+ return [
1392
+ 200,
1393
+ {
1394
+ data: data.slice(pageSize * (page - 1), pageSize * page),
1395
+ meta: {
1396
+ ...meta,
1397
+ page,
1398
+ pageSize,
1399
+ count: data.length,
1400
+ totalPage: Math.ceil(data.length / pageSize)
1401
+ }
1402
+ }
1403
+ ];
1404
+ }
1405
+ return [200, apis[key2]];
1406
+ };
1407
+ }
1408
+ const mockApi = (axiosInstance, apis = {}, delayResponse) => {
1409
+ const mock = new MockAdapter(axiosInstance, { delayResponse });
1410
+ Object.keys(apis).forEach((key2) => {
1411
+ mock.onAny(key2).reply(getProcessMockData(apis, key2));
1412
+ });
1413
+ return (apis2 = {}) => {
1414
+ Object.keys(apis2).forEach((key2) => {
1415
+ mock.onAny(key2).reply(getProcessMockData(apis2, key2));
1416
+ });
1417
+ };
1418
+ };
1419
+ const mockAppApi = (app, apis = {}, delayResponse) => {
1420
+ const mock = mockApi(app.apiClient.axios, apis, delayResponse);
1421
+ return mock;
1422
+ };
1423
+ const ShowFormData = observer(({ children }) => {
1424
+ const form = useForm();
1425
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("pre", { style: { marginBottom: 20 }, "data-testid": "form-data" }, JSON.stringify(form.values, null, 2)), children);
1426
+ });
1427
+ const getApp = (options) => {
1428
+ const {
1429
+ appOptions = {},
1430
+ schemaSettings,
1431
+ providers,
1432
+ disableAcl = true,
1433
+ apis: optionsApis = {},
1434
+ enableMultipleDataSource,
1435
+ designable,
1436
+ delayResponse
1437
+ } = options;
1438
+ const app = appOptions instanceof Application ? appOptions : new Application({
1439
+ ...appOptions,
1440
+ disableAcl: appOptions.disableAcl || disableAcl,
1441
+ designable: appOptions.designable || designable
1442
+ });
1443
+ if (providers) {
1444
+ app.addProviders(providers);
1445
+ }
1446
+ if (schemaSettings) {
1447
+ app.schemaSettingsManager.add(schemaSettings);
1448
+ }
1449
+ app.addComponents({ CommonSchemaComponent, ShowFormData });
1450
+ app.pluginManager.add(AntdSchemaComponentPlugin);
1451
+ app.pluginManager.add(SchemaSettingsPlugin);
1452
+ app.pluginManager.add(CollectionPlugin, { config: { enableRemoteDataSource: false } });
1453
+ const apis = Object.assign({}, defaultApis, optionsApis);
1454
+ app.getCollectionManager().addCollections(dataSourceMainCollections);
1455
+ if (enableMultipleDataSource) {
1456
+ app.dataSourceManager.addDataSource(LocalDataSource, dataSource2);
1457
+ }
1458
+ mockAppApi(app, apis, delayResponse);
1459
+ const App = app.getRootComponent();
1460
+ return {
1461
+ App,
1462
+ app
1463
+ };
1464
+ };
1465
+ const getAppComponent = (options) => {
1466
+ const {
1467
+ schema: optionsSchema = {},
1468
+ Component,
1469
+ value,
1470
+ props,
1471
+ onChange,
1472
+ noWrapperSchema,
1473
+ enableUserListDataBlock,
1474
+ ...otherOptions
1475
+ } = options;
1476
+ if (noWrapperSchema) {
1477
+ const { App: App2 } = getApp(options);
1478
+ return App2;
1479
+ }
1480
+ const schema = {
1481
+ type: "object",
1482
+ name: "test",
1483
+ default: value,
1484
+ "x-component": Component,
1485
+ "x-component-props": {
1486
+ onChange,
1487
+ ...props
1488
+ },
1489
+ ...optionsSchema
1490
+ };
1491
+ if (!schema.name) {
1492
+ schema.name = "test";
1493
+ }
1494
+ if (!schema["x-uid"]) {
1495
+ schema["x-uid"] = "test";
1496
+ }
1497
+ if (!schema.type) {
1498
+ schema.type = "void";
1499
+ }
1500
+ const TestDemo = () => {
1501
+ if (!enableUserListDataBlock) {
1502
+ return /* @__PURE__ */ React.createElement(SchemaComponent, { schema });
1503
+ }
1504
+ return /* @__PURE__ */ React.createElement(DataBlockProvider, { collection: "users", action: "list" }, /* @__PURE__ */ React.createElement(SchemaComponent, { schema }));
1505
+ };
1506
+ const { App } = getApp({
1507
+ ...otherOptions,
1508
+ providers: [TestDemo]
1509
+ });
1510
+ return App;
1511
+ };
1512
+ function addXReadPrettyToEachLayer(obj = {}) {
1513
+ obj["x-read-pretty"] = true;
1514
+ _.forOwn(obj, (value, key2) => {
1515
+ if (_.isObject(value)) {
1516
+ addXReadPrettyToEachLayer(value);
1517
+ }
1518
+ });
1519
+ return obj;
1520
+ }
1521
+ const getReadPrettyAppComponent = (options) => {
1522
+ return getAppComponent({ ...options, schema: addXReadPrettyToEachLayer(options.schema) });
1523
+ };
1524
+ function setSchemaWithSettings(options) {
1525
+ const { Component, settingPath } = options;
1526
+ const SINGLE_SETTINGS_NAME = "testSettings";
1527
+ const testSettings = new SchemaSettings({
1528
+ name: SINGLE_SETTINGS_NAME,
1529
+ items: [
1530
+ {
1531
+ name: "test",
1532
+ Component
1533
+ }
1534
+ ]
1535
+ });
1536
+ if (!options.schema) {
1537
+ options.schema = {};
1538
+ }
1539
+ if (settingPath) {
1540
+ const schema = get(options.schema, settingPath);
1541
+ schema["x-settings"] = SINGLE_SETTINGS_NAME;
1542
+ } else {
1543
+ options.schema["x-settings"] = SINGLE_SETTINGS_NAME;
1544
+ }
1545
+ if (!options.appOptions) {
1546
+ options.appOptions = {};
1547
+ }
1548
+ if (options.appOptions instanceof Application) {
1549
+ options.appOptions.schemaSettingsManager.add(testSettings);
1550
+ } else {
1551
+ if (!options.appOptions.schemaSettings) {
1552
+ options.appOptions.schemaSettings = [];
1553
+ }
1554
+ options.appOptions.schemaSettings.push(testSettings);
1555
+ }
1556
+ }
1557
+ const getAppComponentWithSchemaSettings = (options) => {
1558
+ setSchemaWithSettings(options);
1559
+ const App = getAppComponent(options);
1560
+ return App;
1561
+ };
1562
+ const getReadPrettyAppComponentWithSchemaSettings = (options) => {
1563
+ setSchemaWithSettings(options);
1564
+ set(options.schema, "x-read-pretty", true);
1565
+ const App = getAppComponent(options);
1566
+ return App;
1567
+ };
1568
+ function withSchema(Component, name) {
1569
+ const ComponentValue = observer((props) => {
1570
+ const schema = useFieldSchema();
1571
+ const schemaValue = pick(schema.toJSON(), [
1572
+ "title",
1573
+ "description",
1574
+ "enum",
1575
+ "x-component-props",
1576
+ "x-decorator-props",
1577
+ "x-linkage-rules"
1578
+ ]);
1579
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("pre", { "data-testid": name ? `test-schema-${name}` : `test-schema` }, JSON.stringify(schemaValue, void 0, 2)), /* @__PURE__ */ React.createElement(Component, { ...props }));
1580
+ });
1581
+ ComponentValue.displayName = `withSchema(${Component.displayName || Component.name})`;
1582
+ return ComponentValue;
1583
+ }
1584
+ const CommonSchemaComponent = withSchema(function CommonSchemaComponent2(props) {
1585
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, props.children);
1586
+ });
1587
+ export {
1588
+ CommonSchemaComponent,
1589
+ addXReadPrettyToEachLayer,
1590
+ getApp,
1591
+ getAppComponent,
1592
+ getAppComponentWithSchemaSettings,
1593
+ getReadPrettyAppComponent,
1594
+ getReadPrettyAppComponentWithSchemaSettings,
1595
+ mockApi,
1596
+ mockAppApi,
1597
+ setSchemaWithSettings,
1598
+ sleep,
1599
+ withSchema
1600
+ };