@lynxship/cli 0.1.19 → 0.1.21
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/README.md +66 -5
- package/dist/android/signing.d.ts +16 -0
- package/dist/android/signing.d.ts.map +1 -0
- package/dist/android/signing.js +131 -0
- package/dist/android/types.d.ts +12 -0
- package/dist/android/types.d.ts.map +1 -0
- package/dist/android/types.js +1 -0
- package/dist/android-build.d.ts +4 -13
- package/dist/android-build.d.ts.map +1 -1
- package/dist/android-build.js +14 -133
- package/dist/android-toolchain/inspection.d.ts +3 -0
- package/dist/android-toolchain/inspection.d.ts.map +1 -0
- package/dist/android-toolchain/inspection.js +122 -0
- package/dist/android-toolchain/probes.d.ts +23 -0
- package/dist/android-toolchain/probes.d.ts.map +1 -0
- package/dist/android-toolchain/probes.js +183 -0
- package/dist/android-toolchain/types.d.ts +20 -0
- package/dist/android-toolchain/types.d.ts.map +1 -0
- package/dist/android-toolchain/types.js +1 -0
- package/dist/android-toolchain.d.ts +4 -20
- package/dist/android-toolchain.d.ts.map +1 -1
- package/dist/android-toolchain.js +4 -300
- package/dist/app-config.d.ts +25 -0
- package/dist/app-config.d.ts.map +1 -0
- package/dist/app-config.js +106 -0
- package/dist/bundle-build.d.ts.map +1 -1
- package/dist/bundle-build.js +11 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +66 -0
- package/dist/commands/build-execution.d.ts +41 -0
- package/dist/commands/build-execution.d.ts.map +1 -0
- package/dist/commands/build-execution.js +182 -0
- package/dist/commands/configuration.d.ts +19 -0
- package/dist/commands/configuration.d.ts.map +1 -0
- package/dist/commands/configuration.js +174 -0
- package/dist/commands/development.d.ts +22 -0
- package/dist/commands/development.d.ts.map +1 -0
- package/dist/commands/development.js +132 -0
- package/dist/commands/device.d.ts +3 -0
- package/dist/commands/device.d.ts.map +1 -0
- package/dist/commands/device.js +86 -0
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +320 -0
- package/dist/commands/help.d.ts +2 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +118 -0
- package/dist/commands/i18n.d.ts +14 -0
- package/dist/commands/i18n.d.ts.map +1 -0
- package/dist/commands/i18n.js +88 -0
- package/dist/commands/logs.d.ts +3 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +51 -0
- package/dist/commands/metadata.d.ts +3 -0
- package/dist/commands/metadata.d.ts.map +1 -0
- package/dist/commands/metadata.js +45 -0
- package/dist/commands/ota.d.ts +28 -0
- package/dist/commands/ota.d.ts.map +1 -0
- package/dist/commands/ota.js +203 -0
- package/dist/commands/project.d.ts +14 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +122 -0
- package/dist/commands/remote-build.d.ts +35 -0
- package/dist/commands/remote-build.d.ts.map +1 -0
- package/dist/commands/remote-build.js +73 -0
- package/dist/commands/submit.d.ts +27 -0
- package/dist/commands/submit.d.ts.map +1 -0
- package/dist/commands/submit.js +92 -0
- package/dist/ecosystem.d.ts +9 -0
- package/dist/ecosystem.d.ts.map +1 -0
- package/dist/ecosystem.js +95 -0
- package/dist/frameworks.d.ts.map +1 -1
- package/dist/frameworks.js +5 -1
- package/dist/guidance/catalog.d.ts +3 -0
- package/dist/guidance/catalog.d.ts.map +1 -0
- package/dist/guidance/catalog.js +504 -0
- package/dist/guidance/types.d.ts +10 -0
- package/dist/guidance/types.d.ts.map +1 -0
- package/dist/guidance/types.js +1 -0
- package/dist/guidance.d.ts +2 -9
- package/dist/guidance.d.ts.map +1 -1
- package/dist/guidance.js +1 -502
- package/dist/i18n/discovery.d.ts +14 -0
- package/dist/i18n/discovery.d.ts.map +1 -0
- package/dist/i18n/discovery.js +106 -0
- package/dist/i18n/plan.d.ts +12 -0
- package/dist/i18n/plan.d.ts.map +1 -0
- package/dist/i18n/plan.js +95 -0
- package/dist/i18n/setup.d.ts +11 -0
- package/dist/i18n/setup.d.ts.map +1 -0
- package/dist/i18n/setup.js +47 -0
- package/dist/i18n/types.d.ts +17 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2069
- package/dist/ios/assets.d.ts +19 -0
- package/dist/ios/assets.d.ts.map +1 -0
- package/dist/ios/assets.js +128 -0
- package/dist/ios/production-build.d.ts +6 -0
- package/dist/ios/production-build.d.ts.map +1 -0
- package/dist/ios/production-build.js +200 -0
- package/dist/ios/project.d.ts +4 -0
- package/dist/ios/project.d.ts.map +1 -0
- package/dist/ios/project.js +43 -0
- package/dist/ios/simulator-build.d.ts +8 -0
- package/dist/ios/simulator-build.d.ts.map +1 -0
- package/dist/ios/simulator-build.js +188 -0
- package/dist/ios/simulator.d.ts +5 -0
- package/dist/ios/simulator.d.ts.map +1 -0
- package/dist/ios/simulator.js +60 -0
- package/dist/ios/types.d.ts +14 -0
- package/dist/ios/types.d.ts.map +1 -0
- package/dist/ios/types.js +1 -0
- package/dist/ios-build.d.ts +4 -37
- package/dist/ios-build.d.ts.map +1 -1
- package/dist/ios-build.js +3 -575
- package/dist/ios-host.d.ts.map +1 -1
- package/dist/ios-toolchain/inspection.d.ts +4 -0
- package/dist/ios-toolchain/inspection.d.ts.map +1 -0
- package/dist/ios-toolchain/inspection.js +211 -0
- package/dist/ios-toolchain/probes.d.ts +24 -0
- package/dist/ios-toolchain/probes.d.ts.map +1 -0
- package/dist/ios-toolchain/probes.js +127 -0
- package/dist/ios-toolchain/types.d.ts +17 -0
- package/dist/ios-toolchain/types.d.ts.map +1 -0
- package/dist/ios-toolchain/types.js +1 -0
- package/dist/ios-toolchain.d.ts +3 -18
- package/dist/ios-toolchain.d.ts.map +1 -1
- package/dist/ios-toolchain.js +1 -333
- package/dist/plugins/contracts.d.ts +28 -0
- package/dist/plugins/contracts.d.ts.map +1 -0
- package/dist/plugins/contracts.js +1 -0
- package/dist/plugins/discovery.d.ts +19 -0
- package/dist/plugins/discovery.d.ts.map +1 -0
- package/dist/plugins/discovery.js +250 -0
- package/dist/plugins/native-operations.d.ts +28 -0
- package/dist/plugins/native-operations.d.ts.map +1 -0
- package/dist/plugins/native-operations.js +217 -0
- package/dist/plugins/operations.d.ts +9 -0
- package/dist/plugins/operations.d.ts.map +1 -0
- package/dist/plugins/operations.js +76 -0
- package/dist/plugins/validation.d.ts +9 -0
- package/dist/plugins/validation.d.ts.map +1 -0
- package/dist/plugins/validation.js +52 -0
- package/dist/plugins.d.ts +3 -34
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +2 -595
- package/dist/process-runner.d.ts +4 -0
- package/dist/process-runner.d.ts.map +1 -1
- package/dist/process-runner.js +14 -0
- package/dist/remote.d.ts +22 -1
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +141 -2
- package/dist/rspeedy-app-config.d.ts +4 -0
- package/dist/rspeedy-app-config.d.ts.map +1 -0
- package/dist/rspeedy-app-config.js +32 -0
- package/dist/runtime/args.d.ts +3 -0
- package/dist/runtime/args.d.ts.map +1 -0
- package/dist/runtime/args.js +11 -0
- package/dist/runtime/build-commands.d.ts +3 -0
- package/dist/runtime/build-commands.d.ts.map +1 -0
- package/dist/runtime/build-commands.js +282 -0
- package/dist/runtime/context.d.ts +63 -0
- package/dist/runtime/context.d.ts.map +1 -0
- package/dist/runtime/context.js +179 -0
- package/dist/runtime/early-commands.d.ts +4 -0
- package/dist/runtime/early-commands.d.ts.map +1 -0
- package/dist/runtime/early-commands.js +284 -0
- package/dist/runtime/project.d.ts +8 -0
- package/dist/runtime/project.d.ts.map +1 -0
- package/dist/runtime/project.js +38 -0
- package/dist/runtime/state.d.ts +47 -0
- package/dist/runtime/state.d.ts.map +1 -0
- package/dist/runtime/state.js +33 -0
- package/dist/secure-store/backends.d.ts +20 -0
- package/dist/secure-store/backends.d.ts.map +1 -0
- package/dist/secure-store/backends.js +248 -0
- package/dist/secure-store/types.d.ts +27 -0
- package/dist/secure-store/types.d.ts.map +1 -0
- package/dist/secure-store/types.js +1 -0
- package/dist/secure-store.d.ts +2 -26
- package/dist/secure-store.d.ts.map +1 -1
- package/dist/secure-store.js +3 -245
- package/dist/ui/components.d.ts.map +1 -1
- package/dist/ui/components.js +2 -1
- package/package.json +7 -4
- package/templates/android-host/app/build.gradle +1 -0
- package/templates/android-host/app/src/main/java/template/MainActivity.java +98 -3
- package/templates/ios-host/__IOS_TARGET_NAME__/DemoLynxProvider.swift +26 -16
- package/templates/ios-host/__IOS_TARGET_NAME__/ViewController.swift +107 -19
|
@@ -1,19 +1,114 @@
|
|
|
1
1
|
package __PACKAGE_NAME__;
|
|
2
2
|
|
|
3
3
|
import android.app.Activity;
|
|
4
|
+
import android.graphics.Color;
|
|
4
5
|
import android.os.Bundle;
|
|
6
|
+
import android.view.Gravity;
|
|
7
|
+
import android.view.View;
|
|
8
|
+
import android.widget.FrameLayout;
|
|
9
|
+
import android.widget.ProgressBar;
|
|
10
|
+
import android.widget.TextView;
|
|
5
11
|
|
|
12
|
+
import com.lynx.tasm.LynxError;
|
|
6
13
|
import com.lynx.tasm.LynxView;
|
|
14
|
+
import com.lynx.tasm.LynxViewClient;
|
|
7
15
|
import com.lynx.tasm.LynxViewBuilder;
|
|
8
16
|
|
|
9
17
|
public final class MainActivity extends Activity {
|
|
18
|
+
private FrameLayout root;
|
|
19
|
+
private LynxView lynxView;
|
|
20
|
+
private ProgressBar loading;
|
|
21
|
+
private TextView errorView;
|
|
22
|
+
private LynxViewClient lifecycleClient;
|
|
23
|
+
|
|
10
24
|
@Override
|
|
11
25
|
protected void onCreate(Bundle savedInstanceState) {
|
|
12
26
|
super.onCreate(savedInstanceState);
|
|
13
|
-
|
|
27
|
+
|
|
28
|
+
root = new FrameLayout(this);
|
|
29
|
+
root.setBackgroundColor(Color.WHITE);
|
|
30
|
+
|
|
31
|
+
lynxView = new LynxViewBuilder()
|
|
14
32
|
.setTemplateProvider(new ProjectTemplateProvider(this))
|
|
15
33
|
.build(this);
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
lifecycleClient = new LynxViewClient() {
|
|
35
|
+
@Override
|
|
36
|
+
public void onPageStart(String url) {
|
|
37
|
+
runOnUiThread(() -> showLoading());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void onFirstScreen() {
|
|
42
|
+
runOnUiThread(() -> showContent());
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
public void onReceivedError(LynxError error) {
|
|
47
|
+
runOnUiThread(() -> showError(error == null ? "Lynx failed to load" : error.toString()));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
lynxView.addLynxViewClient(lifecycleClient);
|
|
51
|
+
|
|
52
|
+
root.addView(lynxView, new FrameLayout.LayoutParams(
|
|
53
|
+
FrameLayout.LayoutParams.MATCH_PARENT,
|
|
54
|
+
FrameLayout.LayoutParams.MATCH_PARENT));
|
|
55
|
+
setContentView(root);
|
|
56
|
+
|
|
57
|
+
loading = new ProgressBar(this);
|
|
58
|
+
FrameLayout.LayoutParams loadingParams = new FrameLayout.LayoutParams(
|
|
59
|
+
FrameLayout.LayoutParams.WRAP_CONTENT,
|
|
60
|
+
FrameLayout.LayoutParams.WRAP_CONTENT,
|
|
61
|
+
Gravity.CENTER);
|
|
62
|
+
root.addView(loading, loadingParams);
|
|
63
|
+
|
|
64
|
+
errorView = new TextView(this);
|
|
65
|
+
errorView.setGravity(Gravity.CENTER);
|
|
66
|
+
errorView.setTextColor(Color.DKGRAY);
|
|
67
|
+
errorView.setTextSize(16);
|
|
68
|
+
errorView.setPadding(48, 24, 48, 24);
|
|
69
|
+
errorView.setOnClickListener(view -> render());
|
|
70
|
+
FrameLayout.LayoutParams errorParams = new FrameLayout.LayoutParams(
|
|
71
|
+
FrameLayout.LayoutParams.MATCH_PARENT,
|
|
72
|
+
FrameLayout.LayoutParams.WRAP_CONTENT,
|
|
73
|
+
Gravity.CENTER);
|
|
74
|
+
errorParams.setMargins(32, 32, 32, 32);
|
|
75
|
+
root.addView(errorView, errorParams);
|
|
76
|
+
render();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private void render() {
|
|
80
|
+
showLoading();
|
|
81
|
+
try {
|
|
82
|
+
lynxView.renderTemplateUrl("main.lynx.bundle", "");
|
|
83
|
+
} catch (RuntimeException error) {
|
|
84
|
+
showError(error.getMessage() == null ? "Lynx failed to start" : error.getMessage());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private void showLoading() {
|
|
89
|
+
if (loading != null) loading.setVisibility(View.VISIBLE);
|
|
90
|
+
if (errorView != null) errorView.setVisibility(View.GONE);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private void showContent() {
|
|
94
|
+
if (loading != null) loading.setVisibility(View.GONE);
|
|
95
|
+
if (errorView != null) errorView.setVisibility(View.GONE);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private void showError(String message) {
|
|
99
|
+
if (loading != null) loading.setVisibility(View.GONE);
|
|
100
|
+
if (errorView != null) {
|
|
101
|
+
errorView.setText("Unable to load Lynx content.\nTap to retry.\n\n" + message);
|
|
102
|
+
errorView.setVisibility(View.VISIBLE);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@Override
|
|
107
|
+
protected void onDestroy() {
|
|
108
|
+
if (lynxView != null) {
|
|
109
|
+
if (lifecycleClient != null) lynxView.removeLynxViewClient(lifecycleClient);
|
|
110
|
+
lynxView.destroy();
|
|
111
|
+
}
|
|
112
|
+
super.onDestroy();
|
|
18
113
|
}
|
|
19
114
|
}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
|
|
3
|
-
class DemoLynxProvider: NSObject, LynxTemplateProvider {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
class DemoLynxProvider: NSObject, LynxTemplateProvider {
|
|
4
|
+
private let onError: (Error) -> Void
|
|
5
|
+
|
|
6
|
+
init(onError: @escaping (Error) -> Void) {
|
|
7
|
+
self.onError = onError
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
func loadTemplate(withUrl url: String!, onComplete callback: LynxTemplateLoadBlock!) {
|
|
11
|
+
let requestedURL = url ?? ""
|
|
12
|
+
DispatchQueue.global(qos: .userInitiated).async { [onError] in
|
|
13
|
+
guard let filePath = Bundle.main.path(forResource: requestedURL, ofType: "bundle")
|
|
14
|
+
?? Bundle.main.path(forResource: requestedURL, ofType: nil) else {
|
|
15
|
+
let urlError = NSError(domain: "com.lynx", code: 400, userInfo: [NSLocalizedDescriptionKey: "Invalid URL."])
|
|
16
|
+
onError(urlError)
|
|
17
|
+
callback(nil, urlError)
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
do {
|
|
21
|
+
callback(try Data(contentsOf: URL(fileURLWithPath: filePath)), nil)
|
|
22
|
+
} catch {
|
|
23
|
+
onError(error)
|
|
24
|
+
callback(nil, error)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,22 +1,110 @@
|
|
|
1
|
-
import UIKit
|
|
2
|
-
|
|
3
|
-
class ViewController: UIViewController {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import UIKit
|
|
2
|
+
|
|
3
|
+
class ViewController: UIViewController {
|
|
4
|
+
private var lynxView: LynxView!
|
|
5
|
+
private let loading = UIActivityIndicatorView(style: .large)
|
|
6
|
+
private let errorLabel = UILabel()
|
|
7
|
+
|
|
8
|
+
override func viewDidLoad() {
|
|
9
|
+
super.viewDidLoad()
|
|
10
|
+
|
|
11
|
+
view.backgroundColor = .systemBackground
|
|
12
|
+
lynxView = LynxView { [weak self] builder in
|
|
13
|
+
builder.config = LynxConfig(provider: DemoLynxProvider { [weak self] error in
|
|
14
|
+
DispatchQueue.main.async {
|
|
15
|
+
self?.showError(error.localizedDescription)
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
builder.screenSize = self.view.frame.size
|
|
11
19
|
builder.fontScale = 1.0
|
|
12
20
|
}
|
|
13
21
|
|
|
14
|
-
lynxView.preferredLayoutWidth =
|
|
15
|
-
lynxView.preferredLayoutHeight =
|
|
16
|
-
lynxView.layoutWidthMode = .exact
|
|
17
|
-
lynxView.layoutHeightMode = .exact
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
lynxView.preferredLayoutWidth = view.bounds.width
|
|
23
|
+
lynxView.preferredLayoutHeight = view.bounds.height
|
|
24
|
+
lynxView.layoutWidthMode = .exact
|
|
25
|
+
lynxView.layoutHeightMode = .exact
|
|
26
|
+
view.addSubview(lynxView)
|
|
27
|
+
|
|
28
|
+
loading.translatesAutoresizingMaskIntoConstraints = false
|
|
29
|
+
view.addSubview(loading)
|
|
30
|
+
NSLayoutConstraint.activate([
|
|
31
|
+
loading.centerXAnchor.constraint(equalTo: view.centerXAnchor),
|
|
32
|
+
loading.centerYAnchor.constraint(equalTo: view.centerYAnchor)
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
errorLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
36
|
+
errorLabel.textAlignment = .center
|
|
37
|
+
errorLabel.numberOfLines = 0
|
|
38
|
+
errorLabel.textColor = .secondaryLabel
|
|
39
|
+
errorLabel.isHidden = true
|
|
40
|
+
errorLabel.isUserInteractionEnabled = true
|
|
41
|
+
errorLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(retry)))
|
|
42
|
+
view.addSubview(errorLabel)
|
|
43
|
+
NSLayoutConstraint.activate([
|
|
44
|
+
errorLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 32),
|
|
45
|
+
errorLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -32),
|
|
46
|
+
errorLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor)
|
|
47
|
+
])
|
|
48
|
+
|
|
49
|
+
let lifecycle = LynxLifecycleClient(
|
|
50
|
+
onStart: { [weak self] in self?.showLoading() },
|
|
51
|
+
onFirstScreen: { [weak self] in self?.showContent() }
|
|
52
|
+
)
|
|
53
|
+
lynxView.addLifecycleClient(lifecycle)
|
|
54
|
+
|
|
55
|
+
load()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
override func viewDidLayoutSubviews() {
|
|
59
|
+
super.viewDidLayoutSubviews()
|
|
60
|
+
lynxView?.frame = view.bounds
|
|
61
|
+
lynxView?.preferredLayoutWidth = view.bounds.width
|
|
62
|
+
lynxView?.preferredLayoutHeight = view.bounds.height
|
|
63
|
+
lynxView?.updateViewport(withPreferredLayoutWidth: view.bounds.width,
|
|
64
|
+
preferredLayoutHeight: view.bounds.height,
|
|
65
|
+
needLayout: true)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private func load() {
|
|
69
|
+
showLoading()
|
|
70
|
+
lynxView.loadTemplate(fromURL: "main.lynx", initData: nil)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private func showLoading() {
|
|
74
|
+
loading.startAnimating()
|
|
75
|
+
errorLabel.isHidden = true
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private func showContent() {
|
|
79
|
+
loading.stopAnimating()
|
|
80
|
+
errorLabel.isHidden = true
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private func showError(_ message: String) {
|
|
84
|
+
loading.stopAnimating()
|
|
85
|
+
errorLabel.text = "Unable to load Lynx content.\nTap to retry.\n\n\(message)"
|
|
86
|
+
errorLabel.isHidden = false
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@objc private func retry() {
|
|
90
|
+
load()
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private final class LynxLifecycleClient: NSObject, LynxViewLifecycle {
|
|
95
|
+
private let onStart: () -> Void
|
|
96
|
+
private let onFirstScreen: () -> Void
|
|
97
|
+
|
|
98
|
+
init(onStart: @escaping () -> Void, onFirstScreen: @escaping () -> Void) {
|
|
99
|
+
self.onStart = onStart
|
|
100
|
+
self.onFirstScreen = onFirstScreen
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
func lynxViewDidStartLoading(_ view: LynxView) {
|
|
104
|
+
onStart()
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
func lynxViewDidFirstScreen(_ view: LynxView) {
|
|
108
|
+
onFirstScreen()
|
|
109
|
+
}
|
|
110
|
+
}
|