Browse Source

Added macOS test app

Tom Underhill 5 years ago
parent
commit
2aac53b504

+ 16
- 0
example/macos/RNCWebViewExample-macOS/AppDelegate.h View File

@@ -0,0 +1,16 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <Cocoa/Cocoa.h>
9
+
10
+@class RCTBridge;
11
+
12
+@interface AppDelegate : NSObject <NSApplicationDelegate>
13
+
14
+@property (nonatomic, readonly) RCTBridge *bridge;
15
+
16
+@end

+ 39
- 0
example/macos/RNCWebViewExample-macOS/AppDelegate.m View File

@@ -0,0 +1,39 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import "AppDelegate.h"
9
+
10
+#import <React/RCTBridge.h>
11
+#import <React/RCTBundleURLProvider.h>
12
+
13
+@interface AppDelegate () <RCTBridgeDelegate>
14
+
15
+@end
16
+
17
+@implementation AppDelegate
18
+
19
+- (void)awakeFromNib {
20
+  [super awakeFromNib];
21
+
22
+  _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
23
+}
24
+
25
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
26
+  // Insert code here to initialize your application
27
+}
28
+
29
+- (void)applicationWillTerminate:(NSNotification *)aNotification {
30
+  // Insert code here to tear down your application
31
+}
32
+
33
+#pragma mark - RCTBridgeDelegate Methods
34
+
35
+- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge {
36
+  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:@"main"]; // .jsbundle;
37
+}
38
+
39
+@end

+ 37
- 0
example/macos/RNCWebViewExample-macOS/Info.plist View File

@@ -0,0 +1,37 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+  <key>CFBundleDevelopmentRegion</key>
6
+  <string>$(DEVELOPMENT_LANGUAGE)</string>
7
+  <key>CFBundleExecutable</key>
8
+  <string>$(EXECUTABLE_NAME)</string>
9
+  <key>CFBundleIconFile</key>
10
+  <string></string>
11
+  <key>CFBundleIdentifier</key>
12
+  <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+  <key>CFBundleInfoDictionaryVersion</key>
14
+  <string>6.0</string>
15
+  <key>CFBundleName</key>
16
+  <string>$(PRODUCT_NAME)</string>
17
+  <key>CFBundlePackageType</key>
18
+  <string>APPL</string>
19
+  <key>CFBundleShortVersionString</key>
20
+  <string>1.0</string>
21
+  <key>CFBundleVersion</key>
22
+  <string>1</string>
23
+  <key>LSMinimumSystemVersion</key>
24
+  <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
25
+  <key>NSHumanReadableCopyright</key>
26
+  <string>Copyright © 2017 Facebook. All rights reserved.</string>
27
+  <key>NSMainStoryboardFile</key>
28
+  <string>Main</string>
29
+  <key>NSPrincipalClass</key>
30
+  <string>NSApplication</string>
31
+  <key>NSAppTransportSecurity</key>
32
+  <dict>
33
+    <key>NSAllowsArbitraryLoads</key>
34
+    <true/>
35
+  </dict>
36
+</dict>
37
+</plist>

+ 713
- 0
example/macos/RNCWebViewExample-macOS/Main.storyboard View File

