mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
chore: TypeScript 5.1 with Nx 16.6 migrations (#10338)
This commit is contained in:
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"ignorePatterns": ["**/*"],
|
"ignorePatterns": ["**/*"],
|
||||||
"plugins": ["@nrwl/nx"],
|
"plugins": ["@nx"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@nrwl/nx/enforce-module-boundaries": [
|
"@nx/enforce-module-boundaries": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
"enforceBuildableLibDependency": true,
|
"enforceBuildableLibDependency": true,
|
||||||
@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx"],
|
"files": ["*.ts", "*.tsx"],
|
||||||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nrwl/nx/typescript"],
|
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:@nx/typescript"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-empty": "off",
|
"no-empty": "off",
|
||||||
"no-useless-escape": "off",
|
"no-useless-escape": "off",
|
||||||
@ -43,7 +43,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.js", "*.jsx"],
|
"files": ["*.js", "*.jsx"],
|
||||||
"extends": ["plugin:@nrwl/nx/javascript"],
|
"extends": ["plugin:@nx/javascript"],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -51,6 +51,11 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/triple-slash-reference": "off"
|
"@typescript-eslint/triple-slash-reference": "off"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "*.json",
|
||||||
|
"parser": "jsonc-eslint-parser",
|
||||||
|
"rules": {}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
18
.vscode/settings.json
vendored
18
.vscode/settings.json
vendored
@ -1,10 +1,10 @@
|
|||||||
// Place your settings in this file to overwrite default and user settings.
|
|
||||||
{
|
{
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/node_modules": true,
|
"**/node_modules": true,
|
||||||
"**/bower_components": true,
|
"**/bower_components": true,
|
||||||
"**/platforms": true,
|
"**/platforms": true,
|
||||||
"**/*.js": true,
|
"**/*.js": true,
|
||||||
"**/*.js.map": true
|
"**/*.js.map": true
|
||||||
}
|
},
|
||||||
}
|
"eslint.validate": ["json"]
|
||||||
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"@nativescript/ios": "~8.5.0",
|
"@nativescript/ios": "~8.5.0",
|
||||||
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
|
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
|
||||||
"circular-dependency-plugin": "^5.2.2",
|
"circular-dependency-plugin": "^5.2.2",
|
||||||
"typescript": "~4.9.5"
|
"typescript": "5.1.6"
|
||||||
},
|
},
|
||||||
"gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3",
|
"gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3",
|
||||||
"readme": "NativeScript Application"
|
"readme": "NativeScript Application"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "testsapp",
|
"name": "testsapp",
|
||||||
"main": "app.js"
|
"main": "app.js"
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"main": "lifecycle-tests"
|
"main": "lifecycle-tests"
|
||||||
}
|
}
|
||||||
|
@ -474,15 +474,15 @@ export var test_RepeaterItemsGestureBindings = function () {
|
|||||||
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
|
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
|
||||||
};
|
};
|
||||||
|
|
||||||
export var test_RepeaterItemsParentBindingsShouldWork = function () {
|
export var test_RepeaterItemsBindingsShouldWork = function () {
|
||||||
var testFunc = function (page: Page) {
|
var testFunc = function (page: Page) {
|
||||||
var repeater = <Repeater>page.getViewById('repeater');
|
var repeater = <Repeater>page.getViewById('repeater');
|
||||||
var expectedText = page.bindingContext['parentViewProperty'];
|
var expectedText = page.bindingContext['items'];
|
||||||
var testPass = false;
|
var testPass: string;
|
||||||
var eachChildCallback = function (childItem: View) {
|
var eachChildCallback = function (childItem: View) {
|
||||||
if (childItem instanceof Label) {
|
if (childItem instanceof Label) {
|
||||||
testPass = (<Label>childItem).text === expectedText;
|
testPass = (<Label>childItem).text;
|
||||||
if (testPass === false) {
|
if (!testPass) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (childItem instanceof LayoutBase) {
|
} else if (childItem instanceof LayoutBase) {
|
||||||
@ -494,7 +494,7 @@ export var test_RepeaterItemsParentBindingsShouldWork = function () {
|
|||||||
|
|
||||||
repeater.eachChildView(eachChildCallback);
|
repeater.eachChildView(eachChildCallback);
|
||||||
|
|
||||||
TKUnit.assertEqual(testPass, true, 'Every item should have text bound to Page binding context!');
|
TKUnit.assertEqual(!!testPass, true, 'Every item should have text bound to binding context!');
|
||||||
};
|
};
|
||||||
|
|
||||||
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
|
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function pageLoaded(args) {
|
export function pageLoaded(args) {
|
||||||
var page = args.object;
|
var page = args.object;
|
||||||
page.bindingContext = {
|
page.bindingContext = {
|
||||||
items: [
|
items: [
|
||||||
@ -18,8 +18,3 @@ function pageLoaded(args) {
|
|||||||
parentViewProperty: 'Parent View Property',
|
parentViewProperty: 'Parent View Property',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.pageLoaded = pageLoaded;
|
|
||||||
|
|
||||||
exports.tapPage = function (args) {
|
|
||||||
console.log('Tap! ' + args + ' ' + args.object);
|
|
||||||
};
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
|
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
|
||||||
<Repeater id="repeater" items="{{ items }}">
|
<Repeater id="repeater" items="{{ items }}">
|
||||||
<Repeater.itemTemplate>
|
<Repeater.itemTemplate>
|
||||||
<GridLayout width="94" height="94" >
|
<GridLayout width="94" height="94">
|
||||||
<Label text="{{ $parents['Page'].parentViewProperty }}" tap="{{ tapItem }}" />
|
<Label text="{{ text }}" tap="{{ tapItem }}" />
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
</Repeater.itemTemplate>
|
</Repeater.itemTemplate>
|
||||||
</Repeater>
|
</Repeater>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "MyControl",
|
"name": "MyControl",
|
||||||
"main": "MyControl.js"
|
"main": "MyControl.js"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "MyControl",
|
"name": "MyControl",
|
||||||
"main": "MyControl.js"
|
"main": "MyControl.js"
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "xml-declaration",
|
"name": "xml-declaration",
|
||||||
"main": "app.js"
|
"main": "app.js"
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,6 @@
|
|||||||
"@nativescript/android": "~8.5.0",
|
"@nativescript/android": "~8.5.0",
|
||||||
"@nativescript/ios": "~8.5.0",
|
"@nativescript/ios": "~8.5.0",
|
||||||
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
|
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
|
||||||
"typescript": "~4.9.5"
|
"typescript": "5.1.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"@nativescript/android": "~8.5.0",
|
"@nativescript/android": "~8.5.0",
|
||||||
"@nativescript/ios": "~8.5.0",
|
"@nativescript/ios": "~8.5.0",
|
||||||
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
|
"@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz",
|
||||||
"typescript": "~4.9.5"
|
"typescript": "5.1.6"
|
||||||
},
|
},
|
||||||
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
|
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
|
||||||
"readme": "NativeScript Application",
|
"readme": "NativeScript Application",
|
||||||
|
@ -18,8 +18,8 @@ Application.on('displayed', (args) => {
|
|||||||
Application.on('uncaughtError', (args) => {
|
Application.on('uncaughtError', (args) => {
|
||||||
const error = args.error;
|
const error = args.error;
|
||||||
console.warn(error.message);
|
console.warn(error.message);
|
||||||
if (error.nativeError) {
|
if (error.nativeException) {
|
||||||
console.warn('native error: ' + error.nativeError);
|
console.warn('native error: ' + error.nativeException);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
const { getJestProjects } = require('@nrwl/jest');
|
const { getJestProjects } = require('@nx/jest');
|
||||||
|
|
||||||
export default { projects: getJestProjects() };
|
export default { projects: getJestProjects() };
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const nxPreset = require('@nrwl/jest/preset').default;
|
const nxPreset = require('@nx/jest/preset').default;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...nxPreset,
|
...nxPreset,
|
||||||
|
124
migrations.json
Normal file
124
migrations.json
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
{
|
||||||
|
"migrations": [
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.0",
|
||||||
|
"description": "Remove @nrwl/cli.",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "16.0.0-remove-nrwl-cli"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.9",
|
||||||
|
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "16.0.0-tokens-for-depends-on"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.0",
|
||||||
|
"description": "Replace @nrwl/nx-cloud with nx-cloud",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "16.0.0-update-nx-cloud-runner"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.2.0-beta.0",
|
||||||
|
"description": "Remove outputPath from run commands",
|
||||||
|
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "16.2.0-remove-output-path-from-run-commands"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.6.0-beta.6",
|
||||||
|
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
|
||||||
|
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
|
||||||
|
"package": "nx",
|
||||||
|
"name": "16.6.0-prefix-outputs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.1",
|
||||||
|
"description": "Replace @nx/workspace with @nx/workspace",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||||
|
"package": "@nx/workspace",
|
||||||
|
"name": "update-16-0-0-add-nx-packages"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.0.0-beta.4",
|
||||||
|
"description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
|
||||||
|
"cli": "nx",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
|
||||||
|
"package": "@nx/workspace",
|
||||||
|
"name": "16-0-0-move-workspace-generators-into-local-plugin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "16.0.0-beta.9",
|
||||||
|
"description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
|
||||||
|
"cli": "nx",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
|
||||||
|
"package": "@nx/workspace",
|
||||||
|
"name": "16-0-0-fix-invalid-babelrc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.1",
|
||||||
|
"description": "Replace @nx/eslint-plugin with @nx/eslint-plugin",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||||
|
"package": "@nx/eslint-plugin",
|
||||||
|
"name": "update-16-0-0-add-nx-packages"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.1",
|
||||||
|
"description": "Replace @nx/node with @nx/node",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||||
|
"package": "@nx/node",
|
||||||
|
"name": "update-16-0-0-add-nx-packages"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.5",
|
||||||
|
"description": "Replace @nx/node:webpack with @nx/node:webpack",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0/update-webpack-executor",
|
||||||
|
"package": "@nx/node",
|
||||||
|
"name": "update-16-0-0-update-executor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.3.1-beta.0",
|
||||||
|
"description": "Replace @nx/node:webpack and @nx/node:webpack with @nx/webpack:webpack for all project targets",
|
||||||
|
"implementation": "./src/migrations/update-16-3-1/update-webpack-executor",
|
||||||
|
"package": "@nx/node",
|
||||||
|
"name": "update-16-3-1-update-executor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.4.0-beta.8",
|
||||||
|
"description": "Replace @nx/node:node with @nx/js:node for all project targets",
|
||||||
|
"implementation": "./src/migrations/update-16-4-0/replace-node-executor",
|
||||||
|
"package": "@nx/node",
|
||||||
|
"name": "update-16-4-0-replace-node-executor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.0.0-beta.1",
|
||||||
|
"description": "Replace @nx/jest with @nx/jest",
|
||||||
|
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||||
|
"package": "@nx/jest",
|
||||||
|
"name": "update-16-0-0-add-nx-packages"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "16.5.0-beta.2",
|
||||||
|
"description": "Add test-setup.ts to ignored files in production input",
|
||||||
|
"implementation": "./src/migrations/update-16-5-0/add-test-setup-to-inputs-ignore",
|
||||||
|
"package": "@nx/jest",
|
||||||
|
"name": "add-test-setup-to-inputs-ignore"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
30
nx.json
30
nx.json
@ -6,7 +6,7 @@
|
|||||||
},
|
},
|
||||||
"tasksRunnerOptions": {
|
"tasksRunnerOptions": {
|
||||||
"default": {
|
"default": {
|
||||||
"runner": "@nrwl/nx-cloud",
|
"runner": "nx-cloud",
|
||||||
"options": {
|
"options": {
|
||||||
"useDaemonProcess": false,
|
"useDaemonProcess": false,
|
||||||
"cacheableOperations": ["build", "lint", "test", "ios", "android", "e2e"],
|
"cacheableOperations": ["build", "lint", "test", "ios", "android", "e2e"],
|
||||||
@ -18,11 +18,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generators": {
|
"generators": {
|
||||||
"@nrwl/workspace": {
|
|
||||||
"library": {
|
|
||||||
"linter": "eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@nrwl/cypress": {
|
"@nrwl/cypress": {
|
||||||
"cypress-project": {
|
"cypress-project": {
|
||||||
"linter": "eslint"
|
"linter": "eslint"
|
||||||
@ -46,14 +41,6 @@
|
|||||||
"linter": "eslint"
|
"linter": "eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nrwl/node": {
|
|
||||||
"application": {
|
|
||||||
"linter": "eslint"
|
|
||||||
},
|
|
||||||
"library": {
|
|
||||||
"linter": "eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@nrwl/nx-plugin": {
|
"@nrwl/nx-plugin": {
|
||||||
"plugin": {
|
"plugin": {
|
||||||
"linter": "eslint"
|
"linter": "eslint"
|
||||||
@ -71,6 +58,19 @@
|
|||||||
"library": {
|
"library": {
|
||||||
"linter": "eslint"
|
"linter": "eslint"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"@nx/workspace": {
|
||||||
|
"library": {
|
||||||
|
"linter": "eslint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@nx/node": {
|
||||||
|
"application": {
|
||||||
|
"linter": "eslint"
|
||||||
|
},
|
||||||
|
"library": {
|
||||||
|
"linter": "eslint"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"affected": {
|
"affected": {
|
||||||
@ -80,7 +80,7 @@
|
|||||||
"namedInputs": {
|
"namedInputs": {
|
||||||
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
||||||
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/nx.json"],
|
"sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/nx.json"],
|
||||||
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s"]
|
"production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/src/test-setup.[jt]s"]
|
||||||
},
|
},
|
||||||
"targetDefaults": {
|
"targetDefaults": {
|
||||||
"build": {
|
"build": {
|
||||||
|
52
package.json
52
package.json
@ -18,25 +18,29 @@
|
|||||||
"url": "https://github.com/NativeScript/NativeScript.git"
|
"url": "https://github.com/NativeScript/NativeScript.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nrwl/nx-cloud": "15.3.5",
|
"@nx/devkit": "16.6.0",
|
||||||
"nativescript-theme-core": "^1.0.4"
|
"@swc/helpers": "~0.5.0",
|
||||||
|
"nativescript-theme-core": "^1.0.4",
|
||||||
|
"nx-cloud": "16.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nativescript/hook": "^2.0.0",
|
"@nativescript/hook": "^2.0.0",
|
||||||
"@nativescript/nx": "~4.2.0",
|
"@nativescript/nx": "^16.5.0",
|
||||||
"@nrwl/cli": "15.9.2",
|
"@nstudio/focus": "^16.5.0",
|
||||||
"@nrwl/eslint-plugin-nx": "15.9.2",
|
|
||||||
"@nrwl/jest": "15.9.2",
|
|
||||||
"@nrwl/node": "15.9.2",
|
|
||||||
"@nrwl/workspace": "15.9.2",
|
|
||||||
"@nstudio/focus": "^15.0.0",
|
|
||||||
"@nstudio/nps-i": "~2.0.0",
|
"@nstudio/nps-i": "~2.0.0",
|
||||||
|
"@nx/jest": "16.6.0",
|
||||||
|
"@nx/js": "16.6.0",
|
||||||
|
"@nx/plugin": "16.6.0",
|
||||||
|
"@nx/workspace": "16.6.0",
|
||||||
"@prettier/plugin-xml": "^2.2.0",
|
"@prettier/plugin-xml": "^2.2.0",
|
||||||
|
"@swc-node/register": "~1.4.2",
|
||||||
|
"@swc/cli": "~0.1.62",
|
||||||
|
"@swc/core": "~1.3.51",
|
||||||
"@types/jest": "~29.5.0",
|
"@types/jest": "~29.5.0",
|
||||||
"@types/node": "18.7.1",
|
"@types/node": "^18.7.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
||||||
"@typescript-eslint/parser": "^5.30.0",
|
"@typescript-eslint/parser": "^6.3.0",
|
||||||
"conventional-changelog-cli": "^2.2.2",
|
"conventional-changelog-cli": "^3.0.0",
|
||||||
"copyfiles": "^2.4.0",
|
"copyfiles": "^2.4.0",
|
||||||
"css": "^3.0.0",
|
"css": "^3.0.0",
|
||||||
"css-tree": "^1.1.2",
|
"css-tree": "^1.1.2",
|
||||||
@ -47,11 +51,12 @@
|
|||||||
"gonzales": "^1.0.7",
|
"gonzales": "^1.0.7",
|
||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"jest": "~29.5.0",
|
"jest": "~29.5.0",
|
||||||
"lint-staged": "^13.1.0",
|
"jest-environment-jsdom": "^29.4.1",
|
||||||
|
"lint-staged": "^13.2.0",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"nativescript": "~8.5.0",
|
"nativescript": "~8.5.0",
|
||||||
"nativescript-typedoc-theme": "1.1.0",
|
"nativescript-typedoc-theme": "1.1.0",
|
||||||
"nx": "15.9.2",
|
"nx": "16.6.0",
|
||||||
"parse-css": "git+https://github.com/tabatkins/parse-css.git",
|
"parse-css": "git+https://github.com/tabatkins/parse-css.git",
|
||||||
"parserlib": "^1.1.1",
|
"parserlib": "^1.1.1",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
@ -59,18 +64,19 @@
|
|||||||
"sass": "^1.45.2",
|
"sass": "^1.45.2",
|
||||||
"shady-css-parser": "^0.1.0",
|
"shady-css-parser": "^0.1.0",
|
||||||
"tree-kill": "^1.2.2",
|
"tree-kill": "^1.2.2",
|
||||||
"ts-jest": "29.1.0",
|
"ts-jest": "29.1.1",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.1",
|
||||||
"ts-patch": "^2.1.0",
|
"ts-patch": "^3.0.0",
|
||||||
"tslib": "^2.5.0",
|
"tslib": "^2.6.0",
|
||||||
"typedoc": "^0.23.24",
|
"typedoc": "^0.24.8",
|
||||||
"typescript": "~4.9.5",
|
"typescript": "5.1.6",
|
||||||
"zx": "^7.0.5"
|
"zx": "^7.0.5",
|
||||||
|
"@nx/eslint-plugin": "16.6.0",
|
||||||
|
"@nx/node": "16.6.0"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"**/*": [
|
"**/*": [
|
||||||
"nx format:write --files"
|
"nx format:write --files"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -120,6 +120,9 @@ global.UIApplicationDidChangeStatusBarOrientationNotification = 'UIApplicationDi
|
|||||||
global.UIResponder = function () {};
|
global.UIResponder = function () {};
|
||||||
global.UIResponder.extend = function () {};
|
global.UIResponder.extend = function () {};
|
||||||
global.UIViewController = function () {};
|
global.UIViewController = function () {};
|
||||||
|
global.UIViewControllerTransitioningDelegate = function () {};
|
||||||
|
global.UIGestureRecognizer = function () {};
|
||||||
|
global.UIGestureRecognizerDelegate = function () {};
|
||||||
global.UIAdaptivePresentationControllerDelegate = function () {};
|
global.UIAdaptivePresentationControllerDelegate = function () {};
|
||||||
global.UIPopoverPresentationControllerDelegate = function () {};
|
global.UIPopoverPresentationControllerDelegate = function () {};
|
||||||
global.UIContentSizeCategoryExtraSmall = 0.5;
|
global.UIContentSizeCategoryExtraSmall = 0.5;
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -4,6 +4,23 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>AvailableLibraries</key>
|
<key>AvailableLibraries</key>
|
||||||
<array>
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>DebugSymbolsPath</key>
|
||||||
|
<string>dSYMs</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>ios-arm64_x86_64-simulator</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>TNSWidgets.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
<string>x86_64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>ios</string>
|
||||||
|
<key>SupportedPlatformVariant</key>
|
||||||
|
<string>simulator</string>
|
||||||
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>DebugSymbolsPath</key>
|
<key>DebugSymbolsPath</key>
|
||||||
<string>dSYMs</string>
|
<string>dSYMs</string>
|
||||||
@ -35,23 +52,6 @@
|
|||||||
<key>SupportedPlatform</key>
|
<key>SupportedPlatform</key>
|
||||||
<string>ios</string>
|
<string>ios</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>DebugSymbolsPath</key>
|
|
||||||
<string>dSYMs</string>
|
|
||||||
<key>LibraryIdentifier</key>
|
|
||||||
<string>ios-arm64_x86_64-simulator</string>
|
|
||||||
<key>LibraryPath</key>
|
|
||||||
<string>TNSWidgets.framework</string>
|
|
||||||
<key>SupportedArchitectures</key>
|
|
||||||
<array>
|
|
||||||
<string>arm64</string>
|
|
||||||
<string>x86_64</string>
|
|
||||||
</array>
|
|
||||||
<key>SupportedPlatform</key>
|
|
||||||
<string>ios</string>
|
|
||||||
<key>SupportedPlatformVariant</key>
|
|
||||||
<string>simulator</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>XFWK</string>
|
<string>XFWK</string>
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>BuildMachineOSBuild</key>
|
<key>BuildMachineOSBuild</key>
|
||||||
<string>22D68</string>
|
<string>22F82</string>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
@ -29,19 +29,19 @@
|
|||||||
<key>DTCompiler</key>
|
<key>DTCompiler</key>
|
||||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||||
<key>DTPlatformBuild</key>
|
<key>DTPlatformBuild</key>
|
||||||
<string>14A309</string>
|
<string></string>
|
||||||
<key>DTPlatformName</key>
|
<key>DTPlatformName</key>
|
||||||
<string>macosx</string>
|
<string>macosx</string>
|
||||||
<key>DTPlatformVersion</key>
|
<key>DTPlatformVersion</key>
|
||||||
<string>12.3</string>
|
<string>13.3</string>
|
||||||
<key>DTSDKBuild</key>
|
<key>DTSDKBuild</key>
|
||||||
<string>21E226</string>
|
<string>22E245</string>
|
||||||
<key>DTSDKName</key>
|
<key>DTSDKName</key>
|
||||||
<string>macosx12.3</string>
|
<string>macosx13.3</string>
|
||||||
<key>DTXcode</key>
|
<key>DTXcode</key>
|
||||||
<string>1400</string>
|
<string>1431</string>
|
||||||
<key>DTXcodeBuild</key>
|
<key>DTXcodeBuild</key>
|
||||||
<string>14A309</string>
|
<string>14E300c</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.15</string>
|
<string>10.15</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -38,7 +38,7 @@
|
|||||||
</data>
|
</data>
|
||||||
<key>Info.plist</key>
|
<key>Info.plist</key>
|
||||||
<data>
|
<data>
|
||||||
myeIggkwNuTIqt7xlMgf8VGsKZ8=
|
xHG9+nBhI2hgaqloBzaUDHtutEU=
|
||||||
</data>
|
</data>
|
||||||
<key>Modules/module.modulemap</key>
|
<key>Modules/module.modulemap</key>
|
||||||
<data>
|
<data>
|
||||||
|
Binary file not shown.
@ -16,9 +16,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"executor": "@nrwl/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"inputs": ["default", "^production"],
|
"inputs": ["default", "^production"],
|
||||||
"outputs": ["dist/out-tsc"],
|
"outputs": ["{workspaceRoot}/dist/out-tsc"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "packages/core/jest.config.ts",
|
"jestConfig": "packages/core/jest.config.ts",
|
||||||
"passWithNoTests": true,
|
"passWithNoTests": true,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"noEmitOnError": true,
|
"noEmitOnError": true,
|
||||||
"noEmitHelpers": true,
|
"noEmitHelpers": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"noImplicitUseStrict": true,
|
"ignoreDeprecations": "5.0",
|
||||||
"removeComments": false,
|
"removeComments": false,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
@ -11,6 +11,7 @@ import { Observable, PropertyChangeData, WrappedValue } from '../../../data/obse
|
|||||||
import { Style } from '../../styling/style';
|
import { Style } from '../../styling/style';
|
||||||
import { paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddingLeftProperty } from '../../styling/style-properties';
|
import { paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddingLeftProperty } from '../../styling/style-properties';
|
||||||
import type { ModalTransition } from '../../transition/modal-transition';
|
import type { ModalTransition } from '../../transition/modal-transition';
|
||||||
|
import type { GestureEventData } from '../../gestures';
|
||||||
|
|
||||||
// TODO: Remove this import!
|
// TODO: Remove this import!
|
||||||
import { getClass } from '../../../utils/types';
|
import { getClass } from '../../../utils/types';
|
||||||
|
@ -31,7 +31,9 @@ const PFLAG_LAYOUT_REQUIRED = 1 << 2;
|
|||||||
const majorVersion = iOSNativeHelper.MajorVersion;
|
const majorVersion = iOSNativeHelper.MajorVersion;
|
||||||
|
|
||||||
export class View extends ViewCommon implements ViewDefinition {
|
export class View extends ViewCommon implements ViewDefinition {
|
||||||
|
// @ts-ignore
|
||||||
nativeViewProtected: UIView;
|
nativeViewProtected: UIView;
|
||||||
|
// @ts-ignore
|
||||||
viewController: UIViewController;
|
viewController: UIViewController;
|
||||||
private _popoverPresentationDelegate: IOSHelper.UIPopoverPresentationControllerDelegateImp;
|
private _popoverPresentationDelegate: IOSHelper.UIPopoverPresentationControllerDelegateImp;
|
||||||
private _adaptivePresentationDelegate: IOSHelper.UIAdaptivePresentationControllerDelegateImp;
|
private _adaptivePresentationDelegate: IOSHelper.UIAdaptivePresentationControllerDelegateImp;
|
||||||
@ -992,8 +994,6 @@ class UIViewControllerTransitioningDelegateImpl extends NSObject implements UIVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ContainerView extends View {
|
export class ContainerView extends View {
|
||||||
public iosOverflowSafeArea: boolean;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.iosOverflowSafeArea = true;
|
this.iosOverflowSafeArea = true;
|
||||||
@ -1001,6 +1001,7 @@ export class ContainerView extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class CustomLayoutView extends ContainerView {
|
export class CustomLayoutView extends ContainerView {
|
||||||
|
// @ts-ignore
|
||||||
nativeViewProtected: UIView;
|
nativeViewProtected: UIView;
|
||||||
|
|
||||||
createNativeView() {
|
createNativeView() {
|
||||||
|
@ -279,7 +279,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
|||||||
|
|
||||||
const gesture = gestureFromString(arg);
|
const gesture = gestureFromString(arg);
|
||||||
if (gesture && !this._isEvent(arg)) {
|
if (gesture && !this._isEvent(arg)) {
|
||||||
this._observe(gesture, callback, thisArg);
|
this._observe(gesture, callback as unknown as (data: GestureEventData) => void, thisArg);
|
||||||
} else {
|
} else {
|
||||||
const events = arg.split(',');
|
const events = arg.split(',');
|
||||||
if (events.length > 0) {
|
if (events.length > 0) {
|
||||||
@ -287,7 +287,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
|||||||
const evt = events[i].trim();
|
const evt = events[i].trim();
|
||||||
const gst = gestureFromString(evt);
|
const gst = gestureFromString(evt);
|
||||||
if (gst && !this._isEvent(arg)) {
|
if (gst && !this._isEvent(arg)) {
|
||||||
this._observe(gst, callback, thisArg);
|
this._observe(gst, callback as unknown as (data: GestureEventData) => void, thisArg);
|
||||||
} else {
|
} else {
|
||||||
super.addEventListener(evt, callback, thisArg);
|
super.addEventListener(evt, callback, thisArg);
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (typeof arg === 'number') {
|
} else if (typeof arg === 'number') {
|
||||||
this._observe(<GestureTypes>arg, callback, thisArg);
|
this._observe(<GestureTypes>arg, callback as unknown as (data: GestureEventData) => void, thisArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,46 +1,288 @@
|
|||||||
import { GestureEventData, GesturesObserver as GesturesObserverDefinition } from '.';
|
import type { GesturesObserver as GesturesObserverDefinition } from '.';
|
||||||
import { View } from '../core/view';
|
import type { View } from '../core/view';
|
||||||
|
import type { EventData } from '../../data/observable';
|
||||||
|
|
||||||
export * from './touch-manager';
|
export * from './touch-manager';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Events emitted during gesture lifecycle
|
||||||
|
*/
|
||||||
export enum GestureEvents {
|
export enum GestureEvents {
|
||||||
|
/**
|
||||||
|
* When the gesture is attached to the view
|
||||||
|
* Provides access to the native gesture recognizer for further customization
|
||||||
|
*/
|
||||||
gestureAttached = 'gestureAttached',
|
gestureAttached = 'gestureAttached',
|
||||||
|
/**
|
||||||
|
* When a touch down was detected
|
||||||
|
*/
|
||||||
touchDown = 'touchDown',
|
touchDown = 'touchDown',
|
||||||
|
/**
|
||||||
|
* When a touch up was detected
|
||||||
|
*/
|
||||||
touchUp = 'touchUp',
|
touchUp = 'touchUp',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines an enum with supported gesture types.
|
||||||
|
*/
|
||||||
export enum GestureTypes {
|
export enum GestureTypes {
|
||||||
|
/**
|
||||||
|
* Denotes tap (click) gesture.
|
||||||
|
*/
|
||||||
tap = 1 << 0,
|
tap = 1 << 0,
|
||||||
|
/**
|
||||||
|
* Denotes double tap gesture.
|
||||||
|
*/
|
||||||
doubleTap = 1 << 1,
|
doubleTap = 1 << 1,
|
||||||
|
/**
|
||||||
|
* Denotes pinch gesture.
|
||||||
|
*/
|
||||||
pinch = 1 << 2,
|
pinch = 1 << 2,
|
||||||
|
/**
|
||||||
|
* Denotes pan gesture.
|
||||||
|
*/
|
||||||
pan = 1 << 3,
|
pan = 1 << 3,
|
||||||
|
/**
|
||||||
|
* Denotes swipe gesture.
|
||||||
|
*/
|
||||||
swipe = 1 << 4,
|
swipe = 1 << 4,
|
||||||
|
/**
|
||||||
|
* Denotes rotation gesture.
|
||||||
|
*/
|
||||||
rotation = 1 << 5,
|
rotation = 1 << 5,
|
||||||
|
/**
|
||||||
|
* Denotes long press gesture.
|
||||||
|
*/
|
||||||
longPress = 1 << 6,
|
longPress = 1 << 6,
|
||||||
|
/**
|
||||||
|
* Denotes touch action.
|
||||||
|
*/
|
||||||
touch = 1 << 7,
|
touch = 1 << 7,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines an enum with supported gesture states.
|
||||||
|
*/
|
||||||
export enum GestureStateTypes {
|
export enum GestureStateTypes {
|
||||||
|
/**
|
||||||
|
* Gesture canceled.
|
||||||
|
*/
|
||||||
cancelled,
|
cancelled,
|
||||||
|
/**
|
||||||
|
* Gesture began.
|
||||||
|
*/
|
||||||
began,
|
began,
|
||||||
|
/**
|
||||||
|
* Gesture changed.
|
||||||
|
*/
|
||||||
changed,
|
changed,
|
||||||
|
/**
|
||||||
|
* Gesture ended.
|
||||||
|
*/
|
||||||
ended,
|
ended,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines an enum for swipe gesture direction.
|
||||||
|
*/
|
||||||
export enum SwipeDirection {
|
export enum SwipeDirection {
|
||||||
|
/**
|
||||||
|
* Denotes right direction for swipe gesture.
|
||||||
|
*/
|
||||||
right = 1 << 0,
|
right = 1 << 0,
|
||||||
|
/**
|
||||||
|
* Denotes left direction for swipe gesture.
|
||||||
|
*/
|
||||||
left = 1 << 1,
|
left = 1 << 1,
|
||||||
|
/**
|
||||||
|
* Denotes up direction for swipe gesture.
|
||||||
|
*/
|
||||||
up = 1 << 2,
|
up = 1 << 2,
|
||||||
|
/**
|
||||||
|
* Denotes down direction for swipe gesture.
|
||||||
|
*/
|
||||||
down = 1 << 3,
|
down = 1 << 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace TouchAction {
|
/**
|
||||||
export const down = 'down';
|
* Defines a touch action
|
||||||
export const up = 'up';
|
*/
|
||||||
export const move = 'move';
|
export enum TouchAction {
|
||||||
export const cancel = 'cancel';
|
/**
|
||||||
|
* Down action.
|
||||||
|
*/
|
||||||
|
down = 'down',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Up action.
|
||||||
|
*/
|
||||||
|
up = 'up',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move action.
|
||||||
|
*/
|
||||||
|
move = 'move',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancel action.
|
||||||
|
*/
|
||||||
|
cancel = 'cancel',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data.
|
||||||
|
*/
|
||||||
|
export interface GestureEventData extends EventData {
|
||||||
|
/**
|
||||||
|
* Gets the type of the gesture.
|
||||||
|
*/
|
||||||
|
type: GestureTypes;
|
||||||
|
/**
|
||||||
|
* Gets the view which originates the gesture.
|
||||||
|
*/
|
||||||
|
view: View;
|
||||||
|
/**
|
||||||
|
* Gets the underlying native iOS specific [UIGestureRecognizer](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIGestureRecognizer_Class/).
|
||||||
|
*/
|
||||||
|
ios: any /* UIGestureRecognizer */;
|
||||||
|
/**
|
||||||
|
* Gets the underlying native android specific [gesture detector](http://developer.android.com/reference/android/view/GestureDetector.html).
|
||||||
|
*/
|
||||||
|
android: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data.
|
||||||
|
*/
|
||||||
|
export interface TapGestureEventData extends GestureEventData {
|
||||||
|
/**
|
||||||
|
* Gets the number of pointers in the event.
|
||||||
|
*/
|
||||||
|
getPointerCount(): number;
|
||||||
|
/**
|
||||||
|
* Gets the X coordinate of this event inside the view that triggered the event
|
||||||
|
*/
|
||||||
|
getX(): number;
|
||||||
|
/**
|
||||||
|
* Gets the Y coordinate of the event inside the view that triggered the event.
|
||||||
|
*/
|
||||||
|
getY(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data.
|
||||||
|
*/
|
||||||
|
export interface TouchGestureEventData extends TapGestureEventData {
|
||||||
|
/**
|
||||||
|
* Gets action of the touch. Possible values: 'up', 'move', 'down', 'cancel'
|
||||||
|
*/
|
||||||
|
action: 'up' | 'move' | 'down' | 'cancel';
|
||||||
|
/**
|
||||||
|
* Gets the pointers that triggered the event.
|
||||||
|
* Note: In Android there is aways only one active pointer.
|
||||||
|
*/
|
||||||
|
getActivePointers(): Array<Pointer>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all pointers.
|
||||||
|
*/
|
||||||
|
getAllPointers(): Array<Pointer>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointer is an object representing a finger (or other object) that is touching the screen.
|
||||||
|
*/
|
||||||
|
export interface Pointer {
|
||||||
|
/**
|
||||||
|
* The id of the pointer.
|
||||||
|
*/
|
||||||
|
android: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UITouch object associated to the touch
|
||||||
|
*/
|
||||||
|
ios: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the X coordinate of the pointer inside the view that triggered the event.
|
||||||
|
*/
|
||||||
|
getX(): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Y coordinate of the pointer inside the view that triggered the event.
|
||||||
|
*/
|
||||||
|
getY(): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gests the X coordinate of the pointer inside the view that triggered the event.
|
||||||
|
* @returns The X coordinate in _Device Pixels_.
|
||||||
|
*/
|
||||||
|
getXPixels(): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the X coordinate of the pointer inside the view that triggered the event.
|
||||||
|
* @returns The X coordinate in _Device Independent Pixels_.
|
||||||
|
*/
|
||||||
|
getXDIP(): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gests the Y coordinate of the pointer inside the view that triggered the event.
|
||||||
|
* @returns The Y coordinate in _Device Pixels_.
|
||||||
|
*/
|
||||||
|
getYPixels(): number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Y coordinate of the pointer inside the view that triggered the event.
|
||||||
|
* @returns The Y coordinate in _Device Independent Pixels_.
|
||||||
|
*/
|
||||||
|
getYDIP(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data.
|
||||||
|
*/
|
||||||
|
export interface GestureEventDataWithState extends GestureEventData {
|
||||||
|
state: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data for pinch gesture.
|
||||||
|
*/
|
||||||
|
export interface PinchGestureEventData extends GestureEventDataWithState {
|
||||||
|
scale: number;
|
||||||
|
|
||||||
|
getFocusX(): number;
|
||||||
|
getFocusY(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data for swipe gesture.
|
||||||
|
*/
|
||||||
|
export interface SwipeGestureEventData extends GestureEventData {
|
||||||
|
direction: SwipeDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data for pan gesture.
|
||||||
|
*/
|
||||||
|
export interface PanGestureEventData extends GestureEventDataWithState {
|
||||||
|
deltaX: number;
|
||||||
|
deltaY: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides gesture event data for rotation gesture.
|
||||||
|
*/
|
||||||
|
export interface RotationGestureEventData extends GestureEventDataWithState {
|
||||||
|
rotation: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of a gesture type.
|
||||||
|
* @param type - Type of the gesture.
|
||||||
|
* @param separator(optional) - Text separator between gesture type strings.
|
||||||
|
*/
|
||||||
export function toString(type: GestureTypes, separator?: string): string {
|
export function toString(type: GestureTypes, separator?: string): string {
|
||||||
const types = new Array<string>();
|
const types = new Array<string>();
|
||||||
|
|
||||||
@ -81,6 +323,10 @@ export function toString(type: GestureTypes, separator?: string): string {
|
|||||||
|
|
||||||
// NOTE: toString could return the text of multiple GestureTypes.
|
// NOTE: toString could return the text of multiple GestureTypes.
|
||||||
// Souldn't fromString do split on separator and return multiple GestureTypes?
|
// Souldn't fromString do split on separator and return multiple GestureTypes?
|
||||||
|
/**
|
||||||
|
* Returns a gesture type enum value from a string (case insensitive).
|
||||||
|
* @param type - A string representation of a gesture type (e.g. Tap).
|
||||||
|
*/
|
||||||
export function fromString(type: string): GestureTypes {
|
export function fromString(type: string): GestureTypes {
|
||||||
const t = type.trim().toLowerCase();
|
const t = type.trim().toLowerCase();
|
||||||
|
|
||||||
|
291
packages/core/ui/gestures/index.d.ts
vendored
291
packages/core/ui/gestures/index.d.ts
vendored
@ -1,282 +1,8 @@
|
|||||||
import { View } from '../core/view';
|
import type { View } from '../core/view';
|
||||||
import { EventData } from '../../data/observable';
|
|
||||||
|
|
||||||
|
export * from './gestures-common';
|
||||||
export * from './touch-manager';
|
export * from './touch-manager';
|
||||||
|
|
||||||
/**
|
|
||||||
* Events emitted during gesture lifecycle
|
|
||||||
*/
|
|
||||||
export enum GestureEvents {
|
|
||||||
/**
|
|
||||||
* When the gesture is attached to the view
|
|
||||||
* Provides access to the native gesture recognizer for further customization
|
|
||||||
*/
|
|
||||||
gestureAttached = 'gestureAttached',
|
|
||||||
/**
|
|
||||||
* When a touch down was detected
|
|
||||||
*/
|
|
||||||
touchDown = 'touchDown',
|
|
||||||
/**
|
|
||||||
* When a touch up was detected
|
|
||||||
*/
|
|
||||||
touchUp = 'touchUp',
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines an enum with supported gesture types.
|
|
||||||
*/
|
|
||||||
export enum GestureTypes {
|
|
||||||
/**
|
|
||||||
* Denotes tap (click) gesture.
|
|
||||||
*/
|
|
||||||
tap,
|
|
||||||
/**
|
|
||||||
* Denotes double tap gesture.
|
|
||||||
*/
|
|
||||||
doubleTap,
|
|
||||||
/**
|
|
||||||
* Denotes pinch gesture.
|
|
||||||
*/
|
|
||||||
pinch,
|
|
||||||
/**
|
|
||||||
* Denotes pan gesture.
|
|
||||||
*/
|
|
||||||
pan,
|
|
||||||
/**
|
|
||||||
* Denotes swipe gesture.
|
|
||||||
*/
|
|
||||||
swipe,
|
|
||||||
/**
|
|
||||||
* Denotes rotation gesture.
|
|
||||||
*/
|
|
||||||
rotation,
|
|
||||||
/**
|
|
||||||
* Denotes long press gesture.
|
|
||||||
*/
|
|
||||||
longPress,
|
|
||||||
/**
|
|
||||||
* Denotes touch action.
|
|
||||||
*/
|
|
||||||
touch,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines an enum with supported gesture states.
|
|
||||||
*/
|
|
||||||
export enum GestureStateTypes {
|
|
||||||
/**
|
|
||||||
* Gesture canceled.
|
|
||||||
*/
|
|
||||||
cancelled,
|
|
||||||
/**
|
|
||||||
* Gesture began.
|
|
||||||
*/
|
|
||||||
began,
|
|
||||||
/**
|
|
||||||
* Gesture changed.
|
|
||||||
*/
|
|
||||||
changed,
|
|
||||||
/**
|
|
||||||
* Gesture ended.
|
|
||||||
*/
|
|
||||||
ended,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines an enum for swipe gesture direction.
|
|
||||||
*/
|
|
||||||
export enum SwipeDirection {
|
|
||||||
/**
|
|
||||||
* Denotes right direction for swipe gesture.
|
|
||||||
*/
|
|
||||||
right,
|
|
||||||
/**
|
|
||||||
* Denotes left direction for swipe gesture.
|
|
||||||
*/
|
|
||||||
left,
|
|
||||||
/**
|
|
||||||
* Denotes up direction for swipe gesture.
|
|
||||||
*/
|
|
||||||
up,
|
|
||||||
/**
|
|
||||||
* Denotes down direction for swipe gesture.
|
|
||||||
*/
|
|
||||||
down,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines a touch action
|
|
||||||
*/
|
|
||||||
export namespace TouchAction {
|
|
||||||
/**
|
|
||||||
* Down action.
|
|
||||||
*/
|
|
||||||
export const down: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Up action.
|
|
||||||
*/
|
|
||||||
export const up: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move action.
|
|
||||||
*/
|
|
||||||
export const move: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancel action.
|
|
||||||
*/
|
|
||||||
export const cancel: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data.
|
|
||||||
*/
|
|
||||||
export interface GestureEventData extends EventData {
|
|
||||||
/**
|
|
||||||
* Gets the type of the gesture.
|
|
||||||
*/
|
|
||||||
type: GestureTypes;
|
|
||||||
/**
|
|
||||||
* Gets the view which originates the gesture.
|
|
||||||
*/
|
|
||||||
view: View;
|
|
||||||
/**
|
|
||||||
* Gets the underlying native iOS specific [UIGestureRecognizer](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIGestureRecognizer_Class/).
|
|
||||||
*/
|
|
||||||
ios: any /* UIGestureRecognizer */;
|
|
||||||
/**
|
|
||||||
* Gets the underlying native android specific [gesture detector](http://developer.android.com/reference/android/view/GestureDetector.html).
|
|
||||||
*/
|
|
||||||
android: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data.
|
|
||||||
*/
|
|
||||||
export interface TapGestureEventData extends GestureEventData {
|
|
||||||
/**
|
|
||||||
* Gets the number of pointers in the event.
|
|
||||||
*/
|
|
||||||
getPointerCount(): number;
|
|
||||||
/**
|
|
||||||
* Gets the X coordinate of this event inside the view that triggered the event
|
|
||||||
*/
|
|
||||||
getX(): number;
|
|
||||||
/**
|
|
||||||
* Gets the Y coordinate of the event inside the view that triggered the event.
|
|
||||||
*/
|
|
||||||
getY(): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data.
|
|
||||||
*/
|
|
||||||
export interface TouchGestureEventData extends TapGestureEventData {
|
|
||||||
/**
|
|
||||||
* Gets action of the touch. Possible values: 'up', 'move', 'down', 'cancel'
|
|
||||||
*/
|
|
||||||
action: 'up' | 'move' | 'down' | 'cancel';
|
|
||||||
/**
|
|
||||||
* Gets the pointers that triggered the event.
|
|
||||||
* Note: In Android there is aways only one active pointer.
|
|
||||||
*/
|
|
||||||
getActivePointers(): Array<Pointer>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets all pointers.
|
|
||||||
*/
|
|
||||||
getAllPointers(): Array<Pointer>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pointer is an object representing a finger (or other object) that is touching the screen.
|
|
||||||
*/
|
|
||||||
export interface Pointer {
|
|
||||||
/**
|
|
||||||
* The id of the pointer.
|
|
||||||
*/
|
|
||||||
android: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The UITouch object associated to the touch
|
|
||||||
*/
|
|
||||||
ios: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the X coordinate of the pointer inside the view that triggered the event.
|
|
||||||
*/
|
|
||||||
getX(): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the Y coordinate of the pointer inside the view that triggered the event.
|
|
||||||
*/
|
|
||||||
getY(): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gests the X coordinate of the pointer inside the view that triggered the event.
|
|
||||||
* @returns The X coordinate in _Device Pixels_.
|
|
||||||
*/
|
|
||||||
getXPixels(): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the X coordinate of the pointer inside the view that triggered the event.
|
|
||||||
* @returns The X coordinate in _Device Independent Pixels_.
|
|
||||||
*/
|
|
||||||
getXDIP(): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gests the Y coordinate of the pointer inside the view that triggered the event.
|
|
||||||
* @returns The Y coordinate in _Device Pixels_.
|
|
||||||
*/
|
|
||||||
getYPixels(): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the Y coordinate of the pointer inside the view that triggered the event.
|
|
||||||
* @returns The Y coordinate in _Device Independent Pixels_.
|
|
||||||
*/
|
|
||||||
getYDIP(): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data.
|
|
||||||
*/
|
|
||||||
export interface GestureEventDataWithState extends GestureEventData {
|
|
||||||
state: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data for pinch gesture.
|
|
||||||
*/
|
|
||||||
export interface PinchGestureEventData extends GestureEventDataWithState {
|
|
||||||
scale: number;
|
|
||||||
|
|
||||||
getFocusX(): number;
|
|
||||||
getFocusY(): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data for swipe gesture.
|
|
||||||
*/
|
|
||||||
export interface SwipeGestureEventData extends GestureEventData {
|
|
||||||
direction: SwipeDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data for pan gesture.
|
|
||||||
*/
|
|
||||||
export interface PanGestureEventData extends GestureEventDataWithState {
|
|
||||||
deltaX: number;
|
|
||||||
deltaY: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides gesture event data for rotation gesture.
|
|
||||||
*/
|
|
||||||
export interface RotationGestureEventData extends GestureEventDataWithState {
|
|
||||||
rotation: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides options for the GesturesObserver.
|
* Provides options for the GesturesObserver.
|
||||||
*/
|
*/
|
||||||
@ -329,16 +55,3 @@ export class GesturesObserver {
|
|||||||
* @param context - this argument for the callback.
|
* @param context - this argument for the callback.
|
||||||
*/
|
*/
|
||||||
export function observe(target: View, type: GestureTypes, callback: (args: GestureEventData) => void, context?: any): GesturesObserver;
|
export function observe(target: View, type: GestureTypes, callback: (args: GestureEventData) => void, context?: any): GesturesObserver;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a string representation of a gesture type.
|
|
||||||
* @param type - Type of the gesture.
|
|
||||||
* @param separator(optional) - Text separator between gesture type strings.
|
|
||||||
*/
|
|
||||||
export function toString(type: GestureTypes, separator?: string): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a gesture type enum value from a string (case insensitive).
|
|
||||||
* @param type - A string representation of a gesture type (e.g. Tap).
|
|
||||||
*/
|
|
||||||
export function fromString(type: string): GestureTypes;
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { GestureTypes } from '../gestures';
|
||||||
import { SharedTransition, SharedTransitionAnimationType } from './shared-transition';
|
import { SharedTransition, SharedTransitionAnimationType } from './shared-transition';
|
||||||
|
|
||||||
describe('SharedTransition', () => {
|
describe('SharedTransition', () => {
|
||||||
@ -44,7 +45,7 @@ describe('SharedTransition', () => {
|
|||||||
const state = SharedTransition.getState(transition.instance.id);
|
const state = SharedTransition.getState(transition.instance.id);
|
||||||
expect(state.activeType).toBe(SharedTransitionAnimationType.present);
|
expect(state.activeType).toBe(SharedTransitionAnimationType.present);
|
||||||
expect(state.interactive.dismiss.finishThreshold).toBe(0.6);
|
expect(state.interactive.dismiss.finishThreshold).toBe(0.6);
|
||||||
expect(state.interactive.dismiss.percentFormula({ deltaX: 0.9, deltaY: 0, state: 0, android: null, eventName: 'pan', ios: null, object: null, type: 3, view: null })).toBe(0.7);
|
expect(state.interactive.dismiss.percentFormula({ deltaX: 0.9, deltaY: 0, state: 0, android: null, eventName: 'pan', ios: null, object: null, type: GestureTypes.pan, view: null })).toBe(0.7);
|
||||||
expect(state.pageStart.x).toBe(200);
|
expect(state.pageStart.x).toBe(200);
|
||||||
expect(state.pageStart.y).toBe(100);
|
expect(state.pageStart.y).toBe(100);
|
||||||
expect(state.pageStart.spring.friction).toBe(40);
|
expect(state.pageStart.spring.friction).toBe(40);
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-android",
|
"name": "@nativescript/types-android",
|
||||||
"version": "8.5.0",
|
"version": "8.5.0",
|
||||||
"description": "NativeScript Types for Android.",
|
"description": "NativeScript Types for Android.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NativeScript/NativeScript"
|
"url": "https://github.com/NativeScript/NativeScript"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-ios",
|
"name": "@nativescript/types-ios",
|
||||||
"version": "8.5.0",
|
"version": "8.5.0",
|
||||||
"description": "NativeScript Types for iOS.",
|
"description": "NativeScript Types for iOS.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NativeScript/NativeScript"
|
"url": "https://github.com/NativeScript/NativeScript"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types-minimal",
|
"name": "@nativescript/types-minimal",
|
||||||
"version": "8.5.0",
|
"version": "8.5.0",
|
||||||
"description": "NativeScript 'Minimal' Types for only the latest Android and iOS sdks.",
|
"description": "NativeScript 'Minimal' Types for only the latest Android and iOS sdks.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NativeScript/NativeScript"
|
"url": "https://github.com/NativeScript/NativeScript"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/types",
|
"name": "@nativescript/types",
|
||||||
"version": "8.5.0",
|
"version": "8.5.0",
|
||||||
"description": "NativeScript Types for all supported platforms.",
|
"description": "NativeScript Types for all supported platforms.",
|
||||||
"homepage": "https://nativescript.org",
|
"homepage": "https://nativescript.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NativeScript/NativeScript"
|
"url": "https://github.com/NativeScript/NativeScript"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"index.d.ts"
|
"index.d.ts"
|
||||||
],
|
],
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nativescript/types-ios": "~8.5.0",
|
"@nativescript/types-ios": "~8.5.0",
|
||||||
"@nativescript/types-android": "~8.5.0"
|
"@nativescript/types-android": "~8.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -337,7 +337,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@ -390,7 +390,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
@ -411,6 +411,7 @@
|
|||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
INFOPLIST_FILE = TNSWidgets/Info.plist;
|
INFOPLIST_FILE = TNSWidgets/Info.plist;
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgets;
|
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgets;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@ -429,6 +430,7 @@
|
|||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
INFOPLIST_FILE = TNSWidgets/Info.plist;
|
INFOPLIST_FILE = TNSWidgets/Info.plist;
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgets;
|
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgets;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@ -440,6 +442,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
INFOPLIST_FILE = TNSWidgetsTests/Info.plist;
|
INFOPLIST_FILE = TNSWidgetsTests/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgetsTests;
|
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgetsTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@ -450,6 +453,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
INFOPLIST_FILE = TNSWidgetsTests/Info.plist;
|
INFOPLIST_FILE = TNSWidgetsTests/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgetsTests;
|
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TNSWidgetsTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "@nativescript/ui-mobile-base",
|
"name": "@nativescript/ui-mobile-base",
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"description": "Native UI base components used with NativeScript.",
|
"description": "Native UI base components used with NativeScript.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NativeScript/NativeScript"
|
"url": "https://github.com/NativeScript/NativeScript"
|
||||||
},
|
},
|
||||||
"author": "NativeScript team",
|
"author": "NativeScript team",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/NativeScript/NativeScript/issues"
|
"url": "https://github.com/NativeScript/NativeScript/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules-widgets#readme",
|
"homepage": "https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules-widgets#readme",
|
||||||
"nativescript": {
|
"nativescript": {
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"ios": "6.0.0",
|
"ios": "6.0.0",
|
||||||
"android": "6.0.0"
|
"android": "6.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
"jest-matcher-utils": "29.4.1",
|
"jest-matcher-utils": "29.4.1",
|
||||||
"nativescript-vue-template-compiler": "2.9.3",
|
"nativescript-vue-template-compiler": "2.9.3",
|
||||||
"ts-jest": "29.1.0",
|
"ts-jest": "29.1.0",
|
||||||
"typescript": "~4.9.5"
|
"typescript": "5.1.6"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"nativescript-vue-template-compiler": "^2.8.1"
|
"nativescript-vue-template-compiler": "^2.8.1"
|
||||||
|
@ -12,7 +12,7 @@ export default function (ctx: ts.TransformationContext) {
|
|||||||
decorators = ts.getDecorators(node);
|
decorators = ts.getDecorators(node);
|
||||||
} else {
|
} else {
|
||||||
// fallback to old behavior on older typescript versions
|
// fallback to old behavior on older typescript versions
|
||||||
decorators = node.decorators;
|
decorators = (node as any).decorators;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!decorators?.some((d) => {
|
return !!decorators?.some((d) => {
|
||||||
@ -53,6 +53,6 @@ export default function (ctx: ts.TransformationContext) {
|
|||||||
return (source: ts.SourceFile) =>
|
return (source: ts.SourceFile) =>
|
||||||
ts.factory.updateSourceFile(
|
ts.factory.updateSourceFile(
|
||||||
source,
|
source,
|
||||||
ts.visitNodes(source.statements, visitNode)
|
ts.visitNodes(source.statements, visitNode) as ts.NodeArray<ts.Statement>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
32
tools/workspace-plugin/.eslintrc.json
Normal file
32
tools/workspace-plugin/.eslintrc.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"extends": ["../../.eslintrc.json"],
|
||||||
|
"ignorePatterns": ["!**/*"],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.js", "*.jsx"],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.json"],
|
||||||
|
"parser": "jsonc-eslint-parser",
|
||||||
|
"rules": {
|
||||||
|
"@nx/dependency-checks": "error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["./package.json", "./generators.json"],
|
||||||
|
"parser": "jsonc-eslint-parser",
|
||||||
|
"rules": {
|
||||||
|
"@nx/nx-plugin-checks": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
9
tools/workspace-plugin/generators.json
Normal file
9
tools/workspace-plugin/generators.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"generators": {
|
||||||
|
"app": {
|
||||||
|
"implementation": "./src/generators/app",
|
||||||
|
"schema": "./src/generators/app/schema.json",
|
||||||
|
"description": "Generator app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10
tools/workspace-plugin/jest.config.ts
Normal file
10
tools/workspace-plugin/jest.config.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
export default {
|
||||||
|
displayName: 'workspace-plugin',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
transform: {
|
||||||
|
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
||||||
|
},
|
||||||
|
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||||
|
coverageDirectory: '../../coverage/tools/workspace-plugin',
|
||||||
|
};
|
11
tools/workspace-plugin/package.json
Normal file
11
tools/workspace-plugin/package.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "@nativescript/workspace-plugin",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
},
|
||||||
|
"type": "commonjs",
|
||||||
|
"main": "./src/index.js",
|
||||||
|
"typings": "./src/index.d.ts",
|
||||||
|
"generators": "./generators.json"
|
||||||
|
}
|
61
tools/workspace-plugin/project.json
Normal file
61
tools/workspace-plugin/project.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"name": "workspace-plugin",
|
||||||
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"sourceRoot": "tools/workspace-plugin/src",
|
||||||
|
"projectType": "library",
|
||||||
|
"targets": {
|
||||||
|
"build": {
|
||||||
|
"executor": "@nx/js:tsc",
|
||||||
|
"outputs": ["{options.outputPath}"],
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/tools/workspace-plugin",
|
||||||
|
"main": "tools/workspace-plugin/src/index.ts",
|
||||||
|
"tsConfig": "tools/workspace-plugin/tsconfig.lib.json",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"input": "./tools/workspace-plugin/src",
|
||||||
|
"glob": "**/!(*.ts)",
|
||||||
|
"output": "./src"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "./tools/workspace-plugin/src",
|
||||||
|
"glob": "**/*.d.ts",
|
||||||
|
"output": "./src"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "./tools/workspace-plugin",
|
||||||
|
"glob": "generators.json",
|
||||||
|
"output": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input": "./tools/workspace-plugin",
|
||||||
|
"glob": "executors.json",
|
||||||
|
"output": "."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nx/linter:eslint",
|
||||||
|
"outputs": ["{options.outputFile}"],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": ["tools/workspace-plugin/**/*.ts", "tools/workspace-plugin/package.json", "tools/workspace-plugin/generators.json"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"executor": "@nx/jest:jest",
|
||||||
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "tools/workspace-plugin/jest.config.ts",
|
||||||
|
"passWithNoTests": true
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"ci": true,
|
||||||
|
"codeCoverage": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
}
|
@ -2,7 +2,7 @@ import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
|
|||||||
|
|
||||||
export default function (schema: any): Rule {
|
export default function (schema: any): Rule {
|
||||||
return chain([
|
return chain([
|
||||||
externalSchematic('@nrwl/workspace', 'lib', {
|
externalSchematic('@nx/workspace', 'lib', {
|
||||||
name: schema.name,
|
name: schema.name,
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
16
tools/workspace-plugin/tsconfig.json
Normal file
16
tools/workspace-plugin/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs"
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.lib.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
10
tools/workspace-plugin/tsconfig.lib.json
Normal file
10
tools/workspace-plugin/tsconfig.lib.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"declaration": true,
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts"],
|
||||||
|
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
||||||
|
}
|
9
tools/workspace-plugin/tsconfig.spec.json
Normal file
9
tools/workspace-plugin/tsconfig.spec.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"module": "commonjs",
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
},
|
||||||
|
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
|
||||||
|
}
|
@ -21,7 +21,8 @@
|
|||||||
"@nativescript/core": ["packages/core/index.ts"],
|
"@nativescript/core": ["packages/core/index.ts"],
|
||||||
"@nativescript/core/*": ["packages/core/*"],
|
"@nativescript/core/*": ["packages/core/*"],
|
||||||
"@nativescript/types-android": ["packages/types-android/src/index.ts"],
|
"@nativescript/types-android": ["packages/types-android/src/index.ts"],
|
||||||
"@nativescript/types-ios": ["packages/types-ios/src/index.ts"]
|
"@nativescript/types-ios": ["packages/types-ios/src/index.ts"],
|
||||||
|
"@nativescript/workspace-plugin": ["tools/workspace-plugin/src/index.ts"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "tmp", "platforms", "__tests__"]
|
"exclude": ["node_modules", "tmp", "platforms", "__tests__"]
|
||||||
|
Reference in New Issue
Block a user