From 99298331c82c937c51b8d055a40e664b463ea3d9 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Wed, 6 Oct 2021 12:49:47 +0200 Subject: [PATCH 1/8] fix(webpack): exclude files starting with _ from require.context (#9596) --- .../configuration/__snapshots__/javascript.spec.ts.snap | 8 ++++++++ .../configuration/__snapshots__/typescript.spec.ts.snap | 8 ++++++++ packages/webpack5/src/configuration/javascript.ts | 6 ++++++ packages/webpack5/src/configuration/typescript.ts | 6 ++++++ 4 files changed, 28 insertions(+) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap index 7963019e3..8e642f69f 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap @@ -318,6 +318,10 @@ exports[`javascript configuration for android 1`] = ` { '__jest__/src/__@nativescript_webpack_virtual_entry_javascript__': '// VIRTUAL ENTRY START\\\\nrequire(\\\\'@nativescript/core/bundle-entry-points\\\\')\\\\nconst context = require.context(\\"~/\\", /* deep: */ true, /* filter: */ /.(xml|js|s?css)$/);\\\\nglobal.registerWebpackModules(context);\\\\n// VIRTUAL ENTRY END' } + ), + /* config.plugin('ContextExclusionPlugin|exclude_files') */ + new ContextExclusionPlugin( + /\\\\b_.+\\\\./ ) ], entry: { @@ -651,6 +655,10 @@ exports[`javascript configuration for ios 1`] = ` { '__jest__/src/__@nativescript_webpack_virtual_entry_javascript__': '// VIRTUAL ENTRY START\\\\nrequire(\\\\'@nativescript/core/bundle-entry-points\\\\')\\\\nconst context = require.context(\\"~/\\", /* deep: */ true, /* filter: */ /.(xml|js|s?css)$/);\\\\nglobal.registerWebpackModules(context);\\\\n// VIRTUAL ENTRY END' } + ), + /* config.plugin('ContextExclusionPlugin|exclude_files') */ + new ContextExclusionPlugin( + /\\\\b_.+\\\\./ ) ], entry: { diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap index c32035b0b..c3ccd94a5 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap @@ -318,6 +318,10 @@ exports[`typescript configuration for android 1`] = ` { '__jest__/src/__@nativescript_webpack_virtual_entry_typescript__': '// VIRTUAL ENTRY START\\\\nrequire(\\\\'@nativescript/core/bundle-entry-points\\\\')\\\\nconst context = require.context(\\"~/\\", /* deep: */ true, /* filter: */ /\\\\\\\\.(xml|js|(? Date: Wed, 6 Oct 2021 08:47:56 -0700 Subject: [PATCH 2/8] fix(ios): TextView respect editable binding (#9589) --- packages/core/ui/text-view/index.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/ui/text-view/index.ios.ts b/packages/core/ui/text-view/index.ios.ts index f587f69cc..8cbeeb1d4 100644 --- a/packages/core/ui/text-view/index.ios.ts +++ b/packages/core/ui/text-view/index.ios.ts @@ -134,7 +134,7 @@ export class TextView extends TextViewBaseCommon { this.showText(); } - return true; + return this.editable; } public textViewDidBeginEditing(textView: UITextView): void { From 77d253379802487007c138ca025ac21f9bece002 Mon Sep 17 00:00:00 2001 From: Janos Hrubos <33330538+janoshrubos@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:48:52 +0200 Subject: [PATCH 3/8] feat: android openFile dialog title (#9600) * feat: android openFile dialog title * types: update openFile types --- packages/core/utils/index.android.ts | 4 ++-- packages/core/utils/index.d.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/utils/index.android.ts b/packages/core/utils/index.android.ts index 98f1fdb4f..827068c4b 100644 --- a/packages/core/utils/index.android.ts +++ b/packages/core/utils/index.android.ts @@ -81,7 +81,7 @@ function getMimeTypeNameFromExtension(filePath: string): string { * @param {string} filePath * @returns {boolean} whether opening the file succeeded or not */ -export function openFile(filePath: string): boolean { +export function openFile(filePath: string, title: string = 'Open File...'): boolean { const context = ad.getApplicationContext(); try { // Ensure external storage is available @@ -108,7 +108,7 @@ Applications cannot access internal storage of other application on Android (see // Determine file mimetype & start creating intent const mimeType = getMimeTypeNameFromExtension(filePath); const intent = new android.content.Intent(android.content.Intent.ACTION_VIEW); - const chooserIntent = android.content.Intent.createChooser(intent, 'Open File...'); + const chooserIntent = android.content.Intent.createChooser(intent, title); intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); chooserIntent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); diff --git a/packages/core/utils/index.d.ts b/packages/core/utils/index.d.ts index ec047b899..339da5019 100644 --- a/packages/core/utils/index.d.ts +++ b/packages/core/utils/index.d.ts @@ -242,8 +242,9 @@ export function openUrl(url: string): boolean; /** * Opens file. * @param filePath The file. + * @param title Optional title for Android. Default is: 'Open File...' */ -export function openFile(filePath: string): boolean; +export function openFile(filePath: string, title?: string): boolean; /** * Escapes special regex symbols (., *, ^, $ and so on) in string in order to create a valid regex from it. From 6374c470131e32261808d6fcabfd96bb68af09f5 Mon Sep 17 00:00:00 2001 From: Janos Hrubos <33330538+janoshrubos@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:49:30 +0200 Subject: [PATCH 4/8] chore: update runtime versions in demo apps (#9599) Co-authored-by: Igor Randjelovic --- apps/automated/package.json | 6 +++--- apps/toolbox/package.json | 6 +++--- apps/ui/package.json | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/automated/package.json b/apps/automated/package.json index dbec953e9..2c270a37f 100644 --- a/apps/automated/package.json +++ b/apps/automated/package.json @@ -14,10 +14,10 @@ "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core" }, "devDependencies": { - "@nativescript/android": "7.0.1", - "@nativescript/ios": "7.2.0", + "@nativescript/android": "8.1.1", + "@nativescript/ios": "8.1.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "4.1.4" + "typescript": "4.3.5" }, "gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3", "readme": "NativeScript Application" diff --git a/apps/toolbox/package.json b/apps/toolbox/package.json index d329073ad..f265e7dfa 100644 --- a/apps/toolbox/package.json +++ b/apps/toolbox/package.json @@ -11,9 +11,9 @@ "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core" }, "devDependencies": { - "@nativescript/android": "7.0.1", - "@nativescript/ios": "7.2.0", + "@nativescript/android": "8.1.1", + "@nativescript/ios": "8.1.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "4.1.4" + "typescript": "4.3.5" } } diff --git a/apps/ui/package.json b/apps/ui/package.json index 05c1ee9ba..07ed191df 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -11,10 +11,10 @@ "@nativescript/core": "file:../../packages/core" }, "devDependencies": { - "@nativescript/android": "7.0.1", - "@nativescript/ios": "7.2.0", + "@nativescript/android": "8.1.1", + "@nativescript/ios": "8.1.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "4.1.4" + "typescript": "4.3.5" }, "gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4", "readme": "NativeScript Application", From 846a87c66664173e162cb6ce9d708dfe3a868a51 Mon Sep 17 00:00:00 2001 From: wenzdey <56051809+wenzdey@users.noreply.github.com> Date: Wed, 6 Oct 2021 11:47:16 -0500 Subject: [PATCH 5/8] chore: updated invalid links (#9597) Co-authored-by: Nathan Walker --- packages/core/js-libs/esprima/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/js-libs/esprima/README.md b/packages/core/js-libs/esprima/README.md index ad8d9f613..0ccc1fa7c 100644 --- a/packages/core/js-libs/esprima/README.md +++ b/packages/core/js-libs/esprima/README.md @@ -1,7 +1,7 @@ **Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) parser written in ECMAScript (also popularly known as -[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). +[JavaScript](http://en.wikipedia.org/wiki/JavaScript). Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), with the help of [many contributors](https://github.com/ariya/esprima/contributors). @@ -9,7 +9,7 @@ with the help of [many contributors](https://github.com/ariya/esprima/contributo - Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) - Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla -[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) +[Parser AST](https://web.archive.org/web/20201119095346/https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API) - Optional tracking of syntax node location (index-based and line-column) - Heavily tested (> 700 [unit tests](http://esprima.org/test/) with [full code coverage](http://esprima.org/test/coverage.html)) - [Partial support](http://esprima.org/doc/es6.html) for ECMAScript 6 @@ -19,6 +19,6 @@ language tools, from [code instrumentation](http://esprima.org/demo/functiontrac to [editor autocompletion](http://esprima.org/demo/autocomplete.html). Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as -[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). +[Rhino](https://github.com/mozilla/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). For more information, check the web site [esprima.org](http://esprima.org). From 02aa0f652a5637b089a8894f6635462073715205 Mon Sep 17 00:00:00 2001 From: Dimitris - Rafail Katsampas Date: Fri, 8 Oct 2021 21:04:04 +0300 Subject: [PATCH 6/8] fix(style): CSS variables should be case-sensitive. (#9603) --- packages/core/ui/styling/css-selector/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/ui/styling/css-selector/index.ts b/packages/core/ui/styling/css-selector/index.ts index 32a69df57..b661399fa 100644 --- a/packages/core/ui/styling/css-selector/index.ts +++ b/packages/core/ui/styling/css-selector/index.ts @@ -1,4 +1,5 @@ import '../../../globals'; +import { isCssVariable } from '../../core/properties'; import { isNullOrUndefined } from '../../../utils/types'; import * as cssParser from '../../../css'; @@ -523,7 +524,7 @@ export function fromAstNodes(astRules: cssParser.Node[]): RuleSet[] { } function createDeclaration(decl: cssParser.Declaration): any { - return { property: decl.property.toLowerCase(), value: decl.value }; + return { property: isCssVariable(decl.property) ? decl.property : decl.property.toLowerCase(), value: decl.value }; } function createSimpleSelectorFromAst(ast: parser.SimpleSelector): SimpleSelector { From 95e56f75dd6fcf0f02e7b0f591f16c15593f5848 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 9 Oct 2021 08:55:54 -0700 Subject: [PATCH 7/8] chore: cleanup actionbar appearance handling --- packages/core/ui/action-bar/index.ios.ts | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/core/ui/action-bar/index.ios.ts b/packages/core/ui/action-bar/index.ios.ts index c30ff8b2c..ef320fc3a 100644 --- a/packages/core/ui/action-bar/index.ios.ts +++ b/packages/core/ui/action-bar/index.ios.ts @@ -359,7 +359,7 @@ export class ActionBar extends ActionBarBase { if (color) { const titleTextColor = NSDictionary.dictionaryWithObjectForKey(color.ios, NSForegroundColorAttributeName); if (majorVersion >= 15) { - const appearance = navBar.standardAppearance ?? UINavigationBarAppearance.new(); + const appearance = this._getAppearance(navBar); appearance.titleTextAttributes = titleTextColor; } navBar.titleTextAttributes = titleTextColor; @@ -379,12 +379,10 @@ export class ActionBar extends ActionBarBase { const color_ = color instanceof Color ? color.ios : color; if (majorVersion >= 15) { - const appearance = navBar.standardAppearance ?? UINavigationBarAppearance.new(); + const appearance = this._getAppearance(navBar); // appearance.configureWithOpaqueBackground(); appearance.backgroundColor = color_; - navBar.standardAppearance = appearance; - navBar.compactAppearance = appearance; - navBar.scrollEdgeAppearance = appearance; + this._updateAppearance(navBar, appearance); } else { // legacy styling navBar.barTintColor = color_; @@ -406,31 +404,23 @@ export class ActionBar extends ActionBarBase { } private updateFlatness(navBar: UINavigationBar) { - if (this.flat) { - if (majorVersion >= 15) { - const appearance = navBar.standardAppearance ?? UINavigationBarAppearance.new(); + const appearance = this._getAppearance(navBar); appearance.shadowColor = UIColor.clearColor; - - navBar.standardAppearance = appearance; - navBar.compactAppearance = appearance; - navBar.scrollEdgeAppearance = appearance; - } else { - + this._updateAppearance(navBar, appearance); + } else { navBar.setBackgroundImageForBarMetrics(UIImage.new(), UIBarMetrics.Default); navBar.shadowImage = UIImage.new(); navBar.translucent = false; } } else { if (majorVersion >= 15) { - if(navBar.standardAppearance){ // Not flat and never been set do nothing. + if (navBar.standardAppearance) { + // Not flat and never been set do nothing. const appearance = navBar.standardAppearance; - appearance.shadowColor = UINavigationBarAppearance.new().shadowColor; - - navBar.standardAppearance = appearance; - navBar.compactAppearance = appearance; - navBar.scrollEdgeAppearance = appearance; + appearance.shadowColor = UINavigationBarAppearance.new().shadowColor; + this._updateAppearance(navBar, appearance); } } else { navBar.setBackgroundImageForBarMetrics(null, null); @@ -440,6 +430,16 @@ export class ActionBar extends ActionBarBase { } } + private _getAppearance(navBar: UINavigationBar) { + return navBar.standardAppearance ?? UINavigationBarAppearance.new(); + } + + private _updateAppearance(navBar: UINavigationBar, appearance: UINavigationBarAppearance) { + navBar.standardAppearance = appearance; + navBar.compactAppearance = appearance; + navBar.scrollEdgeAppearance = appearance; + } + public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) { const width = layout.getMeasureSpecSize(widthMeasureSpec); const height = layout.getMeasureSpecSize(heightMeasureSpec); From 98de924b7cbc4aa617729ea69704af131f13c2f0 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 9 Oct 2021 09:07:17 -0700 Subject: [PATCH 8/8] chore(release): @nativescript/core@8.1.4 --- CHANGELOG.md | 20 ++++++++++++++++++++ package.json | 4 ++-- packages/core/package.json | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88be57ad3..e6e70a7c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## [8.1.4](https://github.com/NativeScript/NativeScript/compare/8.1.3-core...8.1.4) (2021-10-09) + + +### Bug Fixes + +* **android:** StringIndexOutOfBoundsException with invalid drawables ([#9563](https://github.com/NativeScript/NativeScript/issues/9563)) ([8e76bbe](https://github.com/NativeScript/NativeScript/commit/8e76bbe2515c5c743d3db30a940ccb8040314bea)) +* background parsing color [#9559](https://github.com/NativeScript/NativeScript/issues/9559) ([#9560](https://github.com/NativeScript/NativeScript/issues/9560)) ([3e21748](https://github.com/NativeScript/NativeScript/commit/3e21748af4dcf76fec3822b4d5e9c844794eda1d)) +* **ios:** ActionBar flat property using new appearance api for iOS 15 ([#9558](https://github.com/NativeScript/NativeScript/issues/9558)) ([183b4d4](https://github.com/NativeScript/NativeScript/commit/183b4d4b10a4ec7f9527e5373c8ce723c3db0c3e)) +* **ios:** TextView respect editable binding ([#9589](https://github.com/NativeScript/NativeScript/issues/9589)) ([2b2ce37](https://github.com/NativeScript/NativeScript/commit/2b2ce377e6d7bd33de3fd8df9482772a650b75b5)) +* **ios:** replace autofill string in textfield ([#9555](https://github.com/NativeScript/NativeScript/issues/9555)) ([889f6d7](https://github.com/NativeScript/NativeScript/commit/889f6d73cf8bdc080c54387708562d00c2684e9b)) +* **style:** CSS variables should be case-sensitive. ([#9603](https://github.com/NativeScript/NativeScript/issues/9603)) ([02aa0f6](https://github.com/NativeScript/NativeScript/commit/02aa0f652a5637b089a8894f6635462073715205)) + + +### Features + +* **android** openFile dialog title ([#9600](https://github.com/NativeScript/NativeScript/issues/9600)) ([77d2533](https://github.com/NativeScript/NativeScript/commit/77d253379802487007c138ca025ac21f9bece002)) +* **text:** add css text-align justify ([#9573](https://github.com/NativeScript/NativeScript/issues/9573)) ([1de5295](https://github.com/NativeScript/NativeScript/commit/1de5295ad980b394460de7d9d4b884e5a3b5a679)) + + + ## [8.1.3](https://github.com/NativeScript/NativeScript/compare/8.1.2-core...8.1.3) (2021-09-18) diff --git a/package.json b/package.json index e9e65337f..7515c769d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "8.1.3", + "version": "8.1.4", "license": "MIT", "scripts": { "clean": "git clean -f -X -d --exclude=!.idea/ --exclude=!.vscode/*", @@ -53,7 +53,7 @@ "mocha": "^8.0.1", "mocha-typescript": "^1.1.17", "module-alias": "^2.2.2", - "nativescript": "~8.1.2", + "nativescript": "~8.1.3", "nativescript-typedoc-theme": "1.1.0", "parse-css": "git+https://github.com/tabatkins/parse-css.git", "parserlib": "^1.1.1", diff --git a/packages/core/package.json b/packages/core/package.json index f6c1ef372..fb9243132 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.", - "version": "8.1.3", + "version": "8.1.4", "homepage": "https://nativescript.org", "repository": { "type": "git",