-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
1675 lines (1626 loc) · 88.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>MiniApp Manifest</title>
<link rel="stylesheet" href="./local.css" />
<style>
.two-cols {
display: grid;
grid-template-columns: 1fr 1fr;
}
table.members {
border: 1px #f0f0f0 solid;
margin-bottom: 1em;
width: 100%;
}
table.members th:nth-child(1),
table.members td:nth-child(1) {
width: 11rem;
}
table.members th:nth-child(2),
table.members td:nth-child(2) {
width: 5rem;
}
table.members thead tr,
table.members tr:nth-child(even) {
background-color: #f0f0f0;
}
td, th {
padding:2px 15px;
}
</style>
<script defer class="remove" src="https://www.w3.org/Tools/respec/respec-w3c"></script>
<!-- <script defer src="https://w3c.github.io/miniapp/specs/script.js"></script> -->
<script class="remove">
var respecConfig = {
specStatus: "ED",
copyrightStart: "2021",
edDraftURI: "https://w3c.github.io/miniapp-manifest/",
shortName: "miniapp-manifest",
editors: [{
name: "Martin Alvarez-Espinar",
companyURL: "https://www.huawei.com/",
company: "Huawei",
w3cid: 125049,
}, {
name: "Yongjing Zhang",
companyURL: "https://www.huawei.com/",
company: "Huawei",
w3cid: 75048,
}],
formerEditors: [{
name: "Shouren Lan",
companyURL: "https://www.huawei.com/",
company: "Huawei",
w3cid: 119736,
}, {
name: "Zhiqiang Yu",
companyURL: "https://www.huawei.com/",
company: "Huawei",
w3cid: 102877,
}, {
name: "Xiaofeng Zhang",
companyURL: "https://www.huawei.com/",
company: "Huawei",
w3cid: 111840,
}],
group: "wg/miniapps",
github: {
repoURL: "https://github.com/w3c/miniapp-manifest",
branch: "main",
},
localBiblio: {
"SEMANTIC-VERSIONING": {
title: 'Semantic Versioning',
href: 'https://semver.org/'
},
},
a11y: true,
xref: "web-platform",
};
</script>
</head>
<body data-cite="APPMANIFEST MINIAPP-PACKAGING MANIFEST-APP-INFO INFRA URL HTML WEBIDL">
<section id='abstract'>
<p>
This specification is a registry of supplementary members for the <a href="https://www.w3.org/TR/appmanifest/">Web Application Manifest</a> and the <a href="https://www.w3.org/TR/manifest-app-info/">Web App Manifest - Application Information</a> specifications that provide additional metadata to an application manifest to describe [=MiniApps=]. This JSON-based manifest file enables developers to set up basic information of a MiniApp, like identification, human-readable description, versioning data, and styling information. The MiniApp manifest also configures the routing of the pages and widgets that are part of a MiniApp.
</p>
</section>
<section id='sotd'>
<!--p id="langSwitch">
<button onclick="switchLang('zh-hans')" lang="zh-hans">简体中文</button>
<button onclick="switchLang('en')" lang="en">English</button>
<button onclick="switchLang('all')" lang="en">All</button>
</p-->
</section>
<section>
<h2>MiniApp Manifest</h2>
<p>
A <dfn data-export="" data-lt="MiniApp manifest's|manifest">MiniApp manifest</dfn> is a [[JSON]] document that extends and profiles the Web App Manifest [[APPMANIFEST]] and the Web App Manifest - Application Information [[MANIFEST-APP-INFO]], to describe metadata associated with a MiniApp.
</p>
<p class="note">
This specification defines the set of metadata to describe MiniApps, extending the [[[APPMANIFEST]]] and the [[[MANIFEST-APP-INFO]]] by providing additional constraints and specific mechanisms to describe and set up MiniApps. The MiniApp Manifest directly reuses essential elements from these specifications (i.e., `name`, `short_name`, `description`, and `icons`), adding supplementary members that specifically affect MiniApps (e.g., `app_id`, `version`, `platform_version`, `device_type`, `pages`, `req_permissions`, and `widgets`) and their look and feel (e.g., `color_scheme` and `window`).
</p>
<section id="manifest-conformance" data-cite="IMAGE-RESOURCE">
<h3>Conformance</h3>
<p>
A [=MiniApp manifest=] MUST contain the following members at its root:
</p>
<ul>
<li>
<code>[=app_id=]</code>
</li>
<li>
<code>[=icons=]</code>
</li>
<li>
<code>[=MiniApp manifest/name=]</code>
</li>
<li>
<code>[=pages=]</code>
</li>
<li>
<code>[=MiniApp manifest/platform_version=]</code>
</li>
<li>
<code>[=version=]</code>
</li>
</ul>
<p>
Each [=image resource=] object within the [=MiniApp manifest's=] <code>[=icons=]</code> member MUST contain:
</p>
<ul>
<li>
<a href="https://www.w3.org/TR/image-resource/#dfn-src" data-type="dfn" data-link-type="dfn"><code>src</code></a>
</li>
</ul>
<p>
A [=MiniApp manifest=] MAY contain a <code>[=widgets=]</code> member at its root. This member MUST contain an array ([=list=]) of [=MiniApp widget resources=]. Each [=MiniApp widget resource=] object MUST contain the following members:
</p>
<ul>
<li>
<code>[=MiniApp widget resource/name=]</code>
</li>
<li>
<code>[=path=]</code>
</li>
</ul>
<p>
A [=MiniApp manifest=] MAY contain a <code>[=req_permissions=]</code> member at its root. This member MUST contain an array ([=list=]) of [=MiniApp permission resources=]. Each [=MiniApp permission resource=] object MUST contain the following member:
</p>
<ul>
<li>
<code>[=MiniApp permission resource/name=]</code>
</li>
</ul>
<p>MiniApp user agents MAY implement vendor-specific extensions of the [=manifest=], supporting optional members.</p>
</section>
<section data-cite="IMAGE-RESOURCE">
<h3>Summary of Members</h3>
<p>
The following table shows a summary of the [=MiniApp manifest's=] members:
</p>
<table class="members">
<caption>Members at root</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>[=app_id=]</code></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>MiniApp identifier</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=color_scheme=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>MiniApp color scheme</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=description=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>MiniApp description</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=device_type=]</code></th>
<td> [=list=] </td>
<td>No</td>
<td>
<span>Supporting devices</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=dir=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Direction of texts</span>
</td>
</tr>
<tr data-cite="IMAGE-RESOURCE">
<th scope="row"><code>[=icons=]</code></th>
<td> [=image resource=] [=list=] </td>
<td>Yes</td>
<td>
<span>MiniApp icons</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=lang=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>MiniApp primary language</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp manifest/name=]</code></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>MiniApp name</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=pages=]</code></th>
<td> [=list=] </td>
<td>Yes</td>
<td>
<span>Page routing information</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp manifest/platform_version=]</code></th>
<td> [=platform version resource=] </td>
<td>Yes</td>
<td>
<span>Platform version supported</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=req_permissions=]</code></th>
<td> [=permission resource=] [=list=] </td>
<td>No</td>
<td> <span>Required permissions</span></td>
</tr>
<tr>
<th scope="row"><code>[=short_name=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>MiniApp short name</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=version=]</code></th>
<td> [=version resource=] </td>
<td>Yes</td>
<td>
<span>MiniApp version</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=widgets=]</code></th>
<td> [=widget resource=] [=list=] </td>
<td>No</td>
<td> <span>MiniApp widgets</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=window=]</code></th>
<td> [=window resource=] </td>
<td>No</td>
<td>
<span>Window style</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=image resource=] objects<br/>(<code>[=icons=]</code> [=list=])</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><a href="https://www.w3.org/TR/image-resource/#dfn-label" data-link-type="dfn"><code>label</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Accessible text</span>
</td>
</tr>
<tr>
<th scope="row"><a href="https://www.w3.org/TR/image-resource/#dfn-sizes" data-type="dfn" data-link-type="dfn"><code>sizes</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Resolution sizes of an icon</span>
</td>
</tr>
<tr>
<th scope="row"><a href="https://www.w3.org/TR/image-resource/#dfn-src" data-type="dfn" data-link-type="dfn"><code>src</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Source of an icon</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=platform version resource=] objects<br/>(<code>[=platform_version=]</code> [=ordered map=])</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>[=MiniApp platform version resource/min_code=]</code></th>
<td> number </td>
<td>Yes</td>
<td>
<span>Minimum platform version supported</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp platform version resource/release_type=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Target platform version type</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp platform version resource/target_code=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Target platform version code</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=permission resource=] objects<br/>(<code>[=req_permissions=]</code> [=list=])</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>[=MiniApp permission resource/name=]</code></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Permission name</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=reason=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Reason to request the permission</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=version resource=] objects<br/>(<code>[=version=]</code> [=ordered map=])</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>[=MiniApp version resource/code=]</code></th>
<td> number </td>
<td>Yes</td>
<td>
<span>Version code</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp version resource/name=]</code></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Version name</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=widget resource=] objects<br/>(<code>[=widgets=]</code> [=list=])</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>[=MiniApp widget resource/min_code=]</code></th>
<td> number </td>
<td>No</td>
<td>
<span>Minimum platform version supported</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp widget resource/name=]</code></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Widget name</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=path=]</code></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Widget path</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=window resource=] objects<br/>(<code>[=window=]</code> [=ordered map=])</caption>
<thead>
<tr>
<th scope="col">Member</th>
<th scope="col">Type</th>
<th scope="col">Required</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>[=auto_design_width=]</code></th>
<td> [=boolean=] </td>
<td>No</td>
<td>
<span>Enables/disables auto-calculation of page's <code>[=design_width=]</code> </span>
</td>
</tr>
<tr>
<th scope="row"><code>[=MiniApp window resource/background_color=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Window background color</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=background_text_style=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Background text style</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=design_width=]</code></th>
<td> number </td>
<td>No</td>
<td>
<span>The baseline page design width</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=enable_pull_down_refresh=]</code></th>
<td> [=boolean=] </td>
<td>No</td>
<td>
<span>Enable pull-to-refresh event</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=fullscreen=]</code></th>
<td> [=boolean=] </td>
<td>No</td>
<td>
<span>Full screen display</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=navigation_bar_background_color=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Navigation bar background color</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=navigation_bar_text_style=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Text style of the navigation bar</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=navigation_bar_title_text=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Navigation bar title</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=navigation_style=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Navigation bar style</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=on_reach_bottom_distance=]</code></th>
<td> number </td>
<td>No</td>
<td>
<span>Distance for pull-up bottom event triggering</span>
</td>
</tr>
<tr>
<th scope="row"><code>[=orientation=]</code></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Screen orientation settings</span>
</td>
</tr>
</tbody>
</table>
<p class="note">
Other [=application manifest=] members such as <a href="https://www.w3.org/TR/appmanifest/#scope-member"><code>scope</code></a>,
<a href="https://www.w3.org/TR/appmanifest/#theme_color-member"><code>theme_color</code></a>, and
<a href="https://www.w3.org/TR/appmanifest/#shortcuts-member"><code>shortcuts</code></a> are not currently supported by MiniApp user agents.
</p>
</section>
<section class='informative' id="sec-example">
<h2>Example</h2>
<p>
The following code represents a [=MiniApp manifest=] example:
</p>
<pre class="example json" title="Manifest document">
{
"dir": "ltr",
"lang": "en-US",
"app_id": "org.example.miniapp",
"name": "MiniApp Demo",
"short_name": "MiniApp",
"version": {
"name": "1.0.1",
"code": 11
},
"description": "A Simple MiniApp Demo",
"icons": [
{
"label": "Red lightning",
"src": "common/icons/icon.png",
"sizes": "48x48"
}
],
"platform_version":{
"min_code": 1,
"release_type": "Beta1",
"target_code": 2
},
"pages": [
"pages/index/index",
"pages/detail/detail"
],
"window": {
"background_color": "#ffffff",
"fullscreen": false,
"navigation_bar_text_style": "black",
"navigation_bar_title_text": "My MiniApp",
"navigation_bar_background_color": "#f8f8f8"
},
"widgets": [
{
"name": "widget",
"min_code": "2",
"path": "widgets/index/index"
}
],
"req_permissions": [
{
"name": "system.permission.LOCATION",
"reason": "To show user's position on the map"
},
{
"name": "system.permission.CAMERA",
"reason": "To scan a QR code"
}
],
"color_scheme": "light",
"device_type": [
"phone",
"tv",
"car"
]
}
</pre>
</section>
<section id='webappmanifest-members'>
<h2>Web Application Manifest members</h2>
<p>The [=MiniApp manifest=] uses the following essential [=application manifest=]'s members.</p>
<section>
<h3><code>dir</code> member</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>dir</dfn></code> member, while specifying the base direction of the [=localizable members=] of the [=manifest=], also specifies
the default base text direction of the whole MiniApp.</p>
<p>The <code>[=dir=]</code> member's value can be set to one of the <a href="https://www.w3.org/TR/appmanifest/#dfn-text-directions">text-directions</a> as specified in [[APPMANIFEST]]. The text-direction values are the following:</p>
<dl>
<dt>"<code><a href="https://www.w3.org/TR/appmanifest/#dfn-ltr" data-type="dfn" data-link-type="dfn">ltr</a></code>"</dt>
<dd>Left-to-right text.</dd>
<dt>"<code><a href="https://www.w3.org/TR/appmanifest/#dfn-rtl" data-type="dfn" data-link-type="dfn">rtl</a></code>"</dt>
<dd>Right-to-left text.</dd>
<dt>"<code><a href="https://www.w3.org/TR/appmanifest/#dfn-auto" data-type="dfn" data-link-type="dfn">auto</a></code>" (default)</dt>
<dd>No explicit directionality.</dd>
</dl>
<p class="note" title="Processing the `dir` member">
When [=processing a MiniApp manifest=], the <a href="https://www.w3.org/TR/appmanifest/#dfn-process-the-dir-member" data-link-type="dfn">process the <code>dir</code> member</a> algorithm is used to process the <code>dir</code> member, according to the [[APPMANIFEST]] specification.
</p>
</section>
<section data-cite="IMAGE-RESOURCE HTML">
<h3>
<span><code>icons</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>icons</dfn></code> member describes images that serve as iconic representations of MiniApps. This member is a [=list=] of [=image resource=] [=ordered maps=].
</p>
<p>As specified in [[IMAGE-RESOURCE]], an [=image resource=] consists of:</p>
<dl>
<dt>
<dt><code><a href="https://www.w3.org/TR/image-resource/#dfn-label" data-link-type="dfn">label</a></code></dt>
<dd>
An optional [=string=] representing the accessible name of the image.
</dd>
<dt><code><a href="https://www.w3.org/TR/image-resource/#dfn-sizes" data-type="dfn" data-link-type="dfn">sizes</a></code></dt>
<dd>
An optional [=string=] representing the sizes of the image, expressed using the same syntax as [^link^]'s [^link/sizes^] attribute.
</dd>
<dt><code><a href="https://www.w3.org/TR/image-resource/#dfn-src" data-type="dfn" data-link-type="dfn">src</a></code></dt>
<dd>A <a data-link-type="dfn" data-type="dfn" href="https://url.spec.whatwg.org/#concept-url">URL</a> from where to obtain the image data.</dd>
</dl>
<p class="note" title="Processing the `icons` member">
When [=processing a MiniApp manifest=], the <a href="https://www.w3.org/TR/appmanifest/#dfn-process-image-resources" data-link-type="dfn">process image resources</a> algorithm is used to process the <code>icons</code> member, according to the [[APPMANIFEST]] specification.
</p>
<p class="note" title="Accessibility considerations">
Developers are strongly encouraged to add a `label` unless the [=image resource=]’s accessible name can be inferred from an external label in its context.
</p>
</section>
<section>
<h3>
<span><code>lang</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>lang</dfn></code> member, while specifying the primary language of the [=localizable members=], also specifies
the primary language of the whole MiniApp. This member is a [=string=] in the form of a <a href="https://www.w3.org/TR/appmanifest/#dfn-language-tag" data-link-type="dfn">language tag</a>, a string that matches the production of a <code>Language-Tag</code> [[BCP47]], as defined in [[APPMANIFEST]].
</p>
<p class="note" title="Processing the `lang` member">
When [=processing a MiniApp manifest=], the <a href="https://www.w3.org/TR/appmanifest/#dfn-process-the-lang-member" data-link-type="dfn">process the <code>lang</code> member</a> algorithm is used to process the <code>lang</code> member, according to the [[APPMANIFEST]] specification.
</p>
</section>
<section>
<h3>
<span><code>name</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <dfn data-dfn-for="MiniApp manifest"><code>name</code></dfn> member is the descriptive name of the application. This is the name directly displayed to the user. It is used as the display name of MiniApp along with the desktop icon and in the context of MiniApp management.
</p>
<p class="note" title="Processing the `name` member">
When [=processing a MiniApp manifest=], the <a href="https://www.w3.org/TR/appmanifest/#dfn-process-a-text-member" data-link-type="dfn">process a text member</a> algorithm is used to process the <code>name</code> member, according to the [[APPMANIFEST]] specification.
</p>
</section>
<section>
<h3>
<span><code>short_name</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>short_name</dfn></code> member provides a concise and easy-to-read name for a MiniApp. It can be used when there is insufficient space to display the full MiniApp name provided in <code>[=MiniApp manifest/name=]</code>.
</p>
<p class="note" title="Processing the `short_name` member">
When [=processing a MiniApp manifest=], the <a href="https://www.w3.org/TR/appmanifest/#dfn-process-a-text-member" data-link-type="dfn">process a text member</a> algorithm is used to process the <code>short_name</code> member, according to the [[APPMANIFEST]] specification.
</p>
</section>
</section>
<section id='webappmanifest-app-info-members' data-cite='MANIFEST-APP-INFO'>
<h2>Application Information members</h2>
<p>
The following member is defined in the Web App Manifest - Application Information specification [[MANIFEST-APP-INFO]].
</p>
<section>
<h3>
<span><code>description</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>description</dfn></code> member provides a textual description for the MiniApp representing the purpose of the web application in natural language, as defined in [[MANIFEST-APP-INFO]]
</p>
<p>
To <dfn>process the <code>description</code> member</dfn>, given [=ordered map=] |json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["description"] is not a [=string=], return.</li>
<li>Set |manifest|["description"] to |json|["description"].</li>
</ol>
</section>
</section>
<section id='supplementary-manifest-members' data-cite="MINIAPP-PACKAGING">
<h2>Supplementary members</h2>
<p>
The following members are defined under the scope of the [=MiniApp manifest=], addressing specific aspects of MiniApp.
</p>
<section>
<h3>
<span><code>app_id</code> member</span>
</h3>
<p data-cite="i18n-glossary">
The [=MiniApp manifest's=] <code><dfn>app_id</dfn></code> member is a [=string=] that identifies the MiniApp uniquely. This member is mainly used for package management, supporting the update and release process of MiniApp versioning.
</p>
<p>
The value of <code>[=app_id=]</code> is both case-sensitive and sensitive to different ways of encoding characters in Unicode. Consequently, two <code>[=app_id=]</code> values are equal only if they are encoded as the same sequence of <a href="https://www.w3.org/TR/i18n-glossary/#dfn-unicode-code-point" data-link-type="dfn">code points</a>.
</p>
<div class="note" title='Usage'>
<p>
One common practice for MiniApps is to use the reverse-domain-name-like convention used by the <a href="https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html">Java package naming convention</a> (e.g., <code>org.example.miniapp</code>) under the following rule:
</p>
<pre class="abnf">
appIdRule = name *("." name)
name = ALPHA [*( ALPHA / DIGIT / "-" ) ( ALPHA / DIGIT)]
</pre>
</div>
<p>
To <dfn>process the <code>app_id</code> member</dfn>, given [=ordered map=] |json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["app_id"] does not [=map/exist=], or if |json|["app_id"] is not a [=string=], return.</li>
<li>Set |manifest|["app_id"] to |json|["app_id"].</li>
</ol>
</section>
<section>
<h3>
<span><code>color_scheme</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <code><dfn>color_scheme</dfn></code> member is a [=string=] that indicates the preferred color scheme of a MiniApp (i.e., "[=color_scheme/`auto`=]", "[=color_scheme/`light`=], or "[=color_scheme/`dark`=]"), overriding other configuration members of the [=window resource=] object, including <code>[=MiniApp window resource/background_color=]</code>, <code>[=background_text_style=]</code>, <code>[=navigation_bar_text_style=]</code>, and <code>[=navigation_bar_title_text=]</code>.
</p>
<p>
This member MUST contain one of the following <dfn>color scheme values</dfn>:
</p>
<dl>
<dt>"<dfn data-dfn-for="color_scheme"><code>auto</code></dfn>"</dt>
<dd>The theme color is adapted to the system theme color.</dd>
<dt>"<dfn data-dfn-for="color_scheme"><code>light</code></dfn>"</dt>
<dd>For a light color scheme.</dd>
<dt>"<dfn data-dfn-for="color_scheme"><code>dark</code></dfn>"</dt>
<dd>For a dark color scheme.</dd>
</dl>
<p class="note" title='Usage' data-cite="MEDIAQUERIES-5">
MiniApp user agents MAY implement pre-defined styling resources, such as background colors, cover images, and icons for each color scheme. Also, developers MAY define customized stylesheets for each mode, using the <a data-xref-type="css-descriptor" data-xref-for="@media">prefers-color-scheme</a> CSS media feature [[MEDIAQUERIES-5]].
</p>
<p>
To <dfn>process the <code>color_scheme</code> member</dfn>, given [=ordered map=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["color_scheme"] does not [=map/exist=],<br>
or if |json|["color_scheme"] is not a [=string=], <br>
or if |json|["color_scheme"] doesn't match one of the [=color scheme values=], return.</li>
<li>Set |manifest|["color_scheme"] to |json|["color_scheme"].</li>
</ol>
</section>
<section>
<h3>
<span><code>device_type</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <code><dfn>device_type</dfn></code> member is a [=list=] of [=strings=] that indicates the type of devices on which the MiniApp is intended to run. The values of this member inform user agents if the MiniApp has been designed to properly run on specific platforms like smartphones, smart TVs, car head units, wearables, and other devices.
</p>
<p>
This member is used for device compatibility verification during the initialization process. By checking its value, the user agent decides if the MiniApp is suitable to be run on the platform in terms of compatibility of UI components, CSS support, and APIs. MiniApp user agents decide how to implement the platform's behavior if the verification process fails (e.g., stopping the initialization phase and refusing the installation or installing the MiniApp but rejecting the execution).
</p>
<p class="note" title='Usage'>
The list of possible values of the member is not specified in this document, enabling flexibility in the implementation and considering any device and use case. Some of the common values are: <code>smartphone</code>, <code>tablet</code>, <code>tv</code>, <code>car</code>, <code>wearable</code>, and <code>iot</code>.
</p>
<p>
To <dfn>process the <code>device_type</code> member</dfn>, given [=ordered map=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["device_type"] does not [=map/exist=], or if |json|["device_type"] is not a [=list=], return.</li>
<li>Let |device_type:list| be a new empty [=list=].</li>
<li>[=list/For each=] |item:string| of |json|["device_type"]:
<ol>
<li>If |item| is not a [=string=], return.</li>
<li>[=list/Append=] |item| to |device_type|.</li>
</ol>
</li>
<li>Set |manifest|["device_type"] to |device_type|.</li>
</ol>
</section>
<section>
<h3>
<span><code>pages</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn data-export="">pages</dfn></code> member is a [=list=] of [=relative-url string=] used for specifying the collection of pages that are part of a MiniApp. Each item in the [=list=] represents a page identified by its [=page route=].
</p>
<p>
A <dfn data-lt="route|page route|page routes" id="dfn-page-route" data-export="">MiniApp page route</dfn> is the relative path and filename of a <a data-link-type="dfn" href="https://www.w3.org/TR/miniapp-packaging/#dfn-page">MiniApp page</a>. When configuring the [=page routes=], developers MAY omit the extension of the file that defines the main component of the <a data-link-type="dfn" href="https://www.w3.org/TR/miniapp-packaging/#dfn-page">page</a> (e.g., <samp>pages/mypage</samp> or <samp>pages/mypage.html</samp>).
</p>
<p>
The first item in the <code>[=pages=]</code> [=list=] defines the homepage or entry point of a MiniApp.
</p>
<div class="note" title="Usage" data-cite="APPMANIFEST">
<p>
For compatibility with the Web platform, it is RECOMMENDED to use <code>[=pages=]</code> along with the Web application manifest's <code>[=manifest/start_url=]</code> and <code>[=manifest/scope=]</code> members. These members will be set with the following values:
</p>
<ul>
<li><code>[=manifest/start_url=]</code> SHOULD be set with the same value of the first item in the <code>[=pages=]</code> member; and</li>
<li><code>[=manifest/scope=]</code> SHOULD be set with the value "<code>.</code>".</li>
</ul>
</div>
<p>
To <dfn>process the <code>pages</code> member</dfn>, given [=ordered map=] |json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["pages"] does not [=map/exist=], or if |json|["pages"] is not a [=list=], return.</li>
<li>Let |pages| be a new [=list=].</li>
<li>[=list/For each=] |item:string| of |json|["pages"]:
<ol>
<li>If |item| is not a [=string=], return.</li>
<li>Let |url:URL| be the result of [=URL Parser|parsing=] |item|.</li>
<li>If |url| is failure, [=iteration/continue=].</li>
<li>[=list/Append=] |pages| to |url|.</li>
</ol>
</li>
<li>Set |manifest|["pages"] to |pages|.</li>
</ol>
</section>
<section>
<h3>
<span><code>platform_version</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>platform_version</dfn></code> member contains a [=MiniApp platform version resource=] [=ordered map=] for describing the minimum requirements and intended platform version to run a MiniApp, including <code>[=MiniApp platform version resource/min_code=]</code>, <code>[=MiniApp platform version resource/target_code=]</code>, and <code>[=MiniApp platform version resource/release_type=]</code>.
</p>
<p>
To <dfn>process the <code>platform_version</code> member</dfn>, given [=ordered map=] |json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["platform_version"] does not [=map/exist=], or if |json|["platform_version"] is not an [=ordered map=], return.</li>
<li>Let |platform_version:ordered map| be a new [=ordered map=].</li>
<li><a>Process the platform version's <code>min_code</code> member</a> passing |json|["platform_version"] and |platform_version|.</li>
<li><a>Process the platform version's <code>target_code</code> member</a> passing |json|["platform_version"] and |platform_version|.</li>
<li><a>Process the platform version's <code>release_type</code> member</a> passing |json|["platform_version"] and |platform_version|.</li>
<li>If |platform_version|["min_code"] does not [=map/exist=], return failure.</li>
<li>Set |manifest|["platform_version"] to |platform_version|.</li>
</ol>
</section>
<section>
<h3>
<span><code>req_permissions</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <code><dfn>req_permissions</dfn></code> member is a [=list=] of [=MiniApp permission resources=] [=ordered map=].
</p>
<p>
Each [=MiniApp permission resource=]</code> declares a request for using a concrete system feature (e.g., access to device's location, user contacts, sensors, and camera) required for the proper execution of a MiniApp.
</p>
<p>
To <dfn>process the <code>req_permissions</code> member</dfn>, given [=ordered map=] |json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["req_permissions"] does not [=map/exist=], or if |json|["req_permissions"] is not a [=list=], return.</li>
<li>Let |permissions:list| be a new [=list=].</li>
<li>[=list/For each=] |item:ordered map| of |json|["req_permissions"]:
<ol>
<li>If |item| is not an [=ordered map=], [=iteration/continue=].</li>
<li>Let |permission:ordered map| be an [=ordered map=].</li>
<li><a>Process the permission resource's <code>name</code> member</a> passing |item| and |permission|.</li>
<li>If |permission|["name"] does not [=map/exist=], [=iteration/continue=].</li>
<li><a>Process the permission resource's <code>reason</code> member</a> passing |item| and |permission|.</li>
<li>[=list/Append=] |permission| to |permissions|.</li>
</ol>
</li>
<li>Set |manifest|["req_permissions"] to |permissions|.</li>
</ol>
<p class="note" title="Protection of user's privacy">
User agents will ask for the user's consent to protect their privacy during access to these specific features. This information in the <code>[=req_permissions=]</code> member may be used by app stores or hosting platforms to filter MiniApps according to the user's preferences, privacy policy, or device capabilities.
</p>
</section>
<section>
<h3>
<span><code>version</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <code><dfn>version</dfn></code> member contains a [=MiniApp version resource=]</code> [=ordered map=] to represent the <code>[=MiniApp version resource/code=]</code> and <code>[=MiniApp version resource/name=]</code>.
</p>
<p>
To <dfn>process the <code>version</code> member</dfn>, given [=ordered map=] |json:ordered map| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["version"] does not [=map/exist=], or if |json|["version"] is not [=ordered map=], return.</li>
<li>Let |version:ordered map| be a new [=ordered map=].</li>
<li><a>Process the version's <code>code</code> member</a> passing |json|["version"] and |version|.</li>
<li><a>Process the version's <code>name</code> member</a> passing |json|["version"] and |version|.</li>
<li>Set |manifest|["version"] to |version|.</li>
</ol>
</section>
<section>
<h3>
<span><code>widgets</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <code><dfn>widgets</dfn></code> member is a [=list=] of [=MiniApp widget resources=] that are a part of a MiniApp.
</p>
<p>
A <a data-link-type="dfn" href="https://www.w3.org/TR/miniapp-packaging/#dfn-package">MiniApp Package</a> MAY include <a data-link-type="dfn" href="https://www.w3.org/TR/miniapp-packaging/#dfn-page">MiniApp pages</a> and Widgets concurrently.
</p>
<p>
A widget, as part of a MiniApp, applies some of the members of the [=MiniApp manifest=], including:
</p>
<ul>
<li><code>[=dir=]</code>;</li>
<li><code>[=lang=]</code>;</li>
<li><code>[=app_id=]</code>;</li>
<li><code>[=MiniApp manifest/name=]</code>;</li>
<li><code>[=short_name=]</code>;</li>