@@ -0,0 +1,713 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
3
+    <dependencies>
4
+        <deployment identifier="macosx"/>
5
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15505"/>
6
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7
+    </dependencies>
8
+    <scenes>
9
+        <!--Application-->
10
+        <scene sceneID="JPo-4y-FX3">
11
+            <objects>
12
+                <application id="hnw-xV-0zn" sceneMemberID="viewController">
13
+                    <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
14
+                        <items>
15
+                            <menuItem title="rncTesterApp-macOS" id="1Xt-HY-uBw">
16
+                                <modifierMask key="keyEquivalentModifierMask"/>
17
+                                <menu key="submenu" title="rncTesterApp-macOS" systemMenu="apple" id="uQy-DD-JDr">
18
+                                    <items>
19
+                                        <menuItem title="About rncTesterApp-macOS" id="5kV-Vb-QxS">
20
+                                            <modifierMask key="keyEquivalentModifierMask"/>
21
+                                            <connections>
22
+                                                <action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
23
+                                            </connections>
24
+                                        </menuItem>
25
+                                        <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
26
+                                        <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
27
+                                        <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
28
+                                        <menuItem title="Services" id="NMo-om-nkz">
29
+                                            <modifierMask key="keyEquivalentModifierMask"/>
30
+                                            <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
31
+                                        </menuItem>
32
+                                        <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
33
+                                        <menuItem title="Hide rncTesterApp-macOS" keyEquivalent="h" id="Olw-nP-bQN">
34
+                                            <connections>
35
+                                                <action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
36
+                                            </connections>
37
+                                        </menuItem>
38
+                                        <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
39
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
40
+                                            <connections>
41
+                                                <action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
42
+                                            </connections>
43
+                                        </menuItem>
44
+                                        <menuItem title="Show All" id="Kd2-mp-pUS">
45
+                                            <modifierMask key="keyEquivalentModifierMask"/>
46
+                                            <connections>
47
+                                                <action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
48
+                                            </connections>
49
+                                        </menuItem>
50
+                                        <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
51
+                                        <menuItem title="Quit rncTesterApp-macOS" keyEquivalent="q" id="4sb-4s-VLi">
52
+                                            <connections>
53
+                                                <action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
54
+                                            </connections>
55
+                                        </menuItem>
56
+                                    </items>
57
+                                </menu>
58
+                            </menuItem>
59
+                            <menuItem title="File" id="dMs-cI-mzQ">
60
+                                <modifierMask key="keyEquivalentModifierMask"/>
61
+                                <menu key="submenu" title="File" id="bib-Uj-vzu">
62
+                                    <items>
63
+                                        <menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
64
+                                            <connections>
65
+                                                <action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
66
+                                            </connections>
67
+                                        </menuItem>
68
+                                        <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
69
+                                            <connections>
70
+                                                <action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
71
+                                            </connections>
72
+                                        </menuItem>
73
+                                        <menuItem title="Open Recent" id="tXI-mr-wws">
74
+                                            <modifierMask key="keyEquivalentModifierMask"/>
75
+                                            <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
76
+                                                <items>
77
+                                                    <menuItem title="Clear Menu" id="vNY-rz-j42">
78
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
79
+                                                        <connections>
80
+                                                            <action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
81
+                                                        </connections>
82
+                                                    </menuItem>
83
+                                                </items>
84
+                                            </menu>
85
+                                        </menuItem>
86
+                                        <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
87
+                                        <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
88
+                                            <connections>
89
+                                                <action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
90
+                                            </connections>
91
+                                        </menuItem>
92
+                                        <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
93
+                                            <connections>
94
+                                                <action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
95
+                                            </connections>
96
+                                        </menuItem>
97
+                                        <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
98
+                                            <connections>
99
+                                                <action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
100
+                                            </connections>
101
+                                        </menuItem>
102
+                                        <menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
103
+                                            <connections>
104
+                                                <action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
105
+                                            </connections>
106
+                                        </menuItem>
107
+                                        <menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
108
+                                        <menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
109
+                                            <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
110
+                                            <connections>
111
+                                                <action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
112
+                                            </connections>
113
+                                        </menuItem>
114
+                                        <menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
115
+                                            <connections>
116
+                                                <action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
117
+                                            </connections>
118
+                                        </menuItem>
119
+                                    </items>
120
+                                </menu>
121
+                            </menuItem>
122
+                            <menuItem title="Edit" id="5QF-Oa-p0T">
123
+                                <modifierMask key="keyEquivalentModifierMask"/>
124
+                                <menu key="submenu" title="Edit" id="W48-6f-4Dl">
125
+                                    <items>
126
+                                        <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
127
+                                            <connections>
128
+                                                <action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/>
129
+                                            </connections>
130
+                                        </menuItem>
131
+                                        <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
132
+                                            <connections>
133
+                                                <action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/>
134
+                                            </connections>
135
+                                        </menuItem>
136
+                                        <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
137
+                                        <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
138
+                                            <connections>
139
+                                                <action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/>
140
+                                            </connections>
141
+                                        </menuItem>
142
+                                        <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
143
+                                            <connections>
144
+                                                <action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/>
145
+                                            </connections>
146
+                                        </menuItem>
147
+                                        <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
148
+                                            <connections>
149
+                                                <action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/>
150
+                                            </connections>
151
+                                        </menuItem>
152
+                                        <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
153
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
154
+                                            <connections>
155
+                                                <action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/>
156
+                                            </connections>
157
+                                        </menuItem>
158
+                                        <menuItem title="Delete" id="pa3-QI-u2k">
159
+                                            <modifierMask key="keyEquivalentModifierMask"/>
160
+                                            <connections>
161
+                                                <action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/>
162
+                                            </connections>
163
+                                        </menuItem>
164
+                                        <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
165
+                                            <connections>
166
+                                                <action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
167
+                                            </connections>
168
+                                        </menuItem>
169
+                                        <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
170
+                                        <menuItem title="Find" id="4EN-yA-p0u">
171
+                                            <modifierMask key="keyEquivalentModifierMask"/>
172
+                                            <menu key="submenu" title="Find" id="1b7-l0-nxx">
173
+                                                <items>
174
+                                                    <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
175
+                                                        <connections>
176
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/>
177
+                                                        </connections>
178
+                                                    </menuItem>
179
+                                                    <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
180
+                                                        <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
181
+                                                        <connections>
182
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/>
183
+                                                        </connections>
184
+                                                    </menuItem>
185
+                                                    <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
186
+                                                        <connections>
187
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/>
188
+                                                        </connections>
189
+                                                    </menuItem>
190
+                                                    <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
191
+                                                        <connections>
192
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/>
193
+                                                        </connections>
194
+                                                    </menuItem>
195
+                                                    <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
196
+                                                        <connections>
197
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/>
198
+                                                        </connections>
199
+                                                    </menuItem>
200
+                                                    <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
201
+                                                        <connections>
202
+                                                            <action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/>
203
+                                                        </connections>
204
+                                                    </menuItem>
205
+                                                </items>
206
+                                            </menu>
207
+                                        </menuItem>
208
+                                        <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
209
+                                            <modifierMask key="keyEquivalentModifierMask"/>
210
+                                            <menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
211
+                                                <items>
212
+                                                    <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
213
+                                                        <connections>
214
+                                                            <action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/>
215
+                                                        </connections>
216
+                                                    </menuItem>
217
+                                                    <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
218
+                                                        <connections>
219
+                                                            <action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/>
220
+                                                        </connections>
221
+                                                    </menuItem>
222
+                                                    <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
223
+                                                    <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
224
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
225
+                                                        <connections>
226
+                                                            <action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/>
227
+                                                        </connections>
228
+                                                    </menuItem>
229
+                                                    <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
230
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
231
+                                                        <connections>
232
+                                                            <action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/>
233
+                                                        </connections>
234
+                                                    </menuItem>
235
+                                                    <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
236
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
237
+                                                        <connections>
238
+                                                            <action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/>
239
+                                                        </connections>
240
+                                                    </menuItem>
241
+                                                </items>
242
+                                            </menu>
243
+                                        </menuItem>
244
+                                        <menuItem title="Substitutions" id="9ic-FL-obx">
245
+                                            <modifierMask key="keyEquivalentModifierMask"/>
246
+                                            <menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
247
+                                                <items>
248
+                                                    <menuItem title="Show Substitutions" id="z6F-FW-3nz">
249
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
250
+                                                        <connections>
251
+                                                            <action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/>
252
+                                                        </connections>
253
+                                                    </menuItem>
254
+                                                    <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
255
+                                                    <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
256
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
257
+                                                        <connections>
258
+                                                            <action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/>
259
+                                                        </connections>
260
+                                                    </menuItem>
261
+                                                    <menuItem title="Smart Quotes" id="hQb-2v-fYv">
262
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
263
+                                                        <connections>
264
+                                                            <action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/>
265
+                                                        </connections>
266
+                                                    </menuItem>
267
+                                                    <menuItem title="Smart Dashes" id="rgM-f4-ycn">
268
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
269
+                                                        <connections>
270
+                                                            <action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/>
271
+                                                        </connections>
272
+                                                    </menuItem>
273
+                                                    <menuItem title="Smart Links" id="cwL-P1-jid">
274
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
275
+                                                        <connections>
276
+                                                            <action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/>
277
+                                                        </connections>
278
+                                                    </menuItem>
279
+                                                    <menuItem title="Data Detectors" id="tRr-pd-1PS">
280
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
281
+                                                        <connections>
282
+                                                            <action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/>
283
+                                                        </connections>
284
+                                                    </menuItem>
285
+                                                    <menuItem title="Text Replacement" id="HFQ-gK-NFA">
286
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
287
+                                                        <connections>
288
+                                                            <action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/>
289
+                                                        </connections>
290
+                                                    </menuItem>
291
+                                                </items>
292
+                                            </menu>
293
+                                        </menuItem>
294
+                                        <menuItem title="Transformations" id="2oI-Rn-ZJC">
295
+                                            <modifierMask key="keyEquivalentModifierMask"/>
296
+                                            <menu key="submenu" title="Transformations" id="c8a-y6-VQd">
297
+                                                <items>
298
+                                                    <menuItem title="Make Upper Case" id="vmV-6d-7jI">
299
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
300
+                                                        <connections>
301
+                                                            <action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/>
302
+                                                        </connections>
303
+                                                    </menuItem>
304
+                                                    <menuItem title="Make Lower Case" id="d9M-CD-aMd">
305
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
306
+                                                        <connections>
307
+                                                            <action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/>
308
+                                                        </connections>
309
+                                                    </menuItem>
310
+                                                    <menuItem title="Capitalize" id="UEZ-Bs-lqG">
311
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
312
+                                                        <connections>
313
+                                                            <action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/>
314
+                                                        </connections>
315
+                                                    </menuItem>
316
+                                                </items>
317
+                                            </menu>
318
+                                        </menuItem>
319
+                                        <menuItem title="Speech" id="xrE-MZ-jX0">
320
+                                            <modifierMask key="keyEquivalentModifierMask"/>
321
+                                            <menu key="submenu" title="Speech" id="3rS-ZA-NoH">
322
+                                                <items>
323
+                                                    <menuItem title="Start Speaking" id="Ynk-f8-cLZ">
324
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
325
+                                                        <connections>
326
+                                                            <action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/>
327
+                                                        </connections>
328
+                                                    </menuItem>
329
+                                                    <menuItem title="Stop Speaking" id="Oyz-dy-DGm">
330
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
331
+                                                        <connections>
332
+                                                            <action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/>
333
+                                                        </connections>
334
+                                                    </menuItem>
335
+                                                </items>
336
+                                            </menu>
337
+                                        </menuItem>
338
+                                    </items>
339
+                                </menu>
340
+                            </menuItem>
341
+                            <menuItem title="Format" id="jxT-CU-nIS">
342
+                                <modifierMask key="keyEquivalentModifierMask"/>
343
+                                <menu key="submenu" title="Format" id="GEO-Iw-cKr">
344
+                                    <items>
345
+                                        <menuItem title="Font" id="Gi5-1S-RQB">
346
+                                            <modifierMask key="keyEquivalentModifierMask"/>
347
+                                            <menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
348
+                                                <items>
349
+                                                    <menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
350
+                                                        <connections>
351
+                                                            <action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
352
+                                                        </connections>
353
+                                                    </menuItem>
354
+                                                    <menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
355
+                                                        <connections>
356
+                                                            <action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
357
+                                                        </connections>
358
+                                                    </menuItem>
359
+                                                    <menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
360
+                                                        <connections>
361
+                                                            <action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
362
+                                                        </connections>
363
+                                                    </menuItem>
364
+                                                    <menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
365
+                                                        <connections>
366
+                                                            <action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/>
367
+                                                        </connections>
368
+                                                    </menuItem>
369
+                                                    <menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
370
+                                                    <menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
371
+                                                        <connections>
372
+                                                            <action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
373
+                                                        </connections>
374
+                                                    </menuItem>
375
+                                                    <menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
376
+                                                        <connections>
377
+                                                            <action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
378
+                                                        </connections>
379
+                                                    </menuItem>
380
+                                                    <menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
381
+                                                    <menuItem title="Kern" id="jBQ-r6-VK2">
382
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
383
+                                                        <menu key="submenu" title="Kern" id="tlD-Oa-oAM">
384
+                                                            <items>
385
+                                                                <menuItem title="Use Default" id="GUa-eO-cwY">
386
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
387
+                                                                    <connections>
388
+                                                                        <action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/>
389
+                                                                    </connections>
390
+                                                                </menuItem>
391
+                                                                <menuItem title="Use None" id="cDB-IK-hbR">
392
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
393
+                                                                    <connections>
394
+                                                                        <action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/>
395
+                                                                    </connections>
396
+                                                                </menuItem>
397
+                                                                <menuItem title="Tighten" id="46P-cB-AYj">
398
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
399
+                                                                    <connections>
400
+                                                                        <action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/>
401
+                                                                    </connections>
402
+                                                                </menuItem>
403
+                                                                <menuItem title="Loosen" id="ogc-rX-tC1">
404
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
405
+                                                                    <connections>
406
+                                                                        <action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/>
407
+                                                                    </connections>
408
+                                                                </menuItem>
409
+                                                            </items>
410
+                                                        </menu>
411
+                                                    </menuItem>
412
+                                                    <menuItem title="Ligatures" id="o6e-r0-MWq">
413
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
414
+                                                        <menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
415
+                                                            <items>
416
+                                                                <menuItem title="Use Default" id="agt-UL-0e3">
417
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
418
+                                                                    <connections>
419
+                                                                        <action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/>
420
+                                                                    </connections>
421
+                                                                </menuItem>
422
+                                                                <menuItem title="Use None" id="J7y-lM-qPV">
423
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
424
+                                                                    <connections>
425
+                                                                        <action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/>
426
+                                                                    </connections>
427
+                                                                </menuItem>
428
+                                                                <menuItem title="Use All" id="xQD-1f-W4t">
429
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
430
+                                                                    <connections>
431
+                                                                        <action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/>
432
+                                                                    </connections>
433
+                                                                </menuItem>
434
+                                                            </items>
435
+                                                        </menu>
436
+                                                    </menuItem>
437
+                                                    <menuItem title="Baseline" id="OaQ-X3-Vso">
438
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
439
+                                                        <menu key="submenu" title="Baseline" id="ijk-EB-dga">
440
+                                                            <items>
441
+                                                                <menuItem title="Use Default" id="3Om-Ey-2VK">
442
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
443
+                                                                    <connections>
444
+                                                                        <action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/>
445
+                                                                    </connections>
446
+                                                                </menuItem>
447
+                                                                <menuItem title="Superscript" id="Rqc-34-cIF">
448
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
449
+                                                                    <connections>
450
+                                                                        <action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/>
451
+                                                                    </connections>
452
+                                                                </menuItem>
453
+                                                                <menuItem title="Subscript" id="I0S-gh-46l">
454
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
455
+                                                                    <connections>
456
+                                                                        <action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/>
457
+                                                                    </connections>
458
+                                                                </menuItem>
459
+                                                                <menuItem title="Raise" id="2h7-ER-AoG">
460
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
461
+                                                                    <connections>
462
+                                                                        <action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/>
463
+                                                                    </connections>
464
+                                                                </menuItem>
465
+                                                                <menuItem title="Lower" id="1tx-W0-xDw">
466
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
467
+                                                                    <connections>
468
+                                                                        <action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/>
469
+                                                                    </connections>
470
+                                                                </menuItem>
471
+                                                            </items>
472
+                                                        </menu>
473
+                                                    </menuItem>
474
+                                                    <menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
475
+                                                    <menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
476
+                                                        <connections>
477
+                                                            <action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/>
478
+                                                        </connections>
479
+                                                    </menuItem>
480
+                                                    <menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
481
+                                                    <menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
482
+                                                        <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
483
+                                                        <connections>
484
+                                                            <action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/>
485
+                                                        </connections>
486
+                                                    </menuItem>
487
+                                                    <menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
488
+                                                        <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
489
+                                                        <connections>
490
+                                                            <action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/>
491
+                                                        </connections>
492
+                                                    </menuItem>
493
+                                                </items>
494
+                                            </menu>
495
+                                        </menuItem>
496
+                                        <menuItem title="Text" id="Fal-I4-PZk">
497
+                                            <modifierMask key="keyEquivalentModifierMask"/>
498
+                                            <menu key="submenu" title="Text" id="d9c-me-L2H">
499
+                                                <items>
500
+                                                    <menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
501
+                                                        <connections>
502
+                                                            <action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/>
503
+                                                        </connections>
504
+                                                    </menuItem>
505
+                                                    <menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
506
+                                                        <connections>
507
+                                                            <action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/>
508
+                                                        </connections>
509
+                                                    </menuItem>
510
+                                                    <menuItem title="Justify" id="J5U-5w-g23">
511
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
512
+                                                        <connections>
513
+                                                            <action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/>
514
+                                                        </connections>
515
+                                                    </menuItem>
516
+                                                    <menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
517
+                                                        <connections>
518
+                                                            <action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/>
519
+                                                        </connections>
520
+                                                    </menuItem>
521
+                                                    <menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
522
+                                                    <menuItem title="Writing Direction" id="H1b-Si-o9J">
523
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
524
+                                                        <menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
525
+                                                            <items>
526
+                                                                <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
527
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
528
+                                                                </menuItem>
529
+                                                                <menuItem title="  Default" id="YGs-j5-SAR">
530
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
531
+                                                                    <connections>
532
+                                                                        <action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
533
+                                                                    </connections>
534
+                                                                </menuItem>
535
+                                                                <menuItem title="  Left to Right" id="Lbh-J2-qVU">
536
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
537
+                                                                    <connections>
538
+                                                                        <action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
539
+                                                                    </connections>
540
+                                                                </menuItem>
541
+                                                                <menuItem title="  Right to Left" id="jFq-tB-4Kx">
542
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
543
+                                                                    <connections>
544
+                                                                        <action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
545
+                                                                    </connections>
546
+                                                                </menuItem>
547
+                                                                <menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
548
+                                                                <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
549
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
550
+                                                                </menuItem>
551
+                                                                <menuItem title="  Default" id="Nop-cj-93Q">
552
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
553
+                                                                    <connections>
554
+                                                                        <action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
555
+                                                                    </connections>
556
+                                                                </menuItem>
557
+                                                                <menuItem title="  Left to Right" id="BgM-ve-c93">
558
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
559
+                                                                    <connections>
560
+                                                                        <action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
561
+                                                                    </connections>
562
+                                                                </menuItem>
563
+                                                                <menuItem title="  Right to Left" id="RB4-Sm-HuC">
564
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
565
+                                                                    <connections>
566
+                                                                        <action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
567
+                                                                    </connections>
568
+                                                                </menuItem>
569
+                                                            </items>
570
+                                                        </menu>
571
+                                                    </menuItem>
572
+                                                    <menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
573
+                                                    <menuItem title="Show Ruler" id="vLm-3I-IUL">
574
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
575
+                                                        <connections>
576
+                                                            <action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/>
577
+                                                        </connections>
578
+                                                    </menuItem>
579
+                                                    <menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
580
+                                                        <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
581
+                                                        <connections>
582
+                                                            <action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/>
583
+                                                        </connections>
584
+                                                    </menuItem>
585
+                                                    <menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
586
+                                                        <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
587
+                                                        <connections>
588
+                                                            <action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/>
589
+                                                        </connections>
590
+                                                    </menuItem>
591
+                                                </items>
592
+                                            </menu>
593
+                                        </menuItem>
594
+                                    </items>
595
+                                </menu>
596
+                            </menuItem>
597
+                            <menuItem title="View" id="H8h-7b-M4v">
598
+                                <modifierMask key="keyEquivalentModifierMask"/>
599
+                                <menu key="submenu" title="View" id="HyV-fh-RgO">
600
+                                    <items>
601
+                                        <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
602
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
603
+                                            <connections>
604
+                                                <action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
605
+                                            </connections>
606
+                                        </menuItem>
607
+                                        <menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
608
+                                            <modifierMask key="keyEquivalentModifierMask"/>
609
+                                            <connections>
610
+                                                <action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
611
+                                            </connections>
612
+                                        </menuItem>
613
+                                        <menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
614
+                                        <menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
615
+                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
616
+                                            <connections>
617
+                                                <action selector="toggleSidebar:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
618
+                                            </connections>
619
+                                        </menuItem>
620
+                                        <menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
621
+                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
622
+                                            <connections>
623
+                                                <action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
624
+                                            </connections>
625
+                                        </menuItem>
626
+                                    </items>
627
+                                </menu>
628
+                            </menuItem>
629
+                            <menuItem title="Window" id="aUF-d1-5bR">
630
+                                <modifierMask key="keyEquivalentModifierMask"/>
631
+                                <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
632
+                                    <items>
633
+                                        <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
634
+                                            <connections>
635
+                                                <action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
636
+                                            </connections>
637
+                                        </menuItem>
638
+                                        <menuItem title="Zoom" id="R4o-n2-Eq4">
639
+                                            <modifierMask key="keyEquivalentModifierMask"/>
640
+                                            <connections>
641
+                                                <action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
642
+                                            </connections>
643
+                                        </menuItem>
644
+                                        <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
645
+                                        <menuItem title="Bring All to Front" id="LE2-aR-0XJ">
646
+                                            <modifierMask key="keyEquivalentModifierMask"/>
647
+                                            <connections>
648
+                                                <action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
649
+                                            </connections>
650
+                                        </menuItem>
651
+                                    </items>
652
+                                </menu>
653
+                            </menuItem>
654
+                            <menuItem title="Help" id="wpr-3q-Mcd">
655
+                                <modifierMask key="keyEquivalentModifierMask"/>
656
+                                <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
657
+                                    <items>
658
+                                        <menuItem title="rncTesterApp-macOS Help" keyEquivalent="?" id="FKE-Sm-Kum">
659
+                                            <connections>
660
+                                                <action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
661
+                                            </connections>
662
+                                        </menuItem>
663
+                                    </items>
664
+                                </menu>
665
+                            </menuItem>
666
+                        </items>
667
+                    </menu>
668
+                    <connections>
669
+                        <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
670
+                    </connections>
671
+                </application>
672
+                <customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
673
+                <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
674
+                <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
675
+            </objects>
676
+            <point key="canvasLocation" x="75" y="0.0"/>
677
+        </scene>
678
+        <!--Window Controller-->
679
+        <scene sceneID="R2V-B0-nI4">
680
+            <objects>
681
+                <windowController id="B8D-0N-5wS" sceneMemberID="viewController">
682
+                    <window key="window" title="RNCWebViewExample macOS" allowsToolTipsWhenApplicationIsInactive="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
683
+                        <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
684
+                        <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
685
+                        <rect key="contentRect" x="196" y="240" width="480" height="270"/>
686
+                        <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
687
+                        <connections>
688
+                            <outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
689
+                        </connections>
690
+                    </window>
691
+                    <connections>
692
+                        <segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
693
+                    </connections>
694
+                </windowController>
695
+                <customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
696
+            </objects>
697
+            <point key="canvasLocation" x="75" y="250"/>
698
+        </scene>
699
+        <!--View Controller-->
700
+        <scene sceneID="hIz-AP-VOD">
701
+            <objects>
702
+                <viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
703
+                    <view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
704
+                        <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
705
+                        <autoresizingMask key="autoresizingMask"/>
706
+                    </view>
707
+                </viewController>
708
+                <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
709
+            </objects>
710
+            <point key="canvasLocation" x="75" y="655"/>
711
+        </scene>
712
+    </scenes>
713
+</document>

