hybrid-navigation 2.7.7 → 2.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 2.7.9 (2022-03-23)
2
+
3
+ ### Android specific
4
+
5
+ - 修复 `Fragment is not an active fragment of FragmentManager`
6
+
7
+ ## 2.7.8 (2022-03-03)
8
+
9
+ ### ios specific
10
+
11
+ - 修复因 NSUInteger 导致的问题
12
+
13
+ ```objc
14
+ for (NSUInteger i = count - 1; i > -1; i--) {
15
+ // 无法进入此区间
16
+ }
17
+ ```
18
+
1
19
  ## 2.7.7 (2022-03-03)
2
20
 
3
21
  ### Android specific
@@ -33,5 +33,5 @@ dependencies {
33
33
  implementation fileTree(dir: 'libs', include: ['*.jar'])
34
34
  implementation 'com.facebook.react:react-native:+'
35
35
  // api project(':navigation')
36
- api 'io.github.listenzz:AndroidNavigation:12.0.7'
36
+ api 'io.github.listenzz:AndroidNavigation:12.0.8'
37
37
  }
@@ -0,0 +1,376 @@
1
+ <!DOCTYPE html><html><head>
2
+ <title>deeplink</title>
3
+ <meta charset="utf-8">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+
6
+ <link rel="stylesheet" href="file:////Users/listen/.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.6.2/node_modules/@shd101wyy/mume/dependencies/katex/katex.min.css">
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ <style>
17
+ /**
18
+ * prism.js Github theme based on GitHub's theme.
19
+ * @author Sam Clarke
20
+ */
21
+ code[class*="language-"],
22
+ pre[class*="language-"] {
23
+ color: #333;
24
+ background: none;
25
+ font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
26
+ text-align: left;
27
+ white-space: pre;
28
+ word-spacing: normal;
29
+ word-break: normal;
30
+ word-wrap: normal;
31
+ line-height: 1.4;
32
+
33
+ -moz-tab-size: 8;
34
+ -o-tab-size: 8;
35
+ tab-size: 8;
36
+
37
+ -webkit-hyphens: none;
38
+ -moz-hyphens: none;
39
+ -ms-hyphens: none;
40
+ hyphens: none;
41
+ }
42
+
43
+ /* Code blocks */
44
+ pre[class*="language-"] {
45
+ padding: .8em;
46
+ overflow: auto;
47
+ /* border: 1px solid #ddd; */
48
+ border-radius: 3px;
49
+ /* background: #fff; */
50
+ background: #f5f5f5;
51
+ }
52
+
53
+ /* Inline code */
54
+ :not(pre) > code[class*="language-"] {
55
+ padding: .1em;
56
+ border-radius: .3em;
57
+ white-space: normal;
58
+ background: #f5f5f5;
59
+ }
60
+
61
+ .token.comment,
62
+ .token.blockquote {
63
+ color: #969896;
64
+ }
65
+
66
+ .token.cdata {
67
+ color: #183691;
68
+ }
69
+
70
+ .token.doctype,
71
+ .token.punctuation,
72
+ .token.variable,
73
+ .token.macro.property {
74
+ color: #333;
75
+ }
76
+
77
+ .token.operator,
78
+ .token.important,
79
+ .token.keyword,
80
+ .token.rule,
81
+ .token.builtin {
82
+ color: #a71d5d;
83
+ }
84
+
85
+ .token.string,
86
+ .token.url,
87
+ .token.regex,
88
+ .token.attr-value {
89
+ color: #183691;
90
+ }
91
+
92
+ .token.property,
93
+ .token.number,
94
+ .token.boolean,
95
+ .token.entity,
96
+ .token.atrule,
97
+ .token.constant,
98
+ .token.symbol,
99
+ .token.command,
100
+ .token.code {
101
+ color: #0086b3;
102
+ }
103
+
104
+ .token.tag,
105
+ .token.selector,
106
+ .token.prolog {
107
+ color: #63a35c;
108
+ }
109
+
110
+ .token.function,
111
+ .token.namespace,
112
+ .token.pseudo-element,
113
+ .token.class,
114
+ .token.class-name,
115
+ .token.pseudo-class,
116
+ .token.id,
117
+ .token.url-reference .token.variable,
118
+ .token.attr-name {
119
+ color: #795da3;
120
+ }
121
+
122
+ .token.entity {
123
+ cursor: help;
124
+ }
125
+
126
+ .token.title,
127
+ .token.title .token.punctuation {
128
+ font-weight: bold;
129
+ color: #1d3e81;
130
+ }
131
+
132
+ .token.list {
133
+ color: #ed6a43;
134
+ }
135
+
136
+ .token.inserted {
137
+ background-color: #eaffea;
138
+ color: #55a532;
139
+ }
140
+
141
+ .token.deleted {
142
+ background-color: #ffecec;
143
+ color: #bd2c00;
144
+ }
145
+
146
+ .token.bold {
147
+ font-weight: bold;
148
+ }
149
+
150
+ .token.italic {
151
+ font-style: italic;
152
+ }
153
+
154
+
155
+ /* JSON */
156
+ .language-json .token.property {
157
+ color: #183691;
158
+ }
159
+
160
+ .language-markup .token.tag .token.punctuation {
161
+ color: #333;
162
+ }
163
+
164
+ /* CSS */
165
+ code.language-css,
166
+ .language-css .token.function {
167
+ color: #0086b3;
168
+ }
169
+
170
+ /* YAML */
171
+ .language-yaml .token.atrule {
172
+ color: #63a35c;
173
+ }
174
+
175
+ code.language-yaml {
176
+ color: #183691;
177
+ }
178
+
179
+ /* Ruby */
180
+ .language-ruby .token.function {
181
+ color: #333;
182
+ }
183
+
184
+ /* Markdown */
185
+ .language-markdown .token.url {
186
+ color: #795da3;
187
+ }
188
+
189
+ /* Makefile */
190
+ .language-makefile .token.symbol {
191
+ color: #795da3;
192
+ }
193
+
194
+ .language-makefile .token.variable {
195
+ color: #183691;
196
+ }
197
+
198
+ .language-makefile .token.builtin {
199
+ color: #0086b3;
200
+ }
201
+
202
+ /* Bash */
203
+ .language-bash .token.keyword {
204
+ color: #0086b3;
205
+ }
206
+
207
+ /* highlight */
208
+ pre[data-line] {
209
+ position: relative;
210
+ padding: 1em 0 1em 3em;
211
+ }
212
+ pre[data-line] .line-highlight-wrapper {
213
+ position: absolute;
214
+ top: 0;
215
+ left: 0;
216
+ background-color: transparent;
217
+ display: block;
218
+ width: 100%;
219
+ }
220
+
221
+ pre[data-line] .line-highlight {
222
+ position: absolute;
223
+ left: 0;
224
+ right: 0;
225
+ padding: inherit 0;
226
+ margin-top: 1em;
227
+ background: hsla(24, 20%, 50%,.08);
228
+ background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
229
+ pointer-events: none;
230
+ line-height: inherit;
231
+ white-space: pre;
232
+ }
233
+
234
+ pre[data-line] .line-highlight:before,
235
+ pre[data-line] .line-highlight[data-end]:after {
236
+ content: attr(data-start);
237
+ position: absolute;
238
+ top: .4em;
239
+ left: .6em;
240
+ min-width: 1em;
241
+ padding: 0 .5em;
242
+ background-color: hsla(24, 20%, 50%,.4);
243
+ color: hsl(24, 20%, 95%);
244
+ font: bold 65%/1.5 sans-serif;
245
+ text-align: center;
246
+ vertical-align: .3em;
247
+ border-radius: 999px;
248
+ text-shadow: none;
249
+ box-shadow: 0 1px white;
250
+ }
251
+
252
+ pre[data-line] .line-highlight[data-end]:after {
253
+ content: attr(data-end);
254
+ top: auto;
255
+ bottom: .4em;
256
+ }html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ul,html body>ol{margin-bottom:16px}html body ul,html body ol{padding-left:2em}html body ul.no-list,html body ol.no-list{padding:0;list-style-type:none}html body ul ul,html body ul ol,html body ol ol,html body ol ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:bold;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em !important;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::before,html body code::after{letter-spacing:-0.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em !important;word-break:normal;white-space:pre;background:transparent;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em !important;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:before,html body pre tt:before,html body pre code:after,html body pre tt:after{content:normal}html body p,html body blockquote,html body ul,html body ol,html body dl,html body pre{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body pre,html body code{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .pagebreak,.markdown-preview .newpage{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center !important}.markdown-preview:not([for="preview"]) .code-chunk .btn-group{display:none}.markdown-preview:not([for="preview"]) .code-chunk .status{display:none}.markdown-preview:not([for="preview"]) .code-chunk .output-div{margin-bottom:16px}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview{font-size:14px !important;padding:1em}}@media print{html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for="html-export"]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,0.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,0.66);border:4px solid rgba(150,150,150,0.66);background-clip:content-box}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{padding:0 1.6em;margin-top:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc li{margin-bottom:.8em}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul{list-style-type:none}html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 150px);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for="html-export"]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
257
+ /* Please visit the URL below for more information: */
258
+ /* https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */
259
+
260
+ </style>
261
+ </head>
262
+ <body for="html-export">
263
+ <div class="mume markdown-preview ">
264
+ <h1 class="mume-header" id="deeplink">DeepLink</h1>
265
+
266
+ <p>0.5.0 &#x7248;&#x672C;&#x5F00;&#x59CB;&#x652F;&#x6301; DeepLink.</p>
267
+ <h2 class="mume-header" id="%E6%B3%A8%E5%86%8C">&#x6CE8;&#x518C;</h2>
268
+
269
+ <p><a name="router-config" href></a></p>
270
+ <p>&#x9700;&#x8981;&#x652F;&#x6301; DeepLink &#x7684;&#x9875;&#x9762;&#xFF0C;&#x5728;&#x6CE8;&#x518C;&#x65F6;&#x9700;&#x8981;&#x4F20;&#x5165;&#x7B2C;&#x4E09;&#x4E2A;&#x53C2;&#x6570;</p>
271
+ <pre data-role="codeBlock" data-info="javascript" class="language-javascript"><span class="token maybe-class-name">ReactRegistry</span><span class="token punctuation">.</span><span class="token method function property-access">registerComponent</span><span class="token punctuation">(</span><span class="token string">&apos;TopBarStyle&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token maybe-class-name">TopBarStyle</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
272
+ path<span class="token operator">:</span> <span class="token string">&apos;/topBarStyle/:who&apos;</span><span class="token punctuation">,</span>
273
+ dependency<span class="token operator">:</span> <span class="token string">&apos;TopBarMisc&apos;</span><span class="token punctuation">,</span>
274
+ <span class="token punctuation">}</span><span class="token punctuation">)</span>
275
+ </pre><p>&#x8FD9;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x4E00;&#x5171;&#x6709;&#x4E09;&#x4E2A;&#x53EF;&#x9009;&#x9879;</p>
276
+ <p>path &#x8868;&#x793A;&#x8DEF;&#x5F84;&#xFF0C;&#x5176;&#x4E2D;&#x5192;&#x53F7;&#x5F00;&#x5934;&#x7684;&#x7247;&#x6BB5;&#x8868;&#x793A;&#x53C2;&#x6570;&#xFF0C;&#x8FD9;&#x4E9B;&#x53C2;&#x6570;&#x5C06;&#x4F1A;&#x901A;&#x8FC7; props &#x4F20;&#x9012;&#x7ED9;&#x76EE;&#x6807;&#x9875;&#x9762;&#x3002;</p>
277
+ <p>dependency &#x8868;&#x793A;&#x524D;&#x7F6E;&#x9875;&#x9762;&#xFF0C;&#x8B6C;&#x5982;&#x4E00;&#x4E2A;&#x8BE6;&#x60C5;&#x9875;&#x53EF;&#x80FD;&#x4F1A;&#x4F9D;&#x8D56;&#x4E00;&#x4E2A;&#x5217;&#x8868;&#x9875;&#xFF0C;&#x5F53;&#x70B9;&#x51FB;&#x8FD4;&#x56DE;&#x6309;&#x94AE;&#x65F6;&#xFF0C;&#x4F1A;&#x56DE;&#x5230;&#x5217;&#x8868;&#x9875;&#x3002;&#x8FD9;&#x4E2A;&#x9009;&#x9879;&#x53EF;&#x4EE5;&#x786E;&#x5B9A;&#x4F9D;&#x8D56;&#x94FE;&#x3002;&#x770B; example &#x4E2D;&#x7684;&#x4F8B;&#x5B50;&#xFF1A;</p>
278
+ <pre data-role="codeBlock" data-info="javascript" class="language-javascript"><span class="token maybe-class-name">ReactRegistry</span><span class="token punctuation">.</span><span class="token method function property-access">registerComponent</span><span class="token punctuation">(</span><span class="token string">&apos;Options&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token maybe-class-name">Options</span><span class="token punctuation">)</span>
279
+ <span class="token maybe-class-name">ReactRegistry</span><span class="token punctuation">.</span><span class="token method function property-access">registerComponent</span><span class="token punctuation">(</span><span class="token string">&apos;TopBarMisc&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token maybe-class-name">TopBarMisc</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> dependency<span class="token operator">:</span> <span class="token string">&apos;Options&apos;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
280
+ <span class="token maybe-class-name">ReactRegistry</span><span class="token punctuation">.</span><span class="token method function property-access">registerComponent</span><span class="token punctuation">(</span><span class="token string">&apos;TopBarStyle&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token maybe-class-name">TopBarStyle</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
281
+ path<span class="token operator">:</span> <span class="token string">&apos;/topBarStyle/:who&apos;</span><span class="token punctuation">,</span>
282
+ dependency<span class="token operator">:</span> <span class="token string">&apos;TopBarMisc&apos;</span><span class="token punctuation">,</span>
283
+ <span class="token punctuation">}</span><span class="token punctuation">)</span>
284
+ </pre><p>TopBarStyle &#x4F9D;&#x8D56; TopBarMisc, TopBarMisc &#x4F9D;&#x8D56; Options, &#x5F53;&#x6211;&#x4EEC;&#x901A;&#x8FC7; <code>hbd://topBarStyle/xxxx?greeting=yyyy</code> &#x8FD9;&#x6837;&#x7684; url &#x6253;&#x5F00; TopBarStyle &#x8FD9;&#x4E2A;&#x9875;&#x9762;&#x65F6;&#xFF0C;&#x4F1A;&#x68C0;&#x67E5; app &#x5F53;&#x524D;&#x7684;&#x8DEF;&#x7531;&#x56FE;&#xFF0C;&#x4EE5;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x5207;&#x6362;&#x5230; tab Options, &#x5728;&#x6253;&#x5F00; TopBarStyle &#x4E4B;&#x524D;&#x662F;&#x5426;&#x9700;&#x8981;&#x521B;&#x5EFA; TopBarMisc&#x3002;</p>
285
+ <p>mode &#x8868;&#x793A;&#x8DF3;&#x8F6C;&#x6A21;&#x5F0F;&#xFF0C;present &#x8868;&#x793A;&#x4F7F;&#x7528; <code>navigator.present</code> &#x6253;&#x5F00;&#x76EE;&#x6807;&#x9875;&#x9762;&#xFF0C; <code>modal</code> &#x8868;&#x793A;&#x4F7F;&#x7528; <code>navigator.showModal</code> &#x6253;&#x5F00;&#x9875;&#x9762;&#xFF0C;&#x9ED8;&#x8BA4;&#x662F;&#x901A;&#x8FC7; push &#x7684;&#x65B9;&#x5F0F;&#x6253;&#x5F00;&#x3002;</p>
286
+ <blockquote>
287
+ <p>0.23.0 &#x5F00;&#x59CB;&#x652F;&#x6301; queryString&#xFF0C;queryString &#x4E0D;&#x80FD;&#x6CE8;&#x518C;&#x5728; path &#x4E2D;</p>
288
+ </blockquote>
289
+ <h2 class="mume-header" id="%E6%BF%80%E6%B4%BB">&#x6FC0;&#x6D3B;</h2>
290
+
291
+ <p>&#x6211;&#x4EEC;&#x9700;&#x8981;&#x5728;&#x4E00;&#x4E2A;&#x7A33;&#x5B9A;&#x7684;&#x9875;&#x9762;&#xFF08;&#x901A;&#x5E38;&#x662F;&#x4E3B;&#x9875;&#x9762;&#xFF09;&#x6FC0;&#x6D3B; DeepLink &#x529F;&#x80FD;&#x3002;</p>
292
+ <p>&#x8B6C;&#x5982; example &#x9879;&#x76EE;&#xFF0C;&#x5728; Navigation.js &#x6FC0;&#x6D3B;&#x4E86;&#x8DEF;&#x7531;&#x529F;&#x80FD;</p>
293
+ <pre data-role="codeBlock" data-info="javascript" class="language-javascript"><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">DeepLink</span> <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">&apos;hybrid-navigation&apos;</span><span class="token punctuation">;</span>
294
+
295
+ <span class="token function">componentDidMount</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
296
+ <span class="token keyword keyword-const">const</span> prefix <span class="token operator">=</span> <span class="token string">&apos;hbd://&apos;</span><span class="token punctuation">;</span>
297
+ <span class="token maybe-class-name">DeepLink</span><span class="token punctuation">.</span><span class="token method function property-access">activate</span><span class="token punctuation">(</span>prefix<span class="token punctuation">)</span><span class="token punctuation">;</span>
298
+ <span class="token punctuation">}</span>
299
+
300
+ <span class="token function">componentWillUnmount</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
301
+ <span class="token maybe-class-name">DeepLink</span><span class="token punctuation">.</span><span class="token method function property-access">deactivate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
302
+ <span class="token punctuation">}</span>
303
+ </pre><p>&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4EE5;&#x4E0B;&#x65B9;&#x5F0F;&#x6FC0;&#x6D3B;</p>
304
+ <pre data-role="codeBlock" data-info="javascript" class="language-javascript"><span class="token comment">// &#x6FC0;&#x6D3B; DeepLink&#xFF0C;&#x5728; Navigator.setRoot &#x4E4B;&#x524D;</span>
305
+ <span class="token maybe-class-name">Navigator</span><span class="token punctuation">.</span><span class="token method function property-access">setRootLayoutUpdateListener</span><span class="token punctuation">(</span>
306
+ <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
307
+ <span class="token maybe-class-name">DeepLink</span><span class="token punctuation">.</span><span class="token method function property-access">deactivate</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
308
+ <span class="token punctuation">}</span><span class="token punctuation">,</span>
309
+ <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=&gt;</span> <span class="token punctuation">{</span>
310
+ <span class="token keyword keyword-const">const</span> prefix <span class="token operator">=</span> <span class="token string">&apos;hbd://&apos;</span>
311
+ <span class="token maybe-class-name">DeepLink</span><span class="token punctuation">.</span><span class="token method function property-access">activate</span><span class="token punctuation">(</span>prefix<span class="token punctuation">)</span>
312
+ <span class="token punctuation">}</span><span class="token punctuation">,</span>
313
+ <span class="token punctuation">)</span>
314
+
315
+ <span class="token comment">// &#x8BBE;&#x7F6E; UI &#x5C42;&#x7EA7;</span>
316
+ <span class="token maybe-class-name">Navigator</span><span class="token punctuation">.</span><span class="token method function property-access">setRoot</span><span class="token punctuation">(</span>drawer<span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">)</span>
317
+ </pre><h2 class="mume-header" id="%E6%8B%A6%E6%88%AA">&#x62E6;&#x622A;</h2>
318
+
319
+ <p>&#x6709;&#x65F6;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x62E6;&#x622A;&#x9ED8;&#x8BA4;&#x7684;&#x8DF3;&#x8F6C;&#x884C;&#x4E3A;</p>
320
+ <p>router &#x5BF9;&#x8C61;&#x4E3A;&#x6211;&#x4EEC;&#x63D0;&#x4F9B;&#x4E86;&#x6CE8;&#x518C;&#x548C;&#x79FB;&#x9664;&#x62E6;&#x622A;&#x5668;&#x7684;&#x4E00;&#x5BF9;&#x65B9;&#x6CD5;</p>
321
+ <pre data-role="codeBlock" data-info="javascript" class="language-javascript"><span class="token keyword module keyword-import">import</span> <span class="token imports"><span class="token punctuation">{</span> router <span class="token punctuation">}</span></span> <span class="token keyword module keyword-from">from</span> <span class="token string">&apos;hybrid-navigation&apos;</span>
322
+ router<span class="token punctuation">.</span><span class="token method function property-access">addInterceptor</span><span class="token punctuation">(</span>func<span class="token punctuation">)</span>
323
+ router<span class="token punctuation">.</span><span class="token method function property-access">removeInterceptor</span><span class="token punctuation">(</span>func<span class="token punctuation">)</span>
324
+ </pre><p>func &#x662F;&#x4E00;&#x4E2A;&#x63A5;&#x6536; path &#x4E3A;&#x53C2;&#x6570;&#xFF0C;&#x8FD4;&#x56DE; boolen &#x7684;&#x51FD;&#x6570;&#xFF0C;&#x8FD4;&#x56DE; true &#x8868;&#x793A;&#x62E6;&#x622A;&#x3002;</p>
325
+ <p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>router.pathToRoute(path)</code> &#x6765;&#x83B7;&#x53D6;&#x8DEF;&#x7531;&#x4FE1;&#x606F;</p>
326
+ <h2 class="mume-header" id="ios-%E9%85%8D%E7%BD%AE">iOS &#x914D;&#x7F6E;</h2>
327
+
328
+ <p>Let&apos;s configure the native iOS app to open based on the mychat:// URI scheme.</p>
329
+ <p>In SimpleApp/ios/SimpleApp/AppDelegate.m:</p>
330
+ <pre data-role="codeBlock" data-info="objc" class="language-objectivec"><span class="token comment">// Add the header at the top of the file:</span>
331
+ <span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">import</span> <span class="token expression"><span class="token operator">&lt;</span>React<span class="token operator">/</span>RCTLinkingManager<span class="token punctuation">.</span>h<span class="token operator">&gt;</span></span></span>
332
+
333
+ <span class="token comment">// Add this above the `@end`:</span>
334
+ <span class="token operator">-</span> <span class="token punctuation">(</span>BOOL<span class="token punctuation">)</span>application<span class="token punctuation">:</span><span class="token punctuation">(</span>UIApplication <span class="token operator">*</span><span class="token punctuation">)</span>application openURL<span class="token punctuation">:</span><span class="token punctuation">(</span>NSURL <span class="token operator">*</span><span class="token punctuation">)</span>url
335
+ sourceApplication<span class="token punctuation">:</span><span class="token punctuation">(</span>NSString <span class="token operator">*</span><span class="token punctuation">)</span>sourceApplication annotation<span class="token punctuation">:</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span>annotation
336
+ <span class="token punctuation">{</span>
337
+ <span class="token keyword keyword-return">return</span> <span class="token punctuation">[</span>RCTLinkingManager application<span class="token punctuation">:</span>application openURL<span class="token punctuation">:</span>url
338
+ sourceApplication<span class="token punctuation">:</span>sourceApplication annotation<span class="token punctuation">:</span>annotation<span class="token punctuation">]</span><span class="token punctuation">;</span>
339
+ <span class="token punctuation">}</span>
340
+ </pre><p>In Xcode, open the project at SimpleApp/ios/SimpleApp.xcodeproj. Select the project in sidebar and navigate to the info tab. Scroll down to &quot;URL Types&quot; and add one. In the new URL type, set the identifier and the url scheme to your desired url scheme.</p>
341
+ <p><img src="https://todoit.oss-cn-shanghai.aliyuncs.com/todoit/deeplink-2021-10-19-15-37-05.png" alt="deeplink-2021-10-19-15-37-05"></p>
342
+ <h2 class="mume-header" id="android-%E9%85%8D%E7%BD%AE">Android &#x914D;&#x7F6E;</h2>
343
+
344
+ <p>To configure the external linking in Android, you can create a new intent in the manifest.</p>
345
+ <p>In SimpleApp/android/app/src/main/AndroidManifest.xml, add the new intent-filter inside the MainActivity entry with a VIEW type action:</p>
346
+ <pre data-role="codeBlock" data-info="xml" class="language-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>intent-filter</span><span class="token punctuation">&gt;</span></span>
347
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>action</span> <span class="token attr-name"><span class="token namespace">android:</span>name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>android.intent.action.VIEW<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
348
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>category</span> <span class="token attr-name"><span class="token namespace">android:</span>name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>android.intent.category.DEFAULT<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
349
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>category</span> <span class="token attr-name"><span class="token namespace">android:</span>name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>android.intent.category.BROWSABLE<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
350
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>data</span> <span class="token attr-name"><span class="token namespace">android:</span>scheme</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>mychat<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
351
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>intent-filter</span><span class="token punctuation">&gt;</span></span>
352
+ </pre><blockquote>
353
+ <p>MainActivity &#x7684; launchMode &#x9700;&#x8981;&#x8BBE;&#x7F6E;&#x4E3A; singleTask</p>
354
+ </blockquote>
355
+ <h2 class="mume-header" id="%E6%B5%8B%E8%AF%95">&#x6D4B;&#x8BD5;</h2>
356
+
357
+ <p>&#x5177;&#x4F53;&#x53EF;&#x4EE5;&#x53C2;&#x8003; example &#x8FD9;&#x4E2A;&#x9879;&#x76EE;&#x4E2D;&#x76F8;&#x5173;&#x914D;&#x7F6E;</p>
358
+ <p>&#x53EF;&#x4EE5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x901A;&#x8FC7;&#x4EE5;&#x4E0B;&#x4E24;&#x4E2A;&#x547D;&#x4EE4;&#x5206;&#x522B;&#x6D4B;&#x8BD5; iOS &#x548C; Android &#x7684;&#x6548;&#x679C;</p>
359
+ <p>iOS:</p>
360
+ <pre data-role="codeBlock" data-info class="language-"><code>xcrun simctl openurl booted &quot;hbd://topBarStyle/xxxx?greeting=yyyy&quot;
361
+ </code></pre><p>Android:</p>
362
+ <pre data-role="codeBlock" data-info class="language-"><code>adb shell am start -W -a android.intent.action.VIEW -d &quot;hbd://topBarStyle/xxxx?greeting=yyyy&quot;
363
+ </code></pre>
364
+ </div>
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+ </body></html>
Binary file
package/docs/qa.md CHANGED
@@ -6,6 +6,8 @@
6
6
 
7
7
  请参考 [ContextDemo](https://github.com/listenzz/MultiContextDemo)。
8
8
 
9
+ ⚠️ 推荐使用 [zustand](https://github.com/pmndrs/zustand)
10
+
9
11
  ## 为什么在 Android 平台,push 到下一个页面时,当前页面的图片会消失?
10
12
 
11
13
  细心的同学,可能会注意到,在 Android 平台,push 到下一个页面时,当前页面的图片会消失。这是怎么回事呢?
@@ -182,13 +182,12 @@ RCT_EXPORT_METHOD(findSceneIdByModuleName:
182
182
 
183
183
  UIApplication *application = [[UIApplication class] performSelector:@selector(sharedApplication)];
184
184
  NSString *sceneId = nil;
185
- NSUInteger index = application.windows.count - 1;
186
-
187
185
  NSString *moduleName = params[@"moduleName"];
188
186
  Promise *promise = params[@"promise"];
189
187
 
190
- while (index > -1 && sceneId == nil) {
191
- UIWindow *window = application.windows[index];
188
+ NSUInteger index = application.windows.count;
189
+ while (index > 0 && sceneId == nil) {
190
+ UIWindow *window = application.windows[index - 1];
192
191
  sceneId = [self findSceneIdByModuleName:moduleName withViewController:window.rootViewController];
193
192
  index--;
194
193
  }
@@ -216,9 +215,9 @@ RCT_EXPORT_METHOD(findSceneIdByModuleName:
216
215
  NSArray<UIViewController *> *children = vc.childViewControllers;
217
216
  NSUInteger count = children.count;
218
217
  if (count > 0) {
219
- NSUInteger index = count - 1;
220
- while (index > -1 && sceneId == nil) {
221
- UIViewController *child = children[index];
218
+ NSUInteger index = count;
219
+ while (index > 0 && sceneId == nil) {
220
+ UIViewController *child = children[index - 1];
222
221
  sceneId = [self findSceneIdByModuleName:moduleName withViewController:child];
223
222
  index--;
224
223
  }
@@ -98,12 +98,13 @@
98
98
  NSUInteger count = children.count;
99
99
  NSString *moduleName = extras[@"moduleName"];
100
100
  BOOL inclusive = [extras[@"inclusive"] boolValue];
101
- for (NSUInteger i = count - 1; i > -1; i--) {
102
- HBDViewController *vc = children[i];
101
+ for (NSUInteger i = count; i > 0; i--) {
102
+ NSUInteger index = i - 1;
103
+ HBDViewController *vc = children[index];
103
104
  if ([moduleName isEqualToString:vc.moduleName] || [moduleName isEqualToString:vc.sceneId]) {
104
105
  viewController = vc;
105
- if (inclusive && i - 1 > -1) {
106
- viewController = children[i - 1];
106
+ if (inclusive && i > 0) {
107
+ viewController = children[index];
107
108
  }
108
109
  break;
109
110
  }
@@ -105,8 +105,9 @@
105
105
 
106
106
  - (void)removeTabBarAboriginal {
107
107
  NSUInteger count = self.tabBar.subviews.count;
108
- for (NSInteger i = count - 1; i > -1; i--) {
109
- UIView *view = self.tabBar.subviews[i];
108
+ for (NSUInteger i = count; i > 0; i--) {
109
+ NSUInteger index = i - 1;
110
+ UIView *view = self.tabBar.subviews[index];
110
111
  NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""];
111
112
  if ([viewName isEqualToString:@"UITabBarButton"]) {
112
113
  [view removeFromSuperview];
@@ -17,9 +17,10 @@
17
17
  - (void)redirectToViewController:(UIViewController *)controller target:(UIViewController *)target animated:(BOOL)animated {
18
18
  NSMutableArray *children = [self.childViewControllers mutableCopy];
19
19
  NSUInteger count = self.childViewControllers.count;
20
- for (NSUInteger i = count - 1; i > -1; i--) {
21
- UIViewController *child = children[i];
22
- [children removeObjectAtIndex:i];
20
+ for (NSUInteger i = count; i > 0; i--) {
21
+ NSUInteger index = i - 1;
22
+ UIViewController *child = children[index];
23
+ [children removeObjectAtIndex:index];
23
24
  if (child == target) {
24
25
  break;
25
26
  }
@@ -10,7 +10,7 @@ export interface InjectedProps {
10
10
  sceneId: string;
11
11
  }
12
12
  export declare const NavigationContext: React.Context<any>;
13
- export declare type HOC = (WrappedComponent: React.ComponentType<any>) => React.ComponentType<any>;
13
+ export declare type HOC = (WrappedComponent: ComponentType<any>) => ComponentType<any>;
14
14
  export declare class ReactRegistry {
15
15
  static registerEnded: boolean;
16
16
  static startRegisterComponent(hoc?: HOC): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "2.7.7",
4
+ "version": "2.7.10",
5
5
  "keywords": [
6
6
  "react-native",
7
7
  "navigation",
@@ -54,7 +54,7 @@
54
54
  "jest": "^27.2.0",
55
55
  "metro-react-native-babel-preset": "^0.68.0",
56
56
  "react": "17.0.2",
57
- "react-native": "^0.67.2",
57
+ "react-native": "^0.67.4",
58
58
  "react-native-fast-image": "^8.5.11",
59
59
  "react-native-iphone-x-helper": "^1.2.0",
60
60
  "react-native-keyboard-aware-scroll-view": "^0.9.5",
@@ -63,7 +63,8 @@
63
63
  "react-test-renderer": "17.0.2",
64
64
  "redux": "^4.1.1",
65
65
  "typescript": "^4.4.3",
66
- "vuepress": "^2.0.0-beta.26"
66
+ "vuepress": "^2.0.0-beta.26",
67
+ "zustand": "^3.7.1"
67
68
  },
68
69
  "jest": {
69
70
  "preset": "react-native",