@capacitor/ios 3.2.3 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,49 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.3.1](https://github.com/ionic-team/capacitor/compare/3.3.0...3.3.1) (2021-11-05)
7
+
8
+ **Note:** Version bump only for package @capacitor/ios
9
+
10
+
11
+
12
+
13
+
14
+ # [3.3.0](https://github.com/ionic-team/capacitor/compare/3.2.5...3.3.0) (2021-11-03)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **core:** avoid crash on logging circular objects ([#5186](https://github.com/ionic-team/capacitor/issues/5186)) ([1451ec8](https://github.com/ionic-team/capacitor/commit/1451ec850a9ef73267a032638e73f1fc440647b9))
20
+ * **ios:** Avoid CDVScreenOrientationDelegate umbrella header warning ([#5156](https://github.com/ionic-team/capacitor/issues/5156)) ([31ec30d](https://github.com/ionic-team/capacitor/commit/31ec30de193aa3117dbb7eda928ef3a365d5667c))
21
+
22
+
23
+
24
+
25
+
26
+ ## [3.2.5](https://github.com/ionic-team/capacitor/compare/3.2.4...3.2.5) (2021-10-13)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **ios:** proper handling of allowNavigation with multiple wildcard ([#5096](https://github.com/ionic-team/capacitor/issues/5096)) ([cda17a6](https://github.com/ionic-team/capacitor/commit/cda17a6c1504235c1c1e4826830f1d0e2ef2d35c))
32
+
33
+
34
+
35
+
36
+
37
+ ## [3.2.4](https://github.com/ionic-team/capacitor/compare/3.2.3...3.2.4) (2021-09-27)
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * **ios:** Add CDVScreenOrientationDelegate protocol on CAPBridgeViewController ([#5070](https://github.com/ionic-team/capacitor/issues/5070)) ([530477d](https://github.com/ionic-team/capacitor/commit/530477d05e1364931f83a30d61d4f9b5cb687b19))
43
+ * **ios:** show correct line number on console logs ([#5073](https://github.com/ionic-team/capacitor/issues/5073)) ([ec41e74](https://github.com/ionic-team/capacitor/commit/ec41e743aa4ba81e791ad446fac461b7f43b46ed))
44
+
45
+
46
+
47
+
48
+
6
49
  ## [3.2.3](https://github.com/ionic-team/capacitor/compare/3.2.2...3.2.3) (2021-09-15)
7
50
 
8
51
  **Note:** Version bump only for package @capacitor/ios
@@ -0,0 +1,6 @@
1
+ #import <Capacitor/Capacitor-Swift.h>
2
+
3
+ @interface CAPBridgeViewController (CDVScreenOrientationDelegate) <CDVScreenOrientationDelegate>
4
+
5
+ @end
6
+
@@ -0,0 +1,5 @@
1
+ #import "CAPBridgeViewController+CDVScreenOrientationDelegate.h"
2
+
3
+ @implementation CAPBridgeViewController (CDVScreenOrientationDelegate)
4
+
5
+ @end
@@ -52,7 +52,7 @@ extension InstanceConfiguration {
52
52
  return false
53
53
  }
54
54
  // remove any wildcard segments
55
- for wildcard in patternComponents.enumerated().filter({ $0.element == "*" }) {
55
+ for wildcard in patternComponents.enumerated().reversed().filter({ $0.element == "*" }) {
56
56
  hostComponents.remove(at: wildcard.offset)
57
57
  patternComponents.remove(at: wildcard.offset)
58
58
  }
@@ -1,7 +1,8 @@
1
1
  framework module Capacitor {
2
2
  umbrella header "Capacitor.h"
3
3
  exclude header "CAPBridgedJSTypes.h"
4
-
4
+ exclude header "CAPBridgeViewController+CDVScreenOrientationDelegate.h"
5
+
5
6
  export *
6
7
  module * { export * }
7
- }
8
+ }
@@ -167,21 +167,6 @@ const nativeBridge = (function (exports) {
167
167
  win.Capacitor = cap;
168
168
  win.Ionic.WebView = IonicWebView;
169
169
  };
170
- const safeStringify = (value) => {
171
- const seen = new Set();
172
- return JSON.stringify(value, (_k, v) => {
173
- if (seen.has(v)) {
174
- if (v === null)
175
- return null;
176
- else
177
- return '...';
178
- }
179
- if (typeof v === 'object') {
180
- seen.add(v);
181
- }
182
- return v;
183
- });
184
- };
185
170
  const initLogger = (win, cap) => {
186
171
  const BRIDGED_CONSOLE_METHODS = [
187
172
  'debug',
@@ -248,7 +233,7 @@ const nativeBridge = (function (exports) {
248
233
  const serializeConsoleMessage = (msg) => {
249
234
  if (typeof msg === 'object') {
250
235
  try {
251
- msg = safeStringify(msg);
236
+ msg = JSON.stringify(msg);
252
237
  }
253
238
  catch (e) {
254
239
  // ignore
@@ -258,24 +243,21 @@ const nativeBridge = (function (exports) {
258
243
  };
259
244
  // patch window.console on iOS and store original console fns
260
245
  const isIos = getPlatformId(win) === 'ios';
261
- const originalConsole = Object.assign({}, win.console);
262
246
  if (win.console && isIos) {
263
- for (const logfn of BRIDGED_CONSOLE_METHODS) {
264
- win.console[logfn] = (...args) => {
265
- const msgs = [...args];
266
- originalConsole[logfn](...msgs);
267
- try {
247
+ Object.defineProperties(win.console, BRIDGED_CONSOLE_METHODS.reduce((props, method) => {
248
+ const consoleMethod = win.console[method].bind(win.console);
249
+ props[method] = {
250
+ value: (...args) => {
251
+ const msgs = [...args];
268
252
  cap.toNative('Console', 'log', {
269
- level: logfn,
253
+ level: method,
270
254
  message: msgs.map(serializeConsoleMessage).join(' '),
271
255
  });
272
- }
273
- catch (e) {
274
- // error converting/posting console messages
275
- originalConsole.error(e);
276
- }
256
+ return consoleMethod(...args);
257
+ },
277
258
  };
278
- }
259
+ return props;
260
+ }, {}));
279
261
  }
280
262
  cap.logJs = (msg, level) => {
281
263
  switch (level) {
@@ -320,7 +302,7 @@ const nativeBridge = (function (exports) {
320
302
  postToNative = data => {
321
303
  var _a;
322
304
  try {
323
- win.androidBridge.postMessage(safeStringify(data));
305
+ win.androidBridge.postMessage(JSON.stringify(data));
324
306
  }
325
307
  catch (e) {
326
308
  (_a = win === null || win === void 0 ? void 0 : win.console) === null || _a === void 0 ? void 0 : _a.error(e);
@@ -351,7 +333,7 @@ const nativeBridge = (function (exports) {
351
333
  url: url,
352
334
  line: lineNo,
353
335
  col: columnNo,
354
- errorObject: safeStringify(err),
336
+ errorObject: JSON.stringify(err),
355
337
  },
356
338
  };
357
339
  if (err !== null) {
@@ -501,4 +483,4 @@ const nativeBridge = (function (exports) {
501
483
 
502
484
  return exports;
503
485
 
504
- }({}));
486
+ })({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "3.2.3",
3
+ "version": "3.3.1",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -24,10 +24,10 @@
24
24
  "xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd .."
25
25
  },
26
26
  "peerDependencies": {
27
- "@capacitor/core": "^3.2.0"
27
+ "@capacitor/core": "^3.3.0"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "17bc41fa2e03f29016c8e48de1a6d68510a9f83b"
32
+ "gitHead": "8ff7434e9b775e6acb05efae23771ee1b18e26c9"
33
33
  }