+ 12
- 0
example/macos/RNCWebViewExample-macOS/ViewController.h View File

@@ -0,0 +1,12 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <Cocoa/Cocoa.h>
9
+
10
+@interface ViewController : NSViewController
11
+
12
+@end

+ 29
- 0
example/macos/RNCWebViewExample-macOS/ViewController.m View File

@@ -0,0 +1,29 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import "ViewController.h"
9
+#import "AppDelegate.h"
10
+
11
+#import <React/RCTRootView.h>
12
+
13
+@implementation ViewController
14
+
15
+- (void)viewDidLoad {
16
+  [super viewDidLoad];
17
+
18
+  RCTBridge *bridge = [((AppDelegate *)[NSApp delegate])bridge];
19
+  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"RNCWebViewExample" initialProperties:nil];
20
+
21
+  NSView *view = [self view];
22
+
23
+  [view addSubview:rootView];
24
+  [rootView setBackgroundColor:[NSColor windowBackgroundColor]];
25
+  [rootView setFrame:[view bounds]];
26
+  [rootView setAutoresizingMask:(NSViewMinXMargin | NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable)];
27
+}
28
+
29
+@end

+ 12
- 0
example/macos/RNCWebViewExample-macOS/main.m View File

@@ -0,0 +1,12 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <Cocoa/Cocoa.h>
9
+
10
+int main(int argc, const char *argv[]) {
11
+  return NSApplicationMain(argc, argv);
12
+}

