diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b68251ee..5c722d7c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +## [7.0.4](https://github.com/NativeScript/NativeScript/compare/7.0.3-types-ios...7.0.4) (2020-09-23) + + +### Bug Fixes + +* **android-transitions:** remove hard-coded flip transition duration/curve ([#8851](https://github.com/NativeScript/NativeScript/issues/8851)) ([5f8d3d0](https://github.com/NativeScript/NativeScript/commit/5f8d3d03f7eac1bdcb1cf4c338734298d2ba86ab)) +* **ios:** text-view color refreshes properly after setting the text to keep the styles ([#8863](https://github.com/NativeScript/NativeScript/issues/8863)) ([313f476](https://github.com/NativeScript/NativeScript/commit/313f47637e2fd3d95acb56499cf72e8d6cde7aec)) +* **ios:** time-picker and date-picker for iOS 14 ([#8877](https://github.com/NativeScript/NativeScript/issues/8877)) ([45fb6c4](https://github.com/NativeScript/NativeScript/commit/45fb6c481b3ae7b3df2cd9f666e1813bdbaff0c7)) + + +### Features + +* **core:** global event handling ([#8830](https://github.com/NativeScript/NativeScript/issues/8830)) ([eb676fd](https://github.com/NativeScript/NativeScript/commit/eb676fdedf9e3db750bb1c0e7b48194faed2c772)) + + + +## [7.0.3](https://github.com/NativeScript/NativeScript/compare/7.0.0...7.0.3) (2020-09-12) + + +### Bug Fixes + +* add missing configuration keys and move profiling out of android key ([#8847](https://github.com/NativeScript/NativeScript/issues/8847)) ([d69e568](https://github.com/NativeScript/NativeScript/commit/d69e568a4b6505e1ceef33a56100996199bf2d4b)) + + + ## [7.0.2](https://github.com/NativeScript/NativeScript/compare/7.0.0...7.0.2) (2020-09-10) diff --git a/package.json b/package.json index 724fe968b..3831dcb92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "7.0.2", + "version": "7.0.4", "license": "MIT", "config": { "npm_alias": "npm" @@ -36,11 +36,11 @@ "webpack:test": "cd packages/webpack && npm run tsc && npm run jasmine", "webpack:build": "cd packages/webpack npm run setup && mkdir -p ../../dist/packages && mv \"$(npm pack | tail -n 1)\" ../../dist/packages/nativescript-webpack.tgz" }, - "private": true, - "repository": { - "type": "git", - "url": "https://github.com/NativeScript/NativeScript.git" - }, + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/NativeScript.git" + }, "dependencies": { "nativescript-theme-core": "^1.0.4" }, diff --git a/packages/core/config/config.interface.ts b/packages/core/config/config.interface.ts index ff1528f7b..57ccf5cc2 100644 --- a/packages/core/config/config.interface.ts +++ b/packages/core/config/config.interface.ts @@ -1,4 +1,6 @@ -interface IConfigPlaform { +import type {InstrumentationMode} from '../profiling' + +interface IConfigPlatform { /** * App's bundle id */ @@ -10,9 +12,10 @@ interface IConfigPlaform { discardUncaughtJsExceptions?: boolean; } -interface IConfigIOS extends IConfigPlaform {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +interface IConfigIOS extends IConfigPlatform {} -interface IConfigAndroid extends IConfigPlaform { +interface IConfigAndroid extends IConfigPlatform { /** * These are the v8 runtime flags you can pass in, you must have "--expose_gc" as this is used in the runtime */ @@ -46,11 +49,6 @@ interface IConfigAndroid extends IConfigPlaform { */ gcThrottleTime?: number; - /** - * Enabled "timeline" profiling by setting this key to "timeline", default: "" - */ - profiling?: string; - /** * "none" & "full" is supported, "full" is depreciated * Default: none @@ -91,8 +89,8 @@ interface IConfigAndroid extends IConfigPlaform { enableLineBreakpoints?: boolean; /** - * Enabled the multithreaded JavaScript engine, this will probably break plugins... - * Disabled/Default: false + * Enable the multithreaded JavaScript engine, this will probably break plugins... + * Default: false - disabled. */ enableMultithreadedJavascript?: boolean; } @@ -104,9 +102,13 @@ export interface NativeScriptConfig { */ id?: string; /** - * App's main entry file + * App's main entry file (currently ignored - set it in package.json main field) */ main?: string; + /** + * Path to the app source directory + * This is often the `src` or `app` directory however can be changed. + */ appPath?: string; /** * App_Resources path @@ -131,4 +133,15 @@ export interface NativeScriptConfig { * Various Android specific configurations including Android runtime flags. */ android?: IConfigAndroid; + /** + * Enable profiling for the application. Default: no profiling + * In most cases when profiling, you will want to use "timeline" + */ + profiling?: InstrumentationMode; + /** + * Set the default CSS parser that NativeScript will use. + * Default: css-tree + */ + cssParser?: 'rework' | 'nativescript' | 'css-tree'; } + diff --git a/packages/core/data/observable/index.ts b/packages/core/data/observable/index.ts index dfc60573f..79cc52ead 100644 --- a/packages/core/data/observable/index.ts +++ b/packages/core/data/observable/index.ts @@ -97,7 +97,7 @@ export class Observable implements ObservableDefinition { } onListenerAdded(eventName: string, count: number) {} onListenerRemoved(eventName: string, count: number) {} - + public addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void { if (typeof eventNames !== 'string') { throw new TypeError('Events name(s) must be string.'); @@ -164,7 +164,9 @@ export class Observable implements ObservableDefinition { } private static _handleEvent(observers: Array, data: T): void { - if (!observers) { return; } + if (!observers) { + return; + } for (let i = observers.length - 1; i >= 0; i--) { const entry = observers[i]; if (entry.once) { diff --git a/packages/core/globals/index.ts b/packages/core/globals/index.ts index a5771d05f..d47733635 100644 --- a/packages/core/globals/index.ts +++ b/packages/core/globals/index.ts @@ -360,4 +360,4 @@ export function initGlobal() { } if (!global.NativeScriptHasInitGlobal) { initGlobal(); -} \ No newline at end of file +} diff --git a/packages/core/package.json b/packages/core/package.json index 3842cac70..88e09e40c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "NativeScript Core Modules", - "version": "7.0.3-alpha.1", + "version": "7.0.4", "homepage": "https://nativescript.org", "repository": { "type": "git", diff --git a/packages/core/ui/date-picker/index.ios.ts b/packages/core/ui/date-picker/index.ios.ts index 5cf0d575e..f7e1618bb 100644 --- a/packages/core/ui/date-picker/index.ios.ts +++ b/packages/core/ui/date-picker/index.ios.ts @@ -1,9 +1,14 @@ import { DatePickerBase, yearProperty, monthProperty, dayProperty, dateProperty, maxDateProperty, minDateProperty } from './date-picker-common'; import { colorProperty } from '../styling/style-properties'; import { Color } from '../../color'; +import { Device } from '../../platform'; export * from './date-picker-common'; +const SUPPORT_DATE_PICKER_STYLE = parseFloat(Device.os) >= 14.0; +const SUPPORT_TEXT_COLOR = parseFloat(Device.os) < 14.0; +const DEFAULT_DATE_PICKER_STYLE = 1; + export class DatePicker extends DatePickerBase { private _changeHandler: NSObject; public nativeViewProtected: UIDatePicker; @@ -11,7 +16,9 @@ export class DatePicker extends DatePickerBase { public createNativeView() { const picker = UIDatePicker.new(); picker.datePickerMode = UIDatePickerMode.Date; - + if (SUPPORT_DATE_PICKER_STYLE) { + picker.preferredDatePickerStyle = DEFAULT_DATE_PICKER_STYLE; + } return picker; } @@ -74,11 +81,13 @@ export class DatePicker extends DatePickerBase { } [colorProperty.getDefault](): UIColor { - return this.nativeViewProtected.valueForKey('textColor'); + return SUPPORT_TEXT_COLOR ? this.nativeViewProtected.valueForKey('textColor') : UIColor.new(); } [colorProperty.setNative](value: Color | UIColor) { - const picker = this.nativeViewProtected; - picker.setValueForKey(value instanceof Color ? value.ios : value, 'textColor'); + if (SUPPORT_TEXT_COLOR) { + const picker = this.nativeViewProtected; + picker.setValueForKey(value instanceof Color ? value.ios : value, 'textColor'); + } } } diff --git a/packages/core/ui/text-view/index.ios.ts b/packages/core/ui/text-view/index.ios.ts index 292a8a753..3de66521a 100644 --- a/packages/core/ui/text-view/index.ios.ts +++ b/packages/core/ui/text-view/index.ios.ts @@ -235,8 +235,8 @@ export class TextView extends TextViewBaseCommon { public showText() { this._isShowingHint = false; - this._refreshColor(); this._setNativeText(); + this._refreshColor(); this.requestLayout(); } diff --git a/packages/core/ui/time-picker/index.ios.ts b/packages/core/ui/time-picker/index.ios.ts index 940e5bda5..f0624e512 100644 --- a/packages/core/ui/time-picker/index.ios.ts +++ b/packages/core/ui/time-picker/index.ios.ts @@ -1,9 +1,14 @@ import { TimePickerBase, timeProperty, minuteIntervalProperty, minuteProperty, minMinuteProperty, maxMinuteProperty, hourProperty, minHourProperty, maxHourProperty } from './time-picker-common'; import { Color } from '../../color'; import { colorProperty } from '../styling/style-properties'; +import { Device } from '../../platform'; export * from './time-picker-common'; +const SUPPORT_DATE_PICKER_STYLE = parseFloat(Device.os) >= 14.0; +const SUPPORT_TEXT_COLOR = parseFloat(Device.os) < 14.0; +const DEFAULT_DATE_PICKER_STYLE = 1; + function getDate(hour: number, minute: number): Date { let components = NSDateComponents.alloc().init(); components.hour = hour; @@ -30,7 +35,9 @@ export class TimePicker extends TimePickerBase { createNativeView() { const picker = UIDatePicker.new(); picker.datePickerMode = UIDatePickerMode.Time; - + if (SUPPORT_DATE_PICKER_STYLE) { + picker.preferredDatePickerStyle = DEFAULT_DATE_PICKER_STYLE; + } return picker; } @@ -106,11 +113,13 @@ export class TimePicker extends TimePickerBase { } [colorProperty.getDefault](): UIColor { - return this.nativeViewProtected.valueForKey('textColor'); + return SUPPORT_TEXT_COLOR ? this.nativeViewProtected.valueForKey('textColor') : UIColor.new(); } [colorProperty.setNative](value: Color | UIColor) { - const color = value instanceof Color ? value.ios : value; - this.nativeViewProtected.setValueForKey(color, 'textColor'); + if (SUPPORT_TEXT_COLOR) { + const color = value instanceof Color ? value.ios : value; + this.nativeViewProtected.setValueForKey(color, 'textColor'); + } } } diff --git a/packages/types-android/package.json b/packages/types-android/package.json index 15d0cce8c..b8431f405 100644 --- a/packages/types-android/package.json +++ b/packages/types-android/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/types-android", - "version": "7.0.2", + "version": "7.0.4", "description": "NativeScript Types for Android.", "homepage": "https://nativescript.org", "repository": { diff --git a/packages/types-android/src/lib/android/org.nativescript.widgets.d.ts b/packages/types-android/src/lib/android/org.nativescript.widgets.d.ts index 35da58adb..d2ea0f51b 100644 --- a/packages/types-android/src/lib/android/org.nativescript.widgets.d.ts +++ b/packages/types-android/src/lib/android/org.nativescript.widgets.d.ts @@ -460,6 +460,7 @@ constructor(context: android.content.Context, attrs: android.util.AttributeSet); setSwipePageEnabled(enabled: boolean): void; + setAnimationEnabled(enabled: boolean): void; } export class TabItemSpec { @@ -619,4 +620,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/types-ios/package.json b/packages/types-ios/package.json index 3499d68bc..32ba9c4de 100644 --- a/packages/types-ios/package.json +++ b/packages/types-ios/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/types-ios", - "version": "7.0.1", + "version": "7.0.4", "description": "NativeScript Types for iOS.", "homepage": "https://nativescript.org", "repository": { diff --git a/packages/types-ios/src/lib/ios/objc-x86_64/objc!UIKit.d.ts b/packages/types-ios/src/lib/ios/objc-x86_64/objc!UIKit.d.ts index c3c842480..a375a00dd 100644 --- a/packages/types-ios/src/lib/ios/objc-x86_64/objc!UIKit.d.ts +++ b/packages/types-ios/src/lib/ios/objc-x86_64/objc!UIKit.d.ts @@ -6101,6 +6101,8 @@ declare class UIDatePicker extends UIControl implements NSCoding { minuteInterval: number; + preferredDatePickerStyle: number; + timeZone: NSTimeZone; constructor(o: { coder: NSCoder; }); // inherited from NSCoding diff --git a/packages/types/package.json b/packages/types/package.json index ea0430331..3e110f126 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/types", - "version": "7.0.1", + "version": "7.0.4", "description": "NativeScript Types for all supported platforms.", "homepage": "https://nativescript.org", "repository": { @@ -12,7 +12,7 @@ ], "license": "Apache-2.0", "dependencies": { - "@nativescript/types-ios": "~7.0.0", - "@nativescript/types-android": "~7.0.0" + "@nativescript/types-ios": "7.0.4", + "@nativescript/types-android": "7.0.4" } -} \ No newline at end of file +}