forked from w3c/miniapp-manifest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1413 lines (1377 loc) · 69.7 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 async 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/'
},
"MINIAPP-LIFECYCLE": {
title: "MiniApp Lifecycle",
href: "https://w3c.github.io/miniapp-lifecycle/"
},
"MINIAPP-PACKAGING": {
title: "MiniApp Packaging",
href: "https://w3c.github.io/miniapp-packaging/"
},
},
a11y: true,
};
</script>
</head>
<body data-cite="APPMANIFEST MINIAPP-PACKAGING MANIFEST-APP-INFO INFRA URL HTML">
<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 <a href="https://w3c.github.io/miniapp-packaging/#dfn-miniapp" data-link-type="dfn">MiniApps</a>. This JSON-based manifest file enables developers to set up basic information, window style, page route, and other information of a MiniApp. The manifest also includes information about the window style like the navigation bar, title, window background color, page routing information, and the 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 manifests">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>
<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>
<a><code>app_id</code></a>
</li>
<li>
<a><code>icons</code></a>
</li>
<li>
<a data-link-for="MiniApp manifest" data-link-type="dfn"><code>name</code></a>
</li>
<li>
<a><code>version_name</code></a>
</li>
<li>
<a><code>version_code</code></a>
</li>
<li>
<a data-link-for="MiniApp manifest" data-link-type="dfn"><code>min_platform_version</code></a>
</li>
<li>
<a><code>pages</code></a>
</li>
</ul>
<p>
Each [=image resource=] object within the [=MiniApp manifest's=] <a><code>icons</code></a> 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 <a><code>widgets</code></a> member at its root. This member MUST contain an [=array=] of <a>MiniApp widget resources</a>. Each [=MiniApp widget resource=] object MUST contain the following members:
</p>
<ul>
<li>
<a data-link-for="MiniApp widget resource" data-link-type="dfn"><code>name</code></a>
</li>
<li>
<a><code>path</code></a>
</li>
</ul>
<p>
A [=MiniApp manifest=] MAY contain a <a><code>req_permissions</code></a> member at its root. This member MUST contain an [=array=] of <a>MiniApp permission resources</a>. Each [=MiniApp permission resource=] object MUST contain the following member:
</p>
<ul>
<li>
<a data-link-for="MiniApp permission resource" data-link-type="dfn"><code>name</code></a>
</li>
</ul>
<p>The presence of other members in a [=MiniApp manifest=] is optional, but vendor-specific extensions MAY modify this.</p>
<p>
As the [=application manifest=] is JSON, this specification relies on the [[JSON]] specification. This specification includes members typed as <dfn>number</dfn>, <dfn>boolean</dfn> literals, <dfn>object</dfn>,
<dfn>array</dfn>, and <dfn>string</dfn>.
</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"><a><code>app_id</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Identifier</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>description</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Description</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>dir</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Direction of texts</span>
</td>
</tr>
<tr data-cite="IMAGE-RESOURCE">
<th scope="row"><a><code>icons</code></a></th>
<td> [=image resource=] [=array=] </td>
<td>Yes</td>
<td>
<span>MiniApp icons</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>lang</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Primary language</span>
</td>
</tr>
<tr>
<th scope="row"><a data-link-for="MiniApp manifest" data-link-type="dfn"><code>min_platform_version</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Minimum platform version supported</span>
</td>
</tr>
<tr>
<th scope="row"><a data-link-for="MiniApp manifest" data-link-type="dfn"><code>name</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>App name</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>pages</code></a></th>
<td> [=array=] </td>
<td>Yes</td>
<td>
<span>Page routing information</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>req_permissions</code></a></th>
<td> <a>permission resource</a> [=array=] </td>
<td>No</td>
<td> <span>Required permissions</span></td>
</tr>
<tr>
<th scope="row"><a><code>short_name</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>MiniApp short name</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>version_code</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Version code</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>version_name</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Version name</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>widgets</code></a></th>
<td> <a>widget resource</a> [=array=] </td>
<td>No</td>
<td> <span>Widgets</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>window</code></a></th>
<td> <a>window resource</a> </td>
<td>No</td>
<td>
<span>Window style</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=image resource=] objects<br/>(<a><code>icons</code></a> array)</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 the 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 the icon</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=permission resource=] objects<br/>(<a><code>req_permissions</code></a> array)</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 data-link-for="MiniApp permission resource" data-link-type="dfn"><code>name</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Permission name</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>reason</code></a></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 [=widget resource=] objects<br/>(<a><code>widgets</code></a> array)</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 data-link-for="MiniApp widget resource" data-link-type="dfn"><code>name</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Widget name</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>path</code></a></th>
<td> [=string=] </td>
<td>Yes</td>
<td>
<span>Widget path</span>
</td>
</tr>
<tr>
<th scope="row"><a data-link-for="MiniApp widget resource" data-link-type="dfn"><code>min_platform_version</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Minimum platform version supported</span>
</td>
</tr>
</tbody>
</table>
<table class="members">
<caption>Members of [=window resource=] objects<br/>(<a><code>window</code></a> object)</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><code>auto_design_width</code></a></th>
<td> [=boolean=] </td>
<td>No</td>
<td>
<span>Enables/disables auto-calculation of page's <a><code>design_width</code></a> </span>
</td>
</tr>
<tr>
<th scope="row"><a data-link-for="MiniApp window resource" data-link-type="dfn"><code>background_color</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Window background color</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>background_text_style</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Background text style</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>design_width</code></a></th>
<td> [=number=] </td>
<td>No</td>
<td>
<span>The baseline page design width</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>enable_pull_down_refresh</code></a></th>
<td> [=boolean=] </td>
<td>No</td>
<td>
<span>Enable pull-to-refresh event</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>fullscreen</code></a></th>
<td> [=boolean=] </td>
<td>No</td>
<td>
<span>Full screen display</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>navigation_bar_background_color</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Navigation bar background color</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>navigation_bar_text_style</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Text style of the navigation bar</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>navigation_bar_title_text</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Navigation bar title</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>navigation_style</code></a></th>
<td> [=string=] </td>
<td>No</td>
<td>
<span>Navigation bar style</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>on_reach_bottom_distance</code></a></th>
<td> [=number=] </td>
<td>No</td>
<td>
<span>Distance for pull-up bottom event triggering</span>
</td>
</tr>
<tr>
<th scope="row"><a><code>orientation</code></a></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>,
<a href="https://www.w3.org/TR/appmanifest/#related_applications-member"><code>related_applications</code></a>,
<a href="https://www.w3.org/TR/appmanifest/#prefer_related_applications-member"><code>prefer_related_applications</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",
"version_code": 11,
"description": "A Simple MiniApp Demo",
"icons": [
{
"src": "common/icons/icon.png",
"sizes": "48x48"
}
],
"min_platform_version": "1.0.0",
"pages": [
"pages/index/index",
"pages/detail/detail"
],
"window": {
"navigation_bar_text_style": "black",
"navigation_bar_title_text": "My MiniApp",
"navigation_bar_background_color": "#f8f8f8",
"background_color": "#ffffff",
"fullscreen": false
},
"widgets": [
{
"name": "widget",
"path": "widgets/index/index",
"min_platform_version": "2.0.0"
}
],
"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"
}
]
}
</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=] <dfn><code>dir</code></dfn> member, while specifying the base direction of the <a>localizable members</a> of the [=manifest=], also specifies
the default base text direction of the whole MiniApp.</p>
<p>The <a><code>dir</code></a> member's value can be set to one of the <a href="https://www.w3.org/TR/appmanifest/#dfn-text-direction-values">text-direction values</a> as specified in [[APPMANIFEST]]. The text-direction values are the following:</p>
<dl>
<dt><a href="https://www.w3.org/TR/appmanifest/#dfn-ltr" data-type="dfn" data-link-type="dfn"><code>"ltr"</code></a></dt>
<dd>Left-to-right text.</dd>
<dt><a href="https://www.w3.org/TR/appmanifest/#dfn-rtl" data-type="dfn" data-link-type="dfn"><code>"rtl"</code></a></dt>
<dd>Right-to-left text.</dd>
<dt><a href="https://www.w3.org/TR/appmanifest/#dfn-auto" data-type="dfn" data-link-type="dfn"><code>"auto"</code></a> (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=] <dfn><code>icons</code></dfn> member describes images that serve as iconic representations of MiniApps. This member is an [=array=] of [=image resource=] objects.
</p>
<p>As specified in [[IMAGE-RESOURCE]], an [=image resource=] consists of:</p>
<dl>
<dt>
<dt><a href="https://www.w3.org/TR/image-resource/#dfn-label" data-link-type="dfn"><code>label</code></a></dt>
<dd>
An optional [=string=] representing the accessible name of the image.
</dd>
<dt><a href="https://www.w3.org/TR/image-resource/#dfn-sizes" data-type="dfn" data-link-type="dfn"><code>sizes</code></a></dt>
<dd>
An optional [=string=] representing the sizes of the image, expressed using the same syntax as [^link^]'s [^link/sizes^] attribute.
</dd>
<dt><a href="https://www.w3.org/TR/image-resource/#dfn-src" data-type="dfn" data-link-type="dfn"><code>src</code></a></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>
</section>
<section>
<h3>
<span><code>lang</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <dfn><code>lang</code></dfn> member, while specifying the primary language of the <a>localizable members</a>, 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=] <dfn><code>short_name</code></dfn> 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 <a data-link-for="MiniApp manifest" data-link-type="dfn"><code>name</code></a>.
</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=] <dfn><code>description</code></dfn> 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 [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If the type of |json|["description"] is not [=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>
The [=MiniApp manifest's=] <dfn><code>app_id</code></dfn> member is a [=string=] that identifies the MiniApp univocally. This member is mainly used for package management, and it supports the update and release process of MiniApp versioning.
</p>
<p>
The format of <a><code>app_id</code></a> is RECOMMENDED to be a [=string=] defined by the following rule:
</p>
<pre class="abnf">
appIdRule = name *("." name)
name = ALPHA [*( ALPHA / DIGIT / "-" ) ( ALPHA / DIGIT)]
</pre>
<p class="note" title='Usage'>
One common practice is to use the reverse-domain-name-like convention (e.g., <code>org.example.miniapp</code>).
</p>
<p>
To <dfn>process the <code>app_id</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["app_id"] does not [=map/exist=], or if the type of |json|["app_id"] is not [=string=], return failure.</li>
<li>Set |manifest|["app_id"] to |json|["app_id"].</li>
</ol>
</section>
<section>
<h3>
<span><code>min_platform_version</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <dfn data-dfn-for="MiniApp manifest"><code>min_platform_version</code></dfn> member is a [=string=] that indicates the minimum supported version of the MiniApp user agent's platform to ensure the regular operation of a MiniApp (e.g., <code>"1.0.0"</code>).
</p>
<p class="note" title='Usage'>
The RECOMMENDED format for this member is <code>"X.Y.Z"</code>, where <code>X</code>, <code>Y</code>, and <code>Z</code> are non-negative integer values (e.g., <samp>"1.10.0"</samp>), as specified in <cite>Semantic Versioning</cite> [[SEMANTIC-VERSIONING]].
</p>
<p>
To <dfn>process the <code>min_platform_version</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["min_platform_version"] does not [=map/exist=], or if the type of |json|["min_platform_version"] is not [=string=], return failure.</li>
<li>Set |manifest|["min_platform_version"] to |json|["min_platform_version"].</li>
</ol>
</section>
<section>
<h3>
<span><code>pages</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <dfn><code>pages</code></dfn> member is an [=array=] of [=relative-url string=] used for specifying the collection of pages that are part of a MiniApp. Each item in the array represents a [=page route=].
</p>
<p>
A <dfn data-lt="page route|page routes">MiniApp page route</dfn> is the relative path and filename of a MiniApp Page.
</p>
<p>
During the MiniApp development process, adding or deleting <a data-link-type="dfn" href="https://w3c.github.io/miniapp-packaging/#dfn-page">MiniApp pages</a> is done by configuring the array. When configuring the [=page routes=], the file name extension MAY be omitted (e.g., <samp>/component/mypage</samp>).
</p>
<p>
The first item in the <a><code>pages</code></a> array defines the homepage of a MiniApp.
</p>
<div class="note" title="Usage">
<p>
For compatibility with the Web platform, it is RECOMMENDED to use <a><code>pages</code></a> along with the Web application manifest's <a href="https://www.w3.org/TR/appmanifest/#start_url-member" data-link-type="dfn"><code>start_url</code></a> and <a href="https://www.w3.org/TR/appmanifest/#scope-member" data-link-type="dfn"><code>scope</code></a> members. These members will be set with the following values:
</p>
<ul>
<li><a href="https://www.w3.org/TR/appmanifest/#start_url-member" data-link-type="dfn">start_url</a> SHOULD be set with the same value of the first item in the <a><code>pages</code></a> member; and</li>
<li><a href="https://www.w3.org/TR/appmanifest/#scope-member" data-link-type="dfn">scope</a> SHOULD be set with the value <code>"."</code>.</li>
</ul>
</div>
<p>
To <dfn>process the <code>pages</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["pages"] does not [=map/exist=], or if the type of |json|["pages"] is not [=list=], return failure.</li>
<li>Let |pages| be a new [=list=].</li>
<li>[=list/For each=] |item:string| of |json|["pages"]:
<ol>
<li>If the type of |item| is not [=string=], return.</li>
<li>Let |url:URL| be the result of [=URL Parser|parsing=] |item|.</li>
<li>If |url| is failure, continue.</li>
<li>[=list/Append=] |pages| to |url|.</li>
</ol>
</li>
<li>Set |manifest|["pages"] to |pages|.</li>
</ol>
</section>
<section>
<h3>
<span><code>req_permissions</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <dfn><code>req_permissions</code></dfn> member is an [=array=] of [=MiniApp permission resources=] objects.
</p>
<p>
Each <a>MiniApp permission resource</a> 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 the MiniApp.
</p>
<p>
To <dfn>process the <code>req_permissions</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["req_permissions"] does not [=map/exist=], or if the type of |json|["req_permissions"] is not [=list=], return.</li>
<li>Let |permissions:list| be a new [=list=].</li>
<li>[=list/For each=] |item:object| of |json|["req_permissions"]:
<ol>
<li>If the type of |item| is not [=object=], return failure.</li>
<li>Let |permission| be an [=ordered map=].</li>
<li><a>Process the permission resource's <code>name</code> member</a> passing |item| and |permission|.</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 <a><code>req_permissions</code></a> 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</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <dfn><code>version_code</code></dfn> member is a non-negative integer [=number=] that represents the version of a MiniApp. It is mainly used for enhancing the maintainability and security of MiniApp (e.g., compatibility among incremental versions). The <a><code>version_code</code></a> member aims at supporting the development and deployment process, and it is not usually displayed to the end-user.
</p>
<p>
Value by default: <code>1</code>.
</p>
<div class="note" title='Usage'>
<p>
The value of this member is usually incremented according to the version iteration process.
</p>
</div>
<p>
To <dfn>process the <code>version_code</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["version_name"] does not [=map/exist=], or if the type of |json|["version_code"] is not [=number=], return failure.</li>
<li>Let |version:number| be a [=number=], initially 1.</li>
<li>If |json|["version_code"] is greater than 0, then: <br/>
Set |version| to |json|["version_code"].</li>
<li>Set |manifest|["version_code"] to |version|.</li>
</ol>
</section>
<section>
<h3>
<span><code>version_name</code> member</span>
</h3>
<p>
The [=MiniApp manifest's=] <dfn><code>version_name</code></dfn> member is a [=string=] mainly used for describing information on the version of a MiniApp, playing an essential role in version control, MiniApp application, and platform compatibility. It is usually considered as the version that is shown publicly and displayed to the user.
</p>
<p class="note" title='Usage'>
The RECOMMENDED format for this member is <code>X.Y.Z</code>, where <code>X</code>, <code>Y</code>, and <code>Z</code> are non-negative integer values (e.g., <samp>1.10.0</samp>), as specified in <cite>Semantic Versioning</cite> [[SEMANTIC-VERSIONING]].
</p>
<p>
To <dfn>process the <code>version_name</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["version_name"] does not [=map/exist=], or if the type of |json|["version_name"] is not [=string=], return failure.</li>
<li>Set |manifest|["version_name"] to |json|["version_name"].</li>
</ol>
</section>
<section>
<h3>
<span><code>widgets</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <dfn><code>widgets</code></dfn> member is an [=array=] of [=MiniApp widget resources=] that are a part of a MiniApp.
</p>
<p>
A <a data-link-type="dfn" href="https://w3c.github.io/miniapp-packaging/#dfn-package">MiniApp Package</a> MAY include <a data-link-type="dfn" href="https://w3c.github.io/miniapp-packaging/#dfn-page">MiniApp pages</a> and Widgets concurrently.
</p>
<p>
A widget, as part of a MiniApp, adopt some of the members of the [=MiniApp manifest=], including:
</p>
<ul>
<li><a><code>dir</code></a>;</li>
<li><a><code>lang</code></a>;</li>
<li><a><code>app_id</code></a>;</li>
<li><a data-link-for="MiniApp manifest" data-link-type="dfn"><code>name</code></a>;</li>
<li><a><code>short_name</code></a>;</li>
<li><a><code>icons</code></a>;</li>
<li><a><code>version_name</code></a>; and</li>
<li><a><code>version_code</code></a></li>
</ul>
<p>
However, a widget also has its exclusive fields as defined in the <a>MiniApp widget resource</a>.
</p>
<p>
To <dfn>process the <code>widgets</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["widgets"] does not [=map/exist=], or if the type of |json|["widgets"] is not [=list=], return.</li>
<li>Let |widgets:list| be a new empty [=list=].</li>
<li>[=list/For each=] |item:object| of |json|["widgets"]:
<ol>
<li>If the type of |item| is not [=object=], return failure.</li>
<li>Let |widget| be an [=ordered map=].</li>
<li><a>Process the widget's <code>name</code> member</a> passing |item| and |widget|.</li>
<li><a>Process the widget's <code>path</code> member</a> passing |item| and |widget|.</li>
<li><a>Process the widget's <code>min_platform_version</code> member</a> passing |item|, |manifest|, and |widget|.</li>
<li>If |widget|["name"] does not [=map/exist=], or if |item|["path"] does not [=map/exist=], return failure.</li>
<li>[=list/Append=] |widget| to |widgets|.</li>
</ol>
</li>
<li>Set |manifest|["widgets"] to |widgets|.</li>
</ol>
</section>
<section>
<h3>
<span><code>window</code> member</span>
</h3>
<p>
The optional [=MiniApp manifest's=] <dfn><code>window</code></dfn> member contains a <a>MiniApp window resource</a> [=object=] to describe the look and feel of the MiniApp frame, including the styles of the status bar, navigation bar, title, background colors, among other visual configuration elements.
</p>
<p>
The <a><code>window</code></a> object members inherit the text direction and language configuration from the <a><code>dir</code></a> and <a><code>lang</code></a> members at the root of the [=MiniApp manifest=].
</p>
<p>
To <dfn>process the <code>window</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["window"] does not [=map/exist=], or if the type of |json|["window"] is not [=object=], return.</li>
<li>Let |window:ordered map| be a new [=ordered map=] «[ "auto_design_width" → false, "background_color" → "#ffffff", "background_text_style" → "dark", "design_width" → 750, "enable_pull_down_refresh" → false, "fullscreen" → "false", "navigation_bar_background_color" → "#000000", "navigation_bar_text_style" → "white", "navigation_bar_title_text" → "default", "on_reach_bottom_distance" → 50, "orientation" → "portrait" ]».</li>
<li><a>Process the window's <code>auto_design_width</code> member</a> passing |json|["window"] and |window|.</li>
<li><a href="https://www.w3.org/TR/appmanifest/#dfn-process-a-color-member" data-link-type="dfn">Process a color member</a> passing |json|["window"], |window| and "background_color".</li>
<li><a>Process the window's <code>design_width</code> member</a> passing |json|["window"] and |window|.</li>
<li><a>Process the window's <code>enable_pull_down_refresh</code> member</a> passing |json|["window"] and |window|.</li>
<li><a>Process the window's <code>fullscreen</code> member</a> passing |json|["window"] and |window|.</li>
<li><a href="https://www.w3.org/TR/appmanifest/#dfn-process-a-color-member" data-link-type="dfn">Process a color member</a> passing |json|["window"], |window| and "navigation_bar_background_color".</li>
<li><a>Process the window's <code>navigation_bar_text_style</code> member</a> passing |json|["window"] and |window|.</li>
<li><a>Process the window's <code>navigation_bar_title_text</code> member</a> passing |json|["window"] and |window|.</li>
<li><a>Process the window's <code>on_reach_bottom_distance</code> member</a> passing |json|["window"] and |window|.</li>
<li><a>Process the window's <code>orientation</code> member</a> passing |json|["window"] and |window|.</li>
<li><a>Process the window's <code>auto_design_width</code> member</a> passing |json|["window"] and |window|.</li>
<li>Set |manifest|["window"] to |window|.</li>
</ol>
</section>
</section>
<section id="processing" data-cite="APPMANIFEST">
<h3>Processing the manifest</h3>
<p>
The MiniApp manifest, as an extension of the [=Application manifest=], provides a supplementary algorithm to be processed at the <a href="https://www.w3.org/TR/appmanifest/#dfn-extension-point">extension point</a> of the <a href="https://www.w3.org/TR/appmanifest/#dfn-processing-a-manifest" data-link-type="dfn">processing a manifest</a> algorithm defined in [[APPMANIFEST]].
</p>
<p>
To <dfn data-lt="processing a MiniApp manifest">process a MiniApp manifest</dfn>, given [=object=] |json:JSON| and [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li><a>Process the <code>app_id</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>description</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>min_platform_version</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>pages</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>req_permissions</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>version_code</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>version_name</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>widgets</code> member</a> passing |json| and |manifest|.</li>
<li><a>Process the <code>window</code> member</a> passing |json| and |manifest|.</li>
</ol>
</section>
</section>
<section id="sec-permission-resources">
<h2>MiniApp permission resources</h2>
<p>
A <dfn data-lt="permission resource|MiniApp permission resources|MiniApp permission resource's">MiniApp permission resource</dfn> is an [=object=] that describes 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>
The following members are defined under the scope of the [=MiniApp manifest=], addressing specific aspects of a [=permission resource=].
</p>
<section>
<h3><code>name</code> member</h3>
<p>
The [=MiniApp permission resource's=] <dfn data-dfn-for="MiniApp permission resource"><code>name</code></dfn> member is a [=string=] that indicates the name of the feature requested.
</p>
<p>
To <dfn>process the permission resource's <code>name</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |permission:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["name"] does not [=map/exist=], or<br/>
if the type of |json|["name"] is not [=string=], or if |json|["name"] is the empty string, return failure.</li>
<li>Set |permission|["name"] to |json|["name"].</li>
</ol>
</section>
<section>
<h3><code>reason</code> member</h3>
<p>
The optional [=MiniApp permission resource's=] <dfn><code>reason</code></dfn> member is a [=string=] that indicates the reason given to request the feature specified in the <a data-link-type="dfn" data-link-for="MiniApp permission resource"><code>name</code></a> attribute.
</p>
<p>
To <dfn>process the permission resource's <code>reason</code> member</dfn>, given [=object=] |json:JSON| and [=ordered map=] |permission:ordered map|:
</p>
<ol class="algorithm">
<li>If |json|["reason"] does not [=map/exist=], or<br/>
if the type of |json|["reason"] is not [=string=], or if |json|["reason"] is the empty string, return.</li>
<li>Set |permission|["reason"] to |json|["reason"].</li>
</ol>
</section>
</section>
<section id="sec-widget-resource-members">
<h2>MiniApp widget resource members</h2>
<p>
A <dfn data-lt="widget resources|MiniApp widget resources|MiniApp widget resource's">MiniApp widget resource</dfn> is an [=object=] that defines and configures a <a data-link-type="dfn" href="https://w3c.github.io/miniapp-packaging/#dfn-widget">widget</a> that is part of a MiniApp.