+ 1539
- 0
example/macos/RNCWebViewExample.xcodeproj/project.pbxproj
File diff suppressed because it is too large
View File


+ 78
- 0
example/macos/RNCWebViewExample.xcodeproj/xcshareddata/xcschemes/RNCWebViewExample-macOS.xcscheme View File

@@ -0,0 +1,78 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "1120"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
8
+      <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "38C1415723BBE33000902604"
18
+               BuildableName = "RNCWebViewExample-macOS.app"
19
+               BlueprintName = "RNCWebViewExample-macOS"
20
+               ReferencedContainer = "container:RNCWebViewExample.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+      </Testables>
32
+   </TestAction>
33
+   <LaunchAction
34
+      buildConfiguration = "Debug"
35
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
+      launchStyle = "0"
38
+      useCustomWorkingDirectory = "NO"
39
+      ignoresPersistentStateOnLaunch = "NO"
40
+      debugDocumentVersioning = "YES"
41
+      debugServiceExtension = "internal"
42
+      allowLocationSimulation = "YES">
43
+      <BuildableProductRunnable
44
+         runnableDebuggingMode = "0">
45
+         <BuildableReference
46
+            BuildableIdentifier = "primary"
47
+            BlueprintIdentifier = "38C1415723BBE33000902604"
48
+            BuildableName = "RNCWebViewExample-macOS.app"
49
+            BlueprintName = "RNCWebViewExample-macOS"
50
+            ReferencedContainer = "container:RNCWebViewExample.xcodeproj">
51
+         </BuildableReference>
52
+      </BuildableProductRunnable>
53
+   </LaunchAction>
54
+   <ProfileAction
55
+      buildConfiguration = "Release"
56
+      shouldUseLaunchSchemeArgsEnv = "YES"
57
+      savedToolIdentifier = ""
58
+      useCustomWorkingDirectory = "NO"
59
+      debugDocumentVersioning = "YES">
60
+      <BuildableProductRunnable
61
+         runnableDebuggingMode = "0">
62
+         <BuildableReference
63
+            BuildableIdentifier = "primary"
64
+            BlueprintIdentifier = "38C1415723BBE33000902604"
65
+            BuildableName = "RNCWebViewExample-macOS.app"
66
+            BlueprintName = "RNCWebViewExample-macOS"
67
+            ReferencedContainer = "container:RNCWebViewExample.xcodeproj">
68
+         </BuildableReference>
69
+      </BuildableProductRunnable>
70
+   </ProfileAction>
71
+   <AnalyzeAction
72
+      buildConfiguration = "Debug">
73
+   </AnalyzeAction>
74
+   <ArchiveAction
75
+      buildConfiguration = "Release"
76
+      revealArchiveInOrganizer = "YES">
77
+   </ArchiveAction>
78
+</Scheme>

