Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add android embedding and merge main #10465

Open
wants to merge 28 commits into
base: embed
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0847855
fix(core): font variation settings parser invalid axis (#10427)
CatchABus Nov 2, 2023
d70b48b
fix(css): prevent shorthand parse error on 'unset' and 'inset' (#10424)
NathanWalker Nov 2, 2023
aeba78b
release: @nativescript/core 8.6.1
NathanWalker Nov 2, 2023
5b9d861
chore: 8.6.2 next
NathanWalker Nov 2, 2023
6744009
fix(css): box-shadow none handling (#10445)
NathanWalker Nov 19, 2023
2cf166d
fix(ios): font variation settings not applied to labels (#10429)
CatchABus Nov 22, 2023
9fae9c4
fix(ios): ScrollView with listeners removed scroll delegate (#10432)
CatchABus Nov 22, 2023
5a4bb7c
fix(ios): shadow does not consider z-index (#10433)
CatchABus Nov 24, 2023
07d2129
fix(android): proper change of input interaction mode programmaticall…
CatchABus Nov 25, 2023
aba3093
fix(ios): non-uniform border angle (#10437)
CatchABus Nov 25, 2023
2312725
chore: 8.6.2 next
NathanWalker Nov 25, 2023
48b1856
fix(core): inheritable property changes backstack propagation (#10438)
CatchABus Nov 25, 2023
40b2a6a
chore: use `__ANDROID__` and `__IOS__` throughout (#10446)
farfromrefug Nov 25, 2023
2237c9b
chore: Nx 17+ (#10449)
NathanWalker Nov 25, 2023
82e9c67
feat(core): initRootView event (#10442)
farfromrefug Nov 25, 2023
4762699
fix(time-picker): properly handle 0 on hour and minutes with valueCha…
NathanWalker Dec 17, 2023
4b74b96
chore: readme update
NathanWalker Dec 17, 2023
172d346
fix(core): safe important check (#10455)
wSedlacek Dec 19, 2023
c5561d6
fix(android): use nativeTextViewProtected in TextField (#10450)
farfromrefug Dec 20, 2023
31ed40c
feat(core): new `defaultVisualState` property option to override 'nor…
farfromrefug Dec 20, 2023
deaa6b1
release: @nativescript/core 8.6.2
NathanWalker Dec 22, 2023
e60176c
chore: 8.6.3 next - Merry Christmas 🎄
NathanWalker Dec 22, 2023
898d754
release: 5.0.18-embed.0
NathanWalker Oct 25, 2023
a2ca536
feat(webpack): add USER_PROJECT_PLATFORMS_IOS for embedding options (…
tdermendjiev Oct 25, 2023
74d834a
release: 5.0.18-embed.1
NathanWalker Oct 25, 2023
aa27c3f
feat: support android embedding
vmutafov Jan 2, 2024
c4f2c11
fix: make embedding functionality conditional
vmutafov Jan 7, 2024
02f50ef
check
vmutafov Jan 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/apps_automated.yml
Expand Up @@ -21,12 +21,12 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20.10.0

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -49,6 +49,8 @@ jobs:

- name: Create Emulator
uses: rigor789/action-create-emulator@main
with:
package: system-images;android-34;default;x86_64

- name: Test (Android)
run: node tools/scripts/run-automated.js android
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -55,3 +55,5 @@ Thumbs.db

# types
ios-typings-prj

.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Expand Up @@ -25,3 +25,5 @@ package.json
*.scss
*.sh
!packages/webpack/templates/*.js

/.nx/cache
45 changes: 45 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,48 @@
## [8.6.2](https://github.com/NativeScript/NativeScript/compare/8.6.1-core...8.6.2) (2023-12-22)


### Bug Fixes

* **android:** proper change of input interaction mode programmatically ([#10434](https://github.com/NativeScript/NativeScript/issues/10434)) ([07d2129](https://github.com/NativeScript/NativeScript/commit/07d2129f9c9b387c238c9a7c2da29b5690bac986))
* **android:** use nativeTextViewProtected in TextField ([#10450](https://github.com/NativeScript/NativeScript/issues/10450)) ([c5561d6](https://github.com/NativeScript/NativeScript/commit/c5561d60df0fb093c88a30e072ffdc10f31015b8))
* **core:** inheritable property changes backstack propagation ([#10438](https://github.com/NativeScript/NativeScript/issues/10438)) ([48b1856](https://github.com/NativeScript/NativeScript/commit/48b1856d6cb024ee2a42082e6cf0b8923b0cd8f4))
* **core:** safe important check ([#10455](https://github.com/NativeScript/NativeScript/issues/10455)) ([172d346](https://github.com/NativeScript/NativeScript/commit/172d3463a30cf1ee3727aaa42d6a33505332c6bf))
* **css:** box-shadow none handling ([#10445](https://github.com/NativeScript/NativeScript/issues/10445)) ([6744009](https://github.com/NativeScript/NativeScript/commit/67440095f4fafd68da528e9a88e6a42a86136d9c))
* **ios:** font variation settings not applied to labels ([#10429](https://github.com/NativeScript/NativeScript/issues/10429)) ([2cf166d](https://github.com/NativeScript/NativeScript/commit/2cf166da5974083d1f1431624a4ff06ad648913b))
* **ios:** non-uniform border angle ([#10437](https://github.com/NativeScript/NativeScript/issues/10437)) ([aba3093](https://github.com/NativeScript/NativeScript/commit/aba3093e69004e44aa4afa1f245e7cfa3f6e7b97))
* **ios:** ScrollView with listeners removed scroll delegate ([#10432](https://github.com/NativeScript/NativeScript/issues/10432)) ([9fae9c4](https://github.com/NativeScript/NativeScript/commit/9fae9c428185ed2f99b3710e3fe16cf060bc072b))
* **ios:** shadow does not consider z-index ([#10433](https://github.com/NativeScript/NativeScript/issues/10433)) ([5a4bb7c](https://github.com/NativeScript/NativeScript/commit/5a4bb7c38cc694a312135e44022d5a4c8dc79d1c))
* **time-picker:** properly handle 0 on hour and minutes with valueChanged ([#10460](https://github.com/NativeScript/NativeScript/issues/10460)) ([4762699](https://github.com/NativeScript/NativeScript/commit/4762699fa19fb81a766310724ad2cf0741b105c3))


### Features

* **core:** initRootView event ([#10442](https://github.com/NativeScript/NativeScript/issues/10442)) ([82e9c67](https://github.com/NativeScript/NativeScript/commit/82e9c67d3398c376be1641c5f23bf82a492a48c3))
* **core:** new `defaultVisualState` property option to override 'normal' default visualState ([#10440](https://github.com/NativeScript/NativeScript/issues/10440)) ([31ed40c](https://github.com/NativeScript/NativeScript/commit/31ed40c17ab6ff026dde65c786a3c8ad8e625b3b))



## [8.6.1](https://github.com/NativeScript/NativeScript/compare/5.0.18-webpack...8.6.1) (2023-11-02)


### Bug Fixes

* **android:** prevent rehydration on destroyed dialogs ([#10414](https://github.com/NativeScript/NativeScript/issues/10414)) ([7563549](https://github.com/NativeScript/NativeScript/commit/756354952c88c00794e586cbb316928b7f9dbbff))
* **core:** box-shadow 'none' handling ([#10405](https://github.com/NativeScript/NativeScript/issues/10405)) ([c23695c](https://github.com/NativeScript/NativeScript/commit/c23695c477dc1363e4f30fb45d3666c5b8101e4f))
* **core:** font variation settings parser invalid axis ([#10427](https://github.com/NativeScript/NativeScript/issues/10427)) ([0847855](https://github.com/NativeScript/NativeScript/commit/08478556a9e39af9b1524c12e9e330d0a8aae9c7))
* **core:** page frame reference not unset on native view disposal ([#10417](https://github.com/NativeScript/NativeScript/issues/10417)) ([22c21b7](https://github.com/NativeScript/NativeScript/commit/22c21b7e062b851a635d96aede9c936fb8e9749a))
* **css:** prevent shorthand parse error on 'unset' and 'inset' ([#10424](https://github.com/NativeScript/NativeScript/issues/10424)) ([d70b48b](https://github.com/NativeScript/NativeScript/commit/d70b48bbe9c42044204e6887b18f95f628656d69))
* **ios:** add/remove shadow for reusable views ([#10409](https://github.com/NativeScript/NativeScript/issues/10409)) ([ee87b52](https://github.com/NativeScript/NativeScript/commit/ee87b52ac323e220b7b154d27a55cbf4cdbd59c4))
* **ios:** property mask on 'undefined' during view disposal ([#10404](https://github.com/NativeScript/NativeScript/issues/10404)) ([212d086](https://github.com/NativeScript/NativeScript/commit/212d086676a3246fd225f346af2ab920634a7643))
* **ios:** shadow position after translate transform ([#10413](https://github.com/NativeScript/NativeScript/issues/10413)) ([c78ea79](https://github.com/NativeScript/NativeScript/commit/c78ea79f0f63f49506120aeef3bc603426c155b2))


### Features

* **android:** allow shared element transitions to work with ListView/CollectionView/Pager ([#10411](https://github.com/NativeScript/NativeScript/issues/10411)) ([e8c093d](https://github.com/NativeScript/NativeScript/commit/e8c093d7a2ca94edd2f5d35ca3725c7a27e74b74))



# [8.6.0](https://github.com/NativeScript/NativeScript/compare/8.5.9-core...8.6.0-core) (2023-10-10)


Expand Down
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -13,7 +13,7 @@

</p>

[NativeScript](http://www.nativescript.org) empowers you to access native APIs from JavaScript directly. Currently iOS and Android runtimes are provided for rich mobile development across a variety of diverse use cases.
[NativeScript](http://www.nativescript.org) empowers you to access native APIs from JavaScript directly. Currently iOS, Android, and visionOS runtimes are provided for rich mobile development across a variety of diverse use cases.


[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FNativeScript%2FNativeScript.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FNativeScript%2FNativeScript?ref=badge_large)
Expand All @@ -40,7 +40,7 @@ We love you and your pull requests 🤗. Please follow our [contributing guide](
## @nativescript/*

- [@nativescript/core](https://github.com/NativeScript/NativeScript/tree/main/packages/core)
Core iOS/Android for NativeScript.
Singular primitives offering an easy-to-use API surface for diverse iOS/Android APIs implemented with NativeScript.
- [@nativescript/types](https://www.npmjs.com/package/@nativescript/types)
Types for both iOS/Android below wrapped up as a convenience. *Most commonly used.*
- [@nativescript/types-ios](https://github.com/NativeScript/NativeScript/tree/main/packages/types-ios)
Expand Down Expand Up @@ -73,14 +73,14 @@ We love you and your pull requests 🤗. Please follow our [contributing guide](

Outside the source centralized in this repo, NativeScript consists of a few other source repos. Here are the major ones:

- [iOS Runtime](https://github.com/NativeScript/ns-v8ios-runtime)
NativeScript iOS Runtime: Empowers JavaScript code to be executed on iOS devices written in a mix of C++, Objective-C, and Swift.
- [iOS and visionOS Runtime](https://github.com/NativeScript/ns-v8ios-runtime)
Empowers JavaScript code to be executed on iOS and visionOS devices written in a mix of C++, Objective-C, and Swift.
- [Android Runtime](https://github.com/NativeScript/android-runtime)
NativeScript Android Runtim: Empowers JavaScript code to be executed on Android devices written in a mix of C++, Java and Kotlin.
Empowers JavaScript code to be executed on Android devices written in a mix of C++, Java and Kotlin.
- [CLI](//github.com/NativeScript/nativescript-cli)
NativeScript command-line interface empowering you to create, build, and run apps using NativeScript.
Command-line interface empowering you to create, build, and run apps using NativeScript.
- [Docs](//github.com/NativeScript/docs-new)
NativeScript documentation available at <http://docs.nativescript.org/> written in Markdown.
Documentation available at <http://docs.nativescript.org/> written in Markdown.
- [Plugins](https://github.com/NativeScript/plugins)
A [plugin workspace](https://docs.nativescript.org/plugins/plugin-workspace-guide.html) with several useful plugins.
- [Firebase](https://github.com/NativeScript/firebase)
Expand All @@ -92,4 +92,4 @@ Outside the source centralized in this repo, NativeScript consists of a few othe
- [Artwork](https://github.com/NativeScript/artwork)
Want to use our logo or colors? Feel free to use any of our ready-to-use media material.

<h3 align="center">Made with ❤️</h3>
<h3 align="center">Made with ❤️</h3>
4 changes: 2 additions & 2 deletions apps/automated/package.json
Expand Up @@ -11,8 +11,8 @@
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "~8.5.0",
"@nativescript/android": "~8.6.0",
"@nativescript/ios": "~8.6.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"circular-dependency-plugin": "^5.2.2",
"typescript": "~5.2.0"
Expand Down
14 changes: 14 additions & 0 deletions apps/automated/src/ui/time-picker/time-picker-tests.ts
Expand Up @@ -197,13 +197,27 @@ export class TimePickerTest extends testModule.UITest<timePickerModule.TimePicke
TKUnit.assertEqual(actualValue, expectedValue);
}

public testHourZeroFromLocalToNative() {
let expectedValue = 0;
this.testView.hour = expectedValue;
let actualValue = timePickerTestsNative.getNativeHour(this.testView);
TKUnit.assertEqual(actualValue, expectedValue);
}

public testMinuteFromLocalToNative() {
let expectedValue = 59;
this.testView.minute = expectedValue;
let actualValue = timePickerTestsNative.getNativeMinute(this.testView);
TKUnit.assertEqual(actualValue, expectedValue);
}

public testMinuteZeroFromLocalToNative() {
let expectedValue = 0;
this.testView.minute = expectedValue;
let actualValue = timePickerTestsNative.getNativeMinute(this.testView);
TKUnit.assertEqual(actualValue, expectedValue);
}

public testHourFromNativeToLocal() {
let expectedValue = 14;
timePickerTestsNative.setNativeHour(this.testView, expectedValue);
Expand Down
6 changes: 3 additions & 3 deletions apps/toolbox/package.json
Expand Up @@ -9,11 +9,11 @@
"dependencies": {
"@nativescript/core": "file:../../packages/core",
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core",
"@nativescript/imagepicker": "^1.0.6"
"@nativescript/imagepicker": "^3.0.0"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "~8.5.0",
"@nativescript/android": "~8.6.0",
"@nativescript/ios": "~8.6.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"typescript": "~5.2.0"
}
Expand Down
4 changes: 4 additions & 0 deletions apps/toolbox/src/app.css
Expand Up @@ -221,4 +221,8 @@ Button {
.switch-demo-page Switch.custom-switch:disabled:checked {
color: #ddd;
background-color: #777;
}

.no-shadow {
box-shadow: none;
}
6 changes: 4 additions & 2 deletions apps/toolbox/src/pages/box-shadow.xml
Expand Up @@ -9,7 +9,7 @@
<!-- layouts -->
<ScrollView height="100%" visibility="{{ selectedComponentType === 'layouts' ? 'visible' : 'collapsed' }}">
<StackLayout padding="20">
<StackLayout width="300" height="100" class="demo-component" boxShadow="{{ appliedBoxShadow }}" borderColor="{{ borderColor }}" borderWidth="{{ borderWidth }}" borderRadius="{{ borderRadius }}" background="{{ background }}" tap="{{ toggleAnimation }}">
<StackLayout width="300" height="100" class="demo-component" boxShadow="{{ appliedBoxShadow }}" borderColor="{{ borderColor }}" borderWidth="{{ borderWidth }}" borderRadius="{{ borderRadius }}" background="{{ background }}" tap="{{ toggleAnimation }}">
<Label text="StackLayout" />
</StackLayout>

Expand Down Expand Up @@ -40,10 +40,12 @@
</GridLayout>

<!-- buttons -->
<GridLayout rows="*" height="100%" visibility="{{ selectedComponentType === 'buttons' ? 'visible' : 'collapsed' }}">
<GridLayout rows="*,*" height="100%" visibility="{{ selectedComponentType === 'buttons' ? 'visible' : 'collapsed' }}">

<Button horizontalAlignment="center" verticalAlignment="center" class="demo-component" boxShadow="{{ appliedBoxShadow }}" borderColor="{{ borderColor }}" borderWidth="{{ borderWidth }}" borderRadius="{{ borderRadius }}" background="{{ background }}" tap="{{ toggleAnimation }}" text="button" />

<Button row="1" horizontalAlignment="center" verticalAlignment="center" class="demo-component no-shadow" text="button no shadow" />

</GridLayout>

<!-- images -->
Expand Down
2 changes: 2 additions & 0 deletions apps/toolbox/src/pages/datepicker.ts
Expand Up @@ -10,6 +10,8 @@ export function navigatingTo(args: EventData) {
export class SampleData extends Observable {
minDate = new Date();
maxDate = new Date(2030, 7, 1);
hour = 8;
minute = 0;
displayDate = {
day: new Date().getDate(),
month: new Date().getMonth(),
Expand Down
4 changes: 4 additions & 0 deletions apps/toolbox/src/pages/datepicker.xml
Expand Up @@ -16,5 +16,9 @@ year="{{displayDate?.year}}"
<Switch checked="true" col="0" checkedChange="{{checkedChange}}" />
<Label text="Show Time" col="1" class="m-l-10" />
</GridLayout>
<GridLayout rows="auto,auto" columns="">
<Label text="Time Picker standalone:" row="0" col="0" class="m-t-10" />
<TimePicker row="1" hour="{{hour}}" minute="{{minute}}"></TimePicker>
</GridLayout>
</StackLayout>
</Page>
7 changes: 4 additions & 3 deletions apps/toolbox/src/pages/image-handling.ts
Expand Up @@ -22,10 +22,11 @@ export class DemoModel extends Observable {
.then(() => {
return context.present();
})
.then((selection) => {
const imageAsset = selection.length > 0 ? selection[0] : null;
if (imageAsset) {
.then((selections) => {
const selection = selections.length > 0 ? selections[0] : null;
if (selection) {
this.addingPhoto = true;
const imageAsset = selection.asset;

ImageSource.fromAsset(imageAsset).then(
(savedImage) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/ui/package.json
Expand Up @@ -11,8 +11,8 @@
"@nativescript/core": "file:../../packages/core"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "~8.5.0",
"@nativescript/android": "~8.6.0",
"@nativescript/ios": "~8.6.0",
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
"typescript": "~5.2.0"
},
Expand Down
44 changes: 34 additions & 10 deletions nx.json
@@ -1,19 +1,13 @@
{
"npmScope": "nativescript",
"workspaceLayout": {
"appsDir": "apps",
"libsDir": "packages"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"useDaemonProcess": false,
"cacheableOperations": ["build", "lint", "test", "ios", "android", "e2e"],
"canTrackAnalytics": false,
"showUsageWarnings": true,
"parallel": 1,
"accessToken": "NzRmNDM3NDgtZjlmNy00MTUwLWIxZDktYjJlZTRhMWM5ODY3fHJlYWQtd3JpdGU="
"showUsageWarnings": true
}
}
},
Expand Down Expand Up @@ -84,10 +78,40 @@
},
"targetDefaults": {
"build": {
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"lint": {
"cache": true
},
"ios": {
"cache": true
},
"android": {
"cache": true
},
"e2e": {
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
}
},
"useDaemonProcess": false,
"nxCloudAccessToken": "NzRmNDM3NDgtZjlmNy00MTUwLWIxZDktYjJlZTRhMWM5ODY3fHJlYWQtd3JpdGU=",
"parallel": 1
}