+ 78
- 0
example/macos/RNCWebViewExample.xcodeproj/xcshareddata/xcschemes/RNCWebViewExample.xcscheme View File

@@ -0,0 +1,78 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "1120"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
8
+      <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
+               BuildableName = "RNCWebViewExample.app"
19
+               BlueprintName = "RNCWebViewExample"
20
+               ReferencedContainer = "container:RNCWebViewExample.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+      </Testables>
32
+   </TestAction>
33
+   <LaunchAction
34
+      buildConfiguration = "Debug"
35
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
+      launchStyle = "0"
38
+      useCustomWorkingDirectory = "NO"
39
+      ignoresPersistentStateOnLaunch = "NO"
40
+      debugDocumentVersioning = "YES"
41
+      debugServiceExtension = "internal"
42
+      allowLocationSimulation = "YES">
43
+      <BuildableProductRunnable
44
+         runnableDebuggingMode = "0">
45
+         <BuildableReference
46
+            BuildableIdentifier = "primary"
47
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
48
+            BuildableName = "RNCWebViewExample.app"
49
+            BlueprintName = "RNCWebViewExample"
50
+            ReferencedContainer = "container:RNCWebViewExample.xcodeproj">
51
+         </BuildableReference>
52
+      </BuildableProductRunnable>
53
+   </LaunchAction>
54
+   <ProfileAction
55
+      buildConfiguration = "Release"
56
+      shouldUseLaunchSchemeArgsEnv = "YES"
57
+      savedToolIdentifier = ""
58
+      useCustomWorkingDirectory = "NO"
59
+      debugDocumentVersioning = "YES">
60
+      <BuildableProductRunnable
61
+         runnableDebuggingMode = "0">
62
+         <BuildableReference
63
+            BuildableIdentifier = "primary"
64
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
65
+            BuildableName = "RNCWebViewExample.app"
66
+            BlueprintName = "RNCWebViewExample"
67
+            ReferencedContainer = "container:RNCWebViewExample.xcodeproj">
68
+         </BuildableReference>
69
+      </BuildableProductRunnable>
70
+   </ProfileAction>
71
+   <AnalyzeAction
72
+      buildConfiguration = "Debug">
73
+   </AnalyzeAction>
74
+   <ArchiveAction
75
+      buildConfiguration = "Release"
76
+      revealArchiveInOrganizer = "YES">
77
+   </ArchiveAction>
78
+</Scheme>

+ 16
- 0
example/macos/RNCWebViewExample/AppDelegate.h View File

@@ -0,0 +1,16 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <React/RCTBridgeDelegate.h>
9
+#import <UIKit/UIKit.h>
10
+
11
+@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
12
+
13
+@property (nonatomic, strong) UIWindow *window;
14
+@property (nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *memoryStorage;
15
+
16
+@end

+ 46
- 0
example/macos/RNCWebViewExample/AppDelegate.m View File

@@ -0,0 +1,46 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import "AppDelegate.h"
9
+
10
+#import <React/RCTBridge.h>
11
+
12
+#import <React/RCTBundleURLProvider.h>
13
+#import <React/RCTDevMenu.h>
14
+#import <React/RCTRootView.h>
15
+
16
+@implementation AppDelegate {
17
+  __weak RCTBridge *_bridge;
18
+}
19
+
20
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
21
+{
22
+  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
23
+  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
24
+                                                   moduleName:@"RNCWebViewExample"
25
+                                            initialProperties:nil];
26
+
27
+  rootView.backgroundColor = [UIColor blackColor];
28
+
29
+  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
30
+  UIViewController *rootViewController = [UIViewController new];
31
+  rootViewController.view = rootView;
32
+  self.window.rootViewController = rootViewController;
33
+  [self.window makeKeyAndVisible];
34
+  return YES;
35
+}
36
+
37
+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
38
+{
39
+  #if DEBUG
40
+    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:nil];
41
+  #else
42
+    return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
43
+  #endif
44
+}
45
+
46
+@end

+ 42
- 0
example/macos/RNCWebViewExample/Base.lproj/LaunchScreen.xib View File

@@ -0,0 +1,42 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
3
+    <dependencies>
4
+        <deployment identifier="iOS"/>
5
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
6
+        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
7
+    </dependencies>
8
+    <objects>
9
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
10
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
11
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
12
+            <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
13
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
14
+            <subviews>
15
+                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
16
+                    <rect key="frame" x="20" y="439" width="441" height="21"/>
17
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
18
+                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
19
+                    <nil key="highlightedColor"/>
20
+                </label>
21
+                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RNCWebViewExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
22
+                    <rect key="frame" x="20" y="140" width="441" height="43"/>
23
+                    <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
24
+                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
25
+                    <nil key="highlightedColor"/>
26
+                </label>
27
+            </subviews>
28
+            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
29
+            <constraints>
30
+                <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
31
+                <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
32
+                <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
33
+                <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
34
+                <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
35
+                <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
36
+            </constraints>
37
+            <nil key="simulatedStatusBarMetrics"/>
38
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
39
+            <point key="canvasLocation" x="548" y="455"/>
40
+        </view>
41
+    </objects>
42
+</document>

+ 53
- 0
example/macos/RNCWebViewExample/Images.xcassets/AppIcon.appiconset/Contents.json View File

@@ -0,0 +1,53 @@
1
+{
2
+  "images" : [
3
+    {
4
+      "idiom" : "iphone",
5
+      "size" : "20x20",
6
+      "scale" : "2x"
7
+    },
8
+    {
9
+      "idiom" : "iphone",
10
+      "size" : "20x20",
11
+      "scale" : "3x"
12
+    },
13
+    {
14
+      "idiom" : "iphone",
15
+      "size" : "29x29",
16
+      "scale" : "2x"
17
+    },
18
+    {
19
+      "idiom" : "iphone",
20
+      "size" : "29x29",
21
+      "scale" : "3x"
22
+    },
23
+    {
24
+      "idiom" : "iphone",
25
+      "size" : "40x40",
26
+      "scale" : "2x"
27
+    },
28
+    {
29
+      "idiom" : "iphone",
30
+      "size" : "40x40",
31
+      "scale" : "3x"
32
+    },
33
+    {
34
+      "idiom" : "iphone",
35
+      "size" : "60x60",
36
+      "scale" : "2x"
37
+    },
38
+    {
39
+      "idiom" : "iphone",
40
+      "size" : "60x60",
41
+      "scale" : "3x"
42
+    },
43
+    {
44
+      "idiom" : "ios-marketing",
45
+      "size" : "1024x1024",
46
+      "scale" : "1x"
47
+    }
48
+  ],
49
+  "info" : {
50
+    "version" : 1,
51
+    "author" : "xcode"
52
+  }
53
+}

+ 6
- 0
example/macos/RNCWebViewExample/Images.xcassets/Contents.json View File

@@ -0,0 +1,6 @@
1
+{
2
+  "info" : {
3
+    "version" : 1,
4
+    "author" : "xcode"
5
+  }
6
+}

+ 70
- 0
example/macos/RNCWebViewExample/Info.plist View File

@@ -0,0 +1,70 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>CFBundleDevelopmentRegion</key>
6
+	<string>en</string>
7
+	<key>CFBundleDisplayName</key>
8
+	<string>RNCWebViewExample</string>
9
+	<key>CFBundleExecutable</key>
10
+	<string>$(EXECUTABLE_NAME)</string>
11
+	<key>CFBundleIdentifier</key>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+	<key>CFBundleInfoDictionaryVersion</key>
14
+	<string>6.0</string>
15
+	<key>CFBundleName</key>
16
+	<string>$(PRODUCT_NAME)</string>
17
+	<key>CFBundlePackageType</key>
18
+	<string>APPL</string>
19
+	<key>CFBundleShortVersionString</key>
20
+	<string>1.0</string>
21
+	<key>CFBundleSignature</key>
22
+	<string>????</string>
23
+	<key>CFBundleURLTypes</key>
24
+	<array>
25
+		<dict>
26
+			<key>CFBundleTypeRole</key>
27
+			<string>Editor</string>
28
+			<key>CFBundleURLName</key>
29
+			<string>org.reactjs.native.example.RNCWebViewExample</string>
30
+			<key>CFBundleURLSchemes</key>
31
+			<array>
32
+				<string>rnc-webview</string>
33
+			</array>
34
+		</dict>
35
+	</array>
36
+	<key>CFBundleVersion</key>
37
+	<string>1</string>
38
+	<key>LSRequiresIPhoneOS</key>
39
+	<true/>
40
+	<key>NSAppTransportSecurity</key>
41
+	<dict>
42
+		<key>NSAllowsArbitraryLoads</key>
43
+		<true/>
44
+		<key>NSExceptionDomains</key>
45
+		<dict>
46
+			<key>localhost</key>
47
+			<dict>
48
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
49
+				<true/>
50
+			</dict>
51
+		</dict>
52
+	</dict>
53
+	<key>NSLocationWhenInUseUsageDescription</key>
54
+	<string></string>
55
+	<key>UILaunchStoryboardName</key>
56
+	<string>LaunchScreen</string>
57
+	<key>UIRequiredDeviceCapabilities</key>
58
+	<array>
59
+		<string>armv7</string>
60
+	</array>
61
+	<key>UISupportedInterfaceOrientations</key>
62
+	<array>
63
+		<string>UIInterfaceOrientationPortrait</string>
64
+		<string>UIInterfaceOrientationLandscapeLeft</string>
65
+		<string>UIInterfaceOrientationLandscapeRight</string>
66
+	</array>
67
+	<key>UIViewControllerBasedStatusBarAppearance</key>
68
+	<false/>
69
+</dict>
70
+</plist>

+ 16
- 0
example/macos/RNCWebViewExample/main.m View File

@@ -0,0 +1,16 @@
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+#import <UIKit/UIKit.h>
9
+
10
+#import "AppDelegate.h"
11
+
12
+int main(int argc, char * argv[]) {
13
+  @autoreleasepool {
14
+    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15
+  }
16
+}

+ 1
- 1
package.json View File

@@ -54,7 +54,7 @@
54 54
     "jest": "24.9.0",
55 55
     "metro-react-native-babel-preset": "0.54.1",
56 56
     "react": "16.6.3",
57
-    "react-native": "0.60.5",
57
+    "react-native": "git://github.com/microsoft/react-native",
58 58
     "semantic-release": "15.13.24",
59 59
     "typescript": "3.6.2"
60 60
   },

+ 440
- 99
yarn.lock
File diff suppressed because it is too large
View File