From b147612e06cc9e218d1977ff56f9f50b466123de Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 28 Nov 2022 14:30:32 -0800 Subject: [PATCH] test: standardized jest unit testing (#10047) --- .github/workflows/apps_automated.yml | 3 + .travis.yml | 10 - jest.preset.js | 12 +- package.json | 9 +- packages/core/__tests__/.mocharc.yml | 49 - packages/core/__tests__/WritingUnitTests.md | 88 - packages/core/__tests__/common-types.d.ts | 33 - .../__tests__/css/out/nativescript.css.json | 5578 ---------------- .../core/__tests__/css/out/rework.css.json | 5583 ----------------- packages/core/__tests__/package.json | 3 - .../__tests__/polyfills/file-system-access.ts | 7 - .../__tests__/polyfills/mainthread-helper.ts | 0 packages/core/__tests__/polyfills/platform.ts | 0 packages/core/__tests__/runtime.ts | 23 - packages/core/__tests__/tsconfig.json | 25 - .../core/__tests__/ui/styling/css-selector.ts | 302 - .../core/__tests__/ui/styling/css-shadow.ts | 145 - .../core/__tests__/xml/test-angular-xml.ts | 81 - packages/core/__tests__/xml/test-xml.ts | 51 - .../accessibility/accessibility-common.ts | 2 +- packages/core/accessibility/index.ios.ts | 2 +- packages/core/color/LICENSE | 8 + packages/core/color/color-common.ts | 9 +- packages/core/color/index.android.ts | 4 +- packages/core/color/index.d.ts | 2 +- packages/core/color/index.ios.ts | 4 +- packages/core/color/known-colors.d.ts | 144 - packages/core/core-types/index.ts | 5 + packages/core/css/css-tree-parser.js | 6 +- .../css-tree-parser.spec.ts} | 44 +- .../css/parser.ts => css/parser.spec.ts} | 129 +- packages/core/css/reworkcss.d.ts | 4 +- .../observable-array/index.spec.ts} | 17 +- .../observable/index.spec.ts} | 17 +- packages/core/fps-meter/fps-native.ios.ts | 2 +- packages/core/globals/index.ts | 8 +- packages/core/jest.config.ts | 26 +- packages/core/jest.setup.ts | 175 + packages/core/project.json | 24 +- packages/core/tsconfig.json | 15 +- packages/core/tsconfig.lib.json | 2 +- packages/core/tsconfig.spec.json | 12 +- packages/core/ui/action-bar/index.android.ts | 4 +- packages/core/ui/action-bar/index.ios.ts | 2 +- packages/core/ui/animation/index.android.ts | 4 +- packages/core/ui/button/index.ios.ts | 2 +- packages/core/ui/core/bindable/index.ts | 2 +- packages/core/ui/core/properties/index.ts | 1 - .../ui/core/view/view-helper/index.ios.ts | 14 +- packages/core/ui/date-picker/index.ios.ts | 2 +- .../ui/editable-text-base/index.android.ts | 2 - packages/core/ui/frame/index.android.ts | 6 +- packages/core/ui/frame/index.ios.ts | 8 +- packages/core/ui/gestures/index.ios.ts | 2 +- packages/core/ui/gestures/touch-manager.ts | 8 +- packages/core/ui/image-cache/index.android.ts | 4 +- .../absolute-layout/absolute-layout-common.ts | 6 +- packages/core/ui/list-picker/index.ios.ts | 6 +- packages/core/ui/list-view/index.ios.ts | 18 +- packages/core/ui/page/index.ios.ts | 18 +- packages/core/ui/scroll-view/index.android.ts | 8 +- packages/core/ui/scroll-view/index.ios.ts | 2 +- packages/core/ui/search-bar/index.ios.ts | 6 +- packages/core/ui/segmented-bar/index.ios.ts | 2 +- packages/core/ui/slider/index.ios.ts | 6 +- packages/core/ui/styling/css-selector.spec.ts | 290 + .../index.ts => css-selector.ts} | 20 +- packages/core/ui/styling/css-shadow.spec.ts | 137 + packages/core/ui/styling/css-shadow.ts | 8 +- packages/core/ui/styling/font-common.ts | 10 +- packages/core/ui/styling/font-interfaces.ts | 15 +- packages/core/ui/styling/font.android.ts | 9 +- packages/core/ui/styling/font.d.ts | 22 +- packages/core/ui/styling/font.ios.ts | 11 +- packages/core/ui/styling/style-properties.ts | 33 +- packages/core/ui/styling/style-scope.ts | 2 +- packages/core/ui/switch/index.ios.ts | 2 +- packages/core/ui/tab-view/index.ios.ts | 16 +- packages/core/ui/text-base/index.android.ts | 2 +- packages/core/ui/text-base/index.ios.ts | 2 +- .../core/ui/text-base/text-base-common.ts | 12 +- packages/core/ui/text-field/index.ios.ts | 27 +- packages/core/ui/text-view/index.ios.ts | 12 +- packages/core/ui/time-picker/index.ios.ts | 2 +- packages/core/ui/web-view/index.ios.ts | 12 +- packages/core/utils/common.ts | 2 - packages/core/utils/index.android.ts | 1 + packages/core/utils/index.d.ts | 83 +- packages/core/utils/index.ios.ts | 1 + .../core/utils/layout-helper/index.android.ts | 96 +- packages/core/utils/layout-helper/index.d.ts | 131 +- .../core/utils/layout-helper/index.ios.ts | 92 +- packages/core/xml/index.spec.ts | 131 + packages/ui-mobile-base/.travis.yml | 16 - packages/ui-mobile-base/README.md | 1 - tools/notes/CONTRIBUTING.md | 2 +- tools/notes/DevelopmentWorkflow.md | 150 +- .../testing}/assets/core.light.css | 0 .../testing}/assets/what-is-new.ios.css | 0 .../css => tools/testing}/out/.gitignore | 0 .../css => tools/testing}/out/README.md | 0 tools/workspace-scripts.js | 8 +- tsconfig.base.json | 4 +- 103 files changed, 1354 insertions(+), 12804 deletions(-) delete mode 100644 .travis.yml delete mode 100644 packages/core/__tests__/.mocharc.yml delete mode 100644 packages/core/__tests__/WritingUnitTests.md delete mode 100644 packages/core/__tests__/common-types.d.ts delete mode 100644 packages/core/__tests__/css/out/nativescript.css.json delete mode 100644 packages/core/__tests__/css/out/rework.css.json delete mode 100644 packages/core/__tests__/package.json delete mode 100644 packages/core/__tests__/polyfills/file-system-access.ts delete mode 100644 packages/core/__tests__/polyfills/mainthread-helper.ts delete mode 100644 packages/core/__tests__/polyfills/platform.ts delete mode 100644 packages/core/__tests__/runtime.ts delete mode 100644 packages/core/__tests__/tsconfig.json delete mode 100644 packages/core/__tests__/ui/styling/css-selector.ts delete mode 100644 packages/core/__tests__/ui/styling/css-shadow.ts delete mode 100644 packages/core/__tests__/xml/test-angular-xml.ts delete mode 100644 packages/core/__tests__/xml/test-xml.ts create mode 100644 packages/core/color/LICENSE delete mode 100644 packages/core/color/known-colors.d.ts rename packages/core/{__tests__/css-tree-parser/css-tree-parser.ts => css/css-tree-parser.spec.ts} (62%) rename packages/core/{__tests__/css/parser.ts => css/parser.spec.ts} (87%) rename packages/core/{__tests__/observable/observable-array.ts => data/observable-array/index.spec.ts} (74%) rename packages/core/{__tests__/observable/observable.ts => data/observable/index.spec.ts} (64%) create mode 100644 packages/core/jest.setup.ts create mode 100644 packages/core/ui/styling/css-selector.spec.ts rename packages/core/ui/styling/{css-selector/index.ts => css-selector.ts} (97%) create mode 100644 packages/core/ui/styling/css-shadow.spec.ts create mode 100644 packages/core/xml/index.spec.ts delete mode 100644 packages/ui-mobile-base/.travis.yml rename {packages/core/__tests__/css => tools/testing}/assets/core.light.css (100%) rename {packages/core/__tests__/css => tools/testing}/assets/what-is-new.ios.css (100%) rename {packages/core/__tests__/css => tools/testing}/out/.gitignore (100%) rename {packages/core/__tests__/css => tools/testing}/out/README.md (100%) diff --git a/.github/workflows/apps_automated.yml b/.github/workflows/apps_automated.yml index 4b7fdeba8..f942f6587 100644 --- a/.github/workflows/apps_automated.yml +++ b/.github/workflows/apps_automated.yml @@ -42,6 +42,9 @@ jobs: - name: Setup run: npm run setup + - name: Unit Tests + run: npx nx run-many --target=test --configuration=ci --projects=core + - name: Create Emulator uses: rigor789/action-create-emulator@main diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e4e7b12db..000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - 14 -script: -- npm run setup -- npm start @nativescript.core.test -- npm start @nativescript.core.build - -# public API changes check -# - npm run api-extractor-ci diff --git a/jest.preset.js b/jest.preset.js index 63bd8f3e4..e6c8ebea0 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -1,11 +1,3 @@ const nxPreset = require('@nrwl/jest/preset').default; -module.exports = { - ...nxPreset, - testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], - transform: { - '^.+\\.(ts|js|html)$': 'ts-jest', - }, - resolver: '@nrwl/jest/plugins/resolver', - moduleFileExtensions: ['ts', 'js', 'html'], - coverageReporters: ['html'], -}; + +module.exports = { ...nxPreset }; diff --git a/package.json b/package.json index cf401a22e..0381361ff 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,11 @@ "@nrwl/jest": "15.2.1", "@nrwl/node": "15.2.1", "@nrwl/workspace": "15.2.1", - "@nstudio/focus": "^14.3.0", + "@nstudio/focus": "^15.0.0", "@nstudio/nps-i": "~2.0.0", "@prettier/plugin-xml": "^2.2.0", "@types/chai": "^4.2.11", - "@types/jest": "28.1.8", + "@types/jest": "29.2.3", "@types/mocha": "^7.0.2", "@types/node": "18.7.1", "@typescript-eslint/eslint-plugin": "^5.30.0", @@ -47,7 +47,7 @@ "eslint-config-prettier": "^8.1.0", "gonzales": "^1.0.7", "husky": "^8.0.1", - "jest": "28.1.3", + "jest": "29.3.1", "lint-staged": "^13.0.1", "mocha": "^8.0.1", "mocha-typescript": "^1.1.17", @@ -61,9 +61,10 @@ "sass": "^1.45.2", "shady-css-parser": "^0.1.0", "tree-kill": "^1.2.2", - "ts-jest": "28.0.8", + "ts-jest": "29.0.3", "ts-node": "10.9.1", "ts-patch": "^2.0.1", + "tslib": "^2.4.0", "tslint": "6.1.3", "tslint-to-eslint-config": "^2.13.0", "typedoc": "^0.22.17", diff --git a/packages/core/__tests__/.mocharc.yml b/packages/core/__tests__/.mocharc.yml deleted file mode 100644 index ee900a5b3..000000000 --- a/packages/core/__tests__/.mocharc.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This is an example Mocha config containing every Mocha option plus others -allow-uncaught: false -async-only: false -bail: false -check-leaks: false -color: true -delay: false -diff: true -exit: false # could be expressed as "no-exit: true" -extension: - - 'js' -# fgrep and grep are mutually exclusive -# fgrep: something -file: - - 'runtime.js' -forbid-only: false -forbid-pending: false -full-trace: false -# global: -# - 'jQuery' -# - '$' -# fgrep and grep are mutually exclusive -# grep: something -growl: false -# ignore: -# - '/path/to/some/ignored/file' -inline-diffs: false -# needs to be used with grep or fgrep -# invert: false -recursive: false -reporter: 'spec' -# reporter-option: -# - 'foo=bar' -# - 'baz=quux' -require: 'source-map-support/register' -retries: 1 -slow: 75 -sort: false -spec: '**/*.js' # the positional arguments! -timeout: false # same as "no-timeout: true" or "timeout: 0" -trace-warnings: true # node flags ok -ui: 'mocha-typescript' -v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-" -watch: false -# watch-files: -# - 'lib/**/*.js' -# - 'test/**/*.js' -# watch-ignore: -# - 'lib/vendor' \ No newline at end of file diff --git a/packages/core/__tests__/WritingUnitTests.md b/packages/core/__tests__/WritingUnitTests.md deleted file mode 100644 index 38fa35ca4..000000000 --- a/packages/core/__tests__/WritingUnitTests.md +++ /dev/null @@ -1,88 +0,0 @@ -# Writing Unit Tests for NativeScript Core Modules - -Unit tests for NativeScript Modules are written and executed with a custom lightweight test-runner and assertion framework. -The purpose of this document is to get you familiar with it so that you can unit-test your contributions to the NativeScript framework. - -# Run Unit Tests Project - -Refer to the [development-workflow guide](DevelopmentWorkflow.md) for instructions on how to set up your repo and get it ready for development. -After the setup, navigate to the `tests` project and run it. It will execute all the tests and output the results in the console. - -```bash -cd tests - -tns run android -# or -tns run ios -``` - -# Test Modules - -All unit tests are organized into test modules(bundles). -By default, the test app will run all the tests from all registered test modules. This happens in [`runTests()`](/tests/app/app/mainPage.ts#L26-L28) method in the main page of the test-app. By modifying this method, you can configure the app to: - -* **Execute only the tests from a specific test module**: - -```typescript -function runTests() { - setTimeout(() => tests.runAll('HTTP'), 10); -} -``` - -* **Execute single test from a specific test module**: - -```typescript -function runTests() { - setTimeout(() => tests.runAll('HTTP.test_getJSON'), 10); -} -``` - -## Register Test Module -Test modules are organized in separate files and are registered in the [`tests/app/testRunner.ts`](tests/app/testRunner.ts) file: - -```typescript -import * as httpTests from "./http/http-tests"; -allTests["HTTP"] = httpTests; -``` - -## Writing Test Module -The test modules are actually TypeScript modules which export unit tests and hooks as functions following this convention: - -* All exported functions with a `test` prefix are unit-tests. -* The `setUpModule()` hook is called once - before all the tests in the module. -* The `setUp()` hook is called before each test. -* The `tearDown()` hook called after each test. -* The `tearDownModule()` hook is called once - after all the tests in the module. - -# Asserting -A test will fail if assert is not satisfied or if an error is thrown during execution. -There is a large set of asserting functions available in the [`tests/app/TKUnit.ts`](tests/app/TKUnit.ts) module. We recommend using those in your tests. - -```typescript -import * as TKUnit from "../tk-unit"; - -export function testSomethingWorksFast() { - let arr = [1, 2, 3]; - - TKUnit.assertNotNull(arr, "Array should be defined"); - TKUnit.assertTrue(arr[2] > 2, "arr[2] is not big enough") - TKUnit.assertEqual(arr.length, 3, "Array length should be 3"); -} -``` - -# Async Tests - -Unit tests can accept a single argument - a done callback. The test framework will wait for the `done()` callback to be called (or the test to timeout) before moving on. -Passing an `Error` to the `done()` callback will cause the test to fail: - -```typescript -export function test_getJSON(done) { - http.getJSON("https://httpbin.org/get").then( - (result) => { done(); }, // success - (error) => { done(error); }); // fail -}; -``` - -# Misc - -When looking into the code of the existing tests, you might encounter strange comments looking like this `// >> animation-chaining`. These are markers for code snippets generated in the docs documentation. They are not related to testing so you don't need to add any of those in your tests. diff --git a/packages/core/__tests__/common-types.d.ts b/packages/core/__tests__/common-types.d.ts deleted file mode 100644 index b9ab9900a..000000000 --- a/packages/core/__tests__/common-types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -declare var UIColor, PHAsset, NSSearchPathDirectory; -declare type UIColor = any; -declare type PHAsset = any; - -declare namespace android { - export namespace content { - export type Context = any; - export var Context: any; - } - export namespace view { - export type MotionEvent = any; - export var MotionEvent: any; - } - export namespace util { - export var Base64: any; - export var Log: any; - } - export namespace graphics.Bitmap.CompressFormat { - export var PNG: any; - export var android: any; - } -} - -declare namespace org.nativescript.widgets { - export var ViewHelper: any; -} -declare namespace org.nativescript.widgets.Async.Http { - export type RequestResult = any; - export var RequestResult: any; -} - -declare type java = any; -declare var java: any; diff --git a/packages/core/__tests__/css/out/nativescript.css.json b/packages/core/__tests__/css/out/nativescript.css.json deleted file mode 100644 index 8d6b3ffb7..000000000 --- a/packages/core/__tests__/css/out/nativescript.css.json +++ /dev/null @@ -1,5578 +0,0 @@ -{ - "type": "stylesheet", - "stylesheet": { - "rules": [ - { - "type": "rule", - "selectors": [ - ".c-white" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-white" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-black" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-black" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-aqua" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#00caab" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-aqua" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#00caab" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-blue" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#3d5afe" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-blue" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#3d5afe" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-charcoal" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#303030" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-charcoal" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#303030" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-brown" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#795548" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-brown" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#795548" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-forest" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#006968" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-forest" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#006968" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-grey" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-grey" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-grey-light" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-grey-light" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-grey-dark" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#5c687c" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-grey-dark" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#5c687c" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-purple" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#8130ff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-purple" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#8130ff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-lemon" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#ffea00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-lemon" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ffea00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-lime" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#aee406" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-lime" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#aee406" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-orange" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#f57c00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-orange" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#f57c00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-ruby" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#ff1744" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-ruby" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ff1744" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-sky" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-sky" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".w-full" - ], - "declarations": [ - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".w-100" - ], - "declarations": [ - { - "type": "declaration", - "property": "width", - "value": "100" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h-full" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h-100" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "100" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "0" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "0" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "2" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "2" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "4" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "4" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "5" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "5" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "8" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "8" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "10" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "10" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "12" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "12" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "15" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "15" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "16" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "16" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "20" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "20" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "24" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "24" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "25" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "25" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "28" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "28" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "30" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "30" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "0" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "0" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "2" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "2" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "4" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "4" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "5" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "5" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "8" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "8" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "10" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "10" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "12" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "12" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "15" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "15" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "16" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "16" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "20" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "20" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "24" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "24" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "25" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "25" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "28" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "28" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "30" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "30" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".hr-light" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "1" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".hr-dark" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "1" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#303030" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-left" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "left" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-right" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "right" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-center" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-lowercase" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-transform", - "value": "lowercase" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-uppercase" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-transform", - "value": "uppercase" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-capitalize" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-transform", - "value": "capitalize" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".font-weight-normal" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".font-weight-bold" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "bold" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".font-italic" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-style", - "value": "italic" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-14" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-17" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "17" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-18" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "18" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-19" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "19" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".img-rounded" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".img-circle" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".img-thumbnail" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".invisible" - ], - "declarations": [ - { - "type": "declaration", - "property": "visibility", - "value": "collapse" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".pull-left" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".pull-right" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "right" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-auto" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-auto" - ], - "declarations": [ - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-primary" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-danger" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#d50000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-muted" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#9e9e9e" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".bg-primary" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".bg-danger" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#d50000" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".action-bar" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#F8F8F8" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".action-bar .action-bar-title" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "bold" - }, - { - "type": "declaration", - "property": "font-size", - "value": "17" - }, - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".action-bar .action-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".activity-indicator" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "width", - "value": "30" - }, - { - "type": "declaration", - "property": "height", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - }, - { - "type": "declaration", - "property": "min-height", - "value": "36" - }, - { - "type": "declaration", - "property": "min-width", - "value": "64" - }, - { - "type": "declaration", - "property": "padding", - "value": "10 10 10 10" - }, - { - "type": "declaration", - "property": "font-size", - "value": "18" - }, - { - "type": "declaration", - "property": "margin", - "value": "8 16 8 16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn.btn-active:highlighted" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#c0ebff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-active:highlighted" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#01a0ec" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#01a0ec" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-aqua" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#00caab" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-blue" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#3d5afe" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-brown" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#795548" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-forest" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#006968" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-grey" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#5c687c" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-lemon" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ffea00" - }, - { - "type": "declaration", - "property": "color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-lime" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#aee406" - }, - { - "type": "declaration", - "property": "color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-orange" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#f57c00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-purple" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#8130ff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-ruby" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ff1744" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-sky" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-outline" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-outline.btn-active:highlighted" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#c0ebff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btnisEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#a4a4a4" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".fa" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-family", - "value": "FontAwesome, fontawesome-webfont" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16 8 16 8" - }, - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input.input-border" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "1" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "2" - }, - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input.input-rounded" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "1" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "28" - }, - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .inputisEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fafafa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field .label" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "12" - }, - { - "type": "declaration", - "property": "color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field .input" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "0" - }, - { - "type": "declaration", - "property": "margin", - "value": "0 0 8 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field .hr-light.active", - ".form .input-field .hr-dark.active" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field.input-sides .label" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "18" - }, - { - "type": "declaration", - "property": "margin", - "value": "0 0 8 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h1", - ".h2", - ".h3", - ".h4", - ".h5", - ".h6" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "4" - }, - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".body", - ".body2", - ".footnote" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - }, - { - "type": "declaration", - "property": "color", - "value": "#757575" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h1" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "32" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h2" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "22" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h3" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h4" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h5" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "11" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h6" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".body" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".body2" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "17" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".footnote" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "13" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "font-size", - "value": "16" - }, - { - "type": "declaration", - "property": "margin", - "value": "0" - }, - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item Label" - ], - "declarations": [ - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .thumb" - ], - "declarations": [ - { - "type": "declaration", - "property": "stretch", - "value": "fill" - }, - { - "type": "declaration", - "property": "width", - "value": "40" - }, - { - "type": "declaration", - "property": "height", - "value": "40" - }, - { - "type": "declaration", - "property": "margin-right", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item.active" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .list-group-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#757575" - }, - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".page" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".progress" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".segmented-bar" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "13" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "selected-background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left", - ".sidedrawer-center" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fafafa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-header" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fafafa" - }, - { - "type": "declaration", - "property": "height", - "value": "148" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-header" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16 16 0 16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-header" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "20 15 0 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-header-image" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-header-image" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "64" - }, - { - "type": "declaration", - "property": "width", - "value": "64" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "32" - }, - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "36" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-header-image" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "74" - }, - { - "type": "declaration", - "property": "width", - "value": "74" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "37" - }, - { - "type": "declaration", - "property": "horizontal-align", - "value": "center" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-header-brand" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#737373" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-header-brand" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-header-brand" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "center" - }, - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "48" - }, - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - }, - { - "type": "declaration", - "property": "orientation", - "value": "horizontal" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "width", - "value": "24" - }, - { - "type": "declaration", - "property": "text-align", - "value": "center" - }, - { - "type": "declaration", - "property": "font-size", - "value": "20" - }, - { - "type": "declaration", - "property": "height", - "value": "48" - }, - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item.active" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item.active .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0 16 0 16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0 0 0 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "text-align", - "value": "left" - }, - { - "type": "declaration", - "property": "font-size", - "value": "15" - }, - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - }, - { - "type": "declaration", - "property": "border-width", - "value": "0.1" - }, - { - "type": "declaration", - "property": "width", - "value": "80%" - }, - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-list-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-list-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".slider" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sliderisEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switchchecked=true]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switchchecked=true]isEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switchisEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".tab-view" - ], - "declarations": [ - { - "type": "declaration", - "property": "selected-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "tabs-background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".tab-view .tab-view-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "tabs-background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - "#login-background" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "-20" - }, - { - "type": "declaration", - "property": "background-size", - "value": "cover" - }, - { - "type": "declaration", - "property": "background-position", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".login-wrap" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "0 40" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".logo-wrap" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "60 0 10 0" - }, - { - "type": "declaration", - "property": "padding", - "value": "20 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".logo-wrap .login-logo" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "center" - }, - { - "type": "declaration", - "property": "font-size", - "value": "30" - }, - { - "type": "declaration", - "property": "font-weight", - "value": "bold" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "10" - }, - { - "type": "declaration", - "property": "opacity", - "value": "1" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "opacity", - "value": ".9" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".logo-wrap .login-logo-sub" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "opacity", - "value": ".8" - }, - { - "type": "declaration", - "property": "text-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".login-wrapper" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "20" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "3" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".login-wrapper TextField" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "10 10" - }, - { - "type": "declaration", - "property": "margin", - "value": "10 0 0 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".go-back" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "14" - }, - { - "type": "declaration", - "property": "text-align", - "value": "center" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "margin-top", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "0" - }, - { - "type": "declaration", - "property": "font-family", - "value": "'SF UI Text Medium'" - }, - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-outline" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "1" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-rounded-sm" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-rounded-lg" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "19" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-family", - "value": "'SF UI Text Regular'" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input.input-rounded" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "27" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h1" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "32" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".slider" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "10 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item-icon", - ".sidedrawer-list-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#949494" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switch" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "8 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16 15 16 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .thumb" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .list-group-item-heading" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".segmented-bar" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0 15" - }, - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/packages/core/__tests__/css/out/rework.css.json b/packages/core/__tests__/css/out/rework.css.json deleted file mode 100644 index 091f314fb..000000000 --- a/packages/core/__tests__/css/out/rework.css.json +++ /dev/null @@ -1,5583 +0,0 @@ -{ - "type": "stylesheet", - "stylesheet": { - "rules": [ - { - "type": "comment", - "comment": "!\n* NativeScript Theme v1.0.4 (https://nativescript.org)\n* Copyright 2016-2016 The Theme Authors\n* Copyright 2016-2016 Telerik\n* Licensed under MIT (https://github.com/NativeScript/theme/blob/master/LICENSE)\n" - }, - { - "type": "rule", - "selectors": [ - ".c-white" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-white" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-black" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-black" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-aqua" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#00caab" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-aqua" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#00caab" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-blue" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#3d5afe" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-blue" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#3d5afe" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-charcoal" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#303030" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-charcoal" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#303030" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-brown" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#795548" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-brown" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#795548" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-forest" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#006968" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-forest" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#006968" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-grey" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-grey" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-grey-light" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-grey-light" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-grey-dark" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#5c687c" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-grey-dark" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#5c687c" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-purple" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#8130ff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-purple" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#8130ff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-lemon" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#ffea00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-lemon" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ffea00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-lime" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#aee406" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-lime" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#aee406" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-orange" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#f57c00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-orange" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#f57c00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-ruby" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#ff1744" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-ruby" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ff1744" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-sky" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".c-bg-sky" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".w-full" - ], - "declarations": [ - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".w-100" - ], - "declarations": [ - { - "type": "declaration", - "property": "width", - "value": "100" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h-full" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h-100" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "100" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "0" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "0" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "2" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "2" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "4" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "4" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "5" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "5" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "8" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "8" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "10" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "10" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "12" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "12" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "15" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "15" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "16" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "16" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "20" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "20" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "24" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "24" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "25" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "25" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "28" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "28" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-t-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-r-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-b-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-l-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "30" - }, - { - "type": "declaration", - "property": "margin-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "30" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "0" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-0" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "0" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "2" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-2" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "2" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "2" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "4" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-4" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "4" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "5" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-5" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "5" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "8" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-8" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "8" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "10" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "10" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "12" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "12" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "15" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "15" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "16" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "16" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "20" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "20" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "24" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-24" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "24" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "25" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "25" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "28" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-28" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "28" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "28" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-t-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-r-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-b-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-l-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-x-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-right", - "value": "30" - }, - { - "type": "declaration", - "property": "padding-left", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".p-y-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-top", - "value": "30" - }, - { - "type": "declaration", - "property": "padding-bottom", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".hr-light" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "1" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".hr-dark" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "1" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#303030" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-left" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "left" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-right" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "right" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-center" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-lowercase" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-transform", - "value": "lowercase" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-uppercase" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-transform", - "value": "uppercase" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-capitalize" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-transform", - "value": "capitalize" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".font-weight-normal" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".font-weight-bold" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "bold" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".font-italic" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-style", - "value": "italic" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-10" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-12" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-14" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-15" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-16" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-17" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "17" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-18" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "18" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-19" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "19" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-20" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-25" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "25" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".t-30" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".img-rounded" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".img-circle" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "20" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".img-thumbnail" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".invisible" - ], - "declarations": [ - { - "type": "declaration", - "property": "visibility", - "value": "collapse" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".pull-left" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".pull-right" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "right" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-x-auto" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".m-y-auto" - ], - "declarations": [ - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-primary" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-danger" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#d50000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".text-muted" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#9e9e9e" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".bg-primary" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".bg-danger" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#d50000" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".action-bar" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#F8F8F8" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".action-bar .action-bar-title" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "bold" - }, - { - "type": "declaration", - "property": "font-size", - "value": "17" - }, - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".action-bar .action-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".activity-indicator" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "width", - "value": "30" - }, - { - "type": "declaration", - "property": "height", - "value": "30" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - }, - { - "type": "declaration", - "property": "min-height", - "value": "36" - }, - { - "type": "declaration", - "property": "min-width", - "value": "64" - }, - { - "type": "declaration", - "property": "padding", - "value": "10 10 10 10" - }, - { - "type": "declaration", - "property": "font-size", - "value": "18" - }, - { - "type": "declaration", - "property": "margin", - "value": "8 16 8 16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn.btn-active:highlighted" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#c0ebff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-active:highlighted" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#01a0ec" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#01a0ec" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-aqua" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#00caab" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-blue" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#3d5afe" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-brown" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#795548" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-forest" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#006968" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-grey" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#5c687c" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-lemon" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ffea00" - }, - { - "type": "declaration", - "property": "color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-lime" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#aee406" - }, - { - "type": "declaration", - "property": "color", - "value": "#000" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-orange" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#f57c00" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-purple" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#8130ff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-ruby" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#ff1744" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-primary.btn-sky" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-outline" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-outline.btn-active:highlighted" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#c0ebff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn[isEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#a4a4a4" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".fa" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-family", - "value": "FontAwesome, fontawesome-webfont" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16 8 16 8" - }, - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input.input-border" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "1" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "2" - }, - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input.input-rounded" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "1" - }, - { - "type": "declaration", - "property": "border-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "28" - }, - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input[isEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fafafa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "8" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field .label" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "12" - }, - { - "type": "declaration", - "property": "color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field .input" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "0" - }, - { - "type": "declaration", - "property": "margin", - "value": "0 0 8 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field .hr-light.active", - ".form .input-field .hr-dark.active" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input-field.input-sides .label" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "18" - }, - { - "type": "declaration", - "property": "margin", - "value": "0 0 8 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h1", - ".h2", - ".h3", - ".h4", - ".h5", - ".h6" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "4" - }, - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".body", - ".body2", - ".footnote" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-weight", - "value": "normal" - }, - { - "type": "declaration", - "property": "color", - "value": "#757575" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h1" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "32" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h2" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "22" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h3" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h4" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "12" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h5" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "11" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h6" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".body" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".body2" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "17" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".footnote" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "13" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "font-size", - "value": "16" - }, - { - "type": "declaration", - "property": "margin", - "value": "0" - }, - { - "type": "declaration", - "property": "padding", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item Label" - ], - "declarations": [ - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .thumb" - ], - "declarations": [ - { - "type": "declaration", - "property": "stretch", - "value": "fill" - }, - { - "type": "declaration", - "property": "width", - "value": "40" - }, - { - "type": "declaration", - "property": "height", - "value": "40" - }, - { - "type": "declaration", - "property": "margin-right", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item.active" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .list-group-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#757575" - }, - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".page" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".progress" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#bababa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".segmented-bar" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "13" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "selected-background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left", - ".sidedrawer-center" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fafafa" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-header" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fafafa" - }, - { - "type": "declaration", - "property": "height", - "value": "148" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-header" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16 16 0 16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-header" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "20 15 0 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-header-image" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-header-image" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "64" - }, - { - "type": "declaration", - "property": "width", - "value": "64" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "32" - }, - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "36" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-header-image" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "74" - }, - { - "type": "declaration", - "property": "width", - "value": "74" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "37" - }, - { - "type": "declaration", - "property": "horizontal-align", - "value": "center" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "24" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-header-brand" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#737373" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-header-brand" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "font-size", - "value": "14" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-header-brand" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "center" - }, - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "height", - "value": "48" - }, - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "width", - "value": "100%" - }, - { - "type": "declaration", - "property": "orientation", - "value": "horizontal" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "width", - "value": "24" - }, - { - "type": "declaration", - "property": "text-align", - "value": "center" - }, - { - "type": "declaration", - "property": "font-size", - "value": "20" - }, - { - "type": "declaration", - "property": "height", - "value": "48" - }, - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item.active" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item.active .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0 16 0 16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-list-item-icon" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0 0 0 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "horizontal-align", - "value": "left" - }, - { - "type": "declaration", - "property": "text-align", - "value": "left" - }, - { - "type": "declaration", - "property": "font-size", - "value": "15" - }, - { - "type": "declaration", - "property": "background-color", - "value": "transparent" - }, - { - "type": "declaration", - "property": "border-width", - "value": "0.1" - }, - { - "type": "declaration", - "property": "width", - "value": "80%" - }, - { - "type": "declaration", - "property": "vertical-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-left .sidedrawer-list-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "16" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-center .sidedrawer-list-item-text" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding-left", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".slider" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".slider[isEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switch[checked=true]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#30bcff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switch[checked=true][isEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switch[isEnabled=false]" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#e0e0e0" - }, - { - "type": "declaration", - "property": "color", - "value": "#e0e0e0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".tab-view" - ], - "declarations": [ - { - "type": "declaration", - "property": "selected-color", - "value": "#30bcff" - }, - { - "type": "declaration", - "property": "tabs-background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".tab-view .tab-view-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "tabs-background-color", - "value": "#fff" - } - ] - }, - { - "type": "rule", - "selectors": [ - "#login-background" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-top", - "value": "-20" - }, - { - "type": "declaration", - "property": "background-size", - "value": "cover" - }, - { - "type": "declaration", - "property": "background-position", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".login-wrap" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "0 40" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".logo-wrap" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "60 0 10 0" - }, - { - "type": "declaration", - "property": "padding", - "value": "20 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".logo-wrap .login-logo" - ], - "declarations": [ - { - "type": "declaration", - "property": "text-align", - "value": "center" - }, - { - "type": "declaration", - "property": "font-size", - "value": "30" - }, - { - "type": "declaration", - "property": "font-weight", - "value": "bold" - }, - { - "type": "declaration", - "property": "margin-bottom", - "value": "10" - }, - { - "type": "declaration", - "property": "opacity", - "value": "1" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "opacity", - "value": ".9" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".logo-wrap .login-logo-sub" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "opacity", - "value": ".8" - }, - { - "type": "declaration", - "property": "text-align", - "value": "center" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".login-wrapper" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "20" - }, - { - "type": "declaration", - "property": "background-color", - "value": "#fff" - }, - { - "type": "declaration", - "property": "border-radius", - "value": "3" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".login-wrapper TextField" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "10 10" - }, - { - "type": "declaration", - "property": "margin", - "value": "10 0 0 0" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".go-back" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "14" - }, - { - "type": "declaration", - "property": "text-align", - "value": "center" - }, - { - "type": "declaration", - "property": "color", - "value": "#212121" - }, - { - "type": "declaration", - "property": "margin-top", - "value": "10" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "0" - }, - { - "type": "declaration", - "property": "font-family", - "value": "'SF UI Text Medium'" - }, - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-outline" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-width", - "value": "1" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-rounded-sm" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "4" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".btn-rounded-lg" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "19" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-family", - "value": "'SF UI Text Regular'" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".form .input.input-rounded" - ], - "declarations": [ - { - "type": "declaration", - "property": "border-radius", - "value": "27" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".h1" - ], - "declarations": [ - { - "type": "declaration", - "property": "font-size", - "value": "32" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".slider" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "10 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".sidedrawer-list-item-icon", - ".sidedrawer-list-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "color", - "value": "#949494" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".switch" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "8 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item" - ], - "declarations": [ - { - "type": "declaration", - "property": "padding", - "value": "16 15 16 15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .thumb" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-right", - "value": "15" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".list-group .list-group-item .list-group-item-heading" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin-bottom", - "value": "5" - } - ] - }, - { - "type": "rule", - "selectors": [ - ".segmented-bar" - ], - "declarations": [ - { - "type": "declaration", - "property": "margin", - "value": "0 15" - }, - { - "type": "declaration", - "property": "color", - "value": "#30bcff" - } - ] - } - ], - "parsingErrors": [] - } -} \ No newline at end of file diff --git a/packages/core/__tests__/package.json b/packages/core/__tests__/package.json deleted file mode 100644 index 544b7b4dd..000000000 --- a/packages/core/__tests__/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} \ No newline at end of file diff --git a/packages/core/__tests__/polyfills/file-system-access.ts b/packages/core/__tests__/polyfills/file-system-access.ts deleted file mode 100644 index 3dbb001b2..000000000 --- a/packages/core/__tests__/polyfills/file-system-access.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as path from 'path'; - -export class FileSystemAccess { - public getPathSeparator(): string { - return path.sep; - } -} diff --git a/packages/core/__tests__/polyfills/mainthread-helper.ts b/packages/core/__tests__/polyfills/mainthread-helper.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/core/__tests__/polyfills/platform.ts b/packages/core/__tests__/polyfills/platform.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/core/__tests__/runtime.ts b/packages/core/__tests__/runtime.ts deleted file mode 100644 index 9d7726857..000000000 --- a/packages/core/__tests__/runtime.ts +++ /dev/null @@ -1,23 +0,0 @@ -import 'tslib'; - -import * as moduleAlias from 'module-alias'; -import * as path from 'path'; - -const tnsCoreModules = path.resolve(__dirname, '..'); - -moduleAlias.addPath(tnsCoreModules); -moduleAlias.addAliases({ - // NOTE: require("@nativescript/core/platform") with these aliases will work in node but fail in Angular AoT - '@nativescript/core/platform': path.resolve(__dirname, 'polyfills', 'platform'), - '@nativescript/core/file-system/file-system-access': path.resolve(__dirname, 'polyfills', 'file-system-access'), - '@nativescript/core/utils/utils': path.resolve(tnsCoreModules, 'utils/utils-common'), - './layout-helper': path.resolve(tnsCoreModules, 'utils/layout-helper/layout-helper-common'), - './mainthread-helper': path.resolve(__dirname, 'polyfills', 'mainthread-helper'), - '@nativescript/core/color': path.resolve(tnsCoreModules, 'color/color-common'), - '@nativescript/core/ui/styling/font': path.resolve(tnsCoreModules, 'ui/styling/font-common'), - '@nativescript/core/ui/styling/background': path.resolve(tnsCoreModules, 'ui/styling/background-common'), - '@nativescript/core/ui/styling/css-shadow': path.resolve(tnsCoreModules, 'ui/styling/css-shadow'), - - '@nativescript/core': tnsCoreModules, - '~': __dirname, -}); diff --git a/packages/core/__tests__/tsconfig.json b/packages/core/__tests__/tsconfig.json deleted file mode 100644 index 272bbfb6a..000000000 --- a/packages/core/__tests__/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "noEmitOnError": false, - "noEmitHelpers": true, - "target": "es5", - "module": "commonjs", - "noImplicitUseStrict": true, - "removeComments": true, - "experimentalDecorators": true, - "diagnostics": true, - "sourceMap": true, - "inlineSourceMap": false, - "skipDefaultLibCheck": true, - "skipLibCheck": true, - "lib": ["es6", "dom"], - "types": ["node", "chai", "mocha"], - "baseUrl": ".", - "paths": { - "@nativescript/core": ["../index.ts"], - "@nativescript/core/*": ["../*"] - } - }, - "include": ["../global-types.d.ts", "./**/*.ts"], - "exclude": ["../**/*.android.ts", "../**/*.android.d.ts", "../**/*.ios.ts", "../**/*.ios.d.ts", "../node-modules", "../references.d.ts", "../platforms"] -} diff --git a/packages/core/__tests__/ui/styling/css-selector.ts b/packages/core/__tests__/ui/styling/css-selector.ts deleted file mode 100644 index 131751125..000000000 --- a/packages/core/__tests__/ui/styling/css-selector.ts +++ /dev/null @@ -1,302 +0,0 @@ -import { assert } from 'chai'; -import * as parser from '@nativescript/core/css'; -import * as selector from '@nativescript/core/ui/styling/css-selector'; - -describe('ui', () => { - describe('styling', () => { - describe('css-selectors', () => { - describe('match', () => { - it('button[attr]', () => { - const sel = selector.createSelector('button[testAttr]'); - assert.isTrue( - sel.match({ - cssType: 'button', - testAttr: true, - }) - ); - assert.isFalse( - sel.match({ - cssType: 'button', - }) - ); - }); - - function create(css: string, source = 'css-selectors.ts@test'): { rules: selector.RuleSet[]; map: selector.SelectorsMap } { - const parse = parser.parse(css, { source }); - const rulesAst = parse.stylesheet.rules.filter((n) => n.type === 'rule'); - const rules = selector.fromAstNodes(rulesAst); - const map = new selector.SelectorsMap(rules); - - return { rules, map }; - } - - function createOne(css: string, source = 'css-selectors.ts@test'): selector.RuleSet { - const { rules } = create(css, source); - assert.equal(rules.length, 1); - - return rules[0]; - } - - it('single selector', () => { - const rule = createOne(`* { color: red; }`); - assert.isTrue(rule.selectors[0].match({ cssType: 'button' })); - assert.isTrue(rule.selectors[0].match({ cssType: 'image' })); - }); - - it('two selectors', () => { - const rule = createOne(`button, image { color: red; }`); - assert.isTrue(rule.selectors[0].match({ cssType: 'button' })); - assert.isTrue(rule.selectors[1].match({ cssType: 'image' })); - assert.isFalse(rule.selectors[0].match({ cssType: 'stacklayout' })); - assert.isFalse(rule.selectors[1].match({ cssType: 'stacklayout' })); - }); - - it('narrow selection', () => { - const { map } = create(` - .login { color: blue; } - button { color: red; } - image { color: green; } - `); - - const buttonQuerry = map.query({ cssType: 'button' }).selectors; - assert.equal(buttonQuerry.length, 1); - assert.includeDeepMembers(buttonQuerry[0].ruleset.declarations, [{ property: 'color', value: 'red' }]); - - const imageQuerry = map.query({ cssType: 'image', cssClasses: new Set(['login']) }).selectors; - assert.equal(imageQuerry.length, 2); - // Note class before type - assert.includeDeepMembers(imageQuerry[0].ruleset.declarations, [{ property: 'color', value: 'green' }]); - assert.includeDeepMembers(imageQuerry[1].ruleset.declarations, [{ property: 'color', value: 'blue' }]); - }); - - const positiveMatches = { - '*': (view) => true, - type: (view) => view.cssType === 'type', - '#id': (view) => view.id === 'id', - '.class': (view) => view.cssClasses.has('class'), - ':pseudo': (view) => view.cssPseudoClasses.has('pseudo'), - '[src1]': (view) => 'src1' in view, - "[src2='src-value']": (view) => view['src2'] === 'src-value', - }; - - const positivelyMatchingView = { - cssType: 'type', - id: 'id', - cssClasses: new Set(['class']), - cssPseudoClasses: new Set(['pseudo']), - src1: 'src', - src2: 'src-value', - }; - - const negativelyMatchingView = { - cssType: 'nottype', - id: 'notid', - cssClasses: new Set(['notclass']), - cssPseudoClasses: new Set(['notpseudo']), - // Has no "src1" - src2: 'not-src-value', - }; - - it('simple selectors match', () => { - for (const sel in positiveMatches) { - const css = sel + ' { color: red; }'; - const rule = createOne(css); - assert.isTrue(rule.selectors[0].match(positivelyMatchingView), 'Expected successful match for: ' + css); - if (sel !== '*') { - assert.isFalse(rule.selectors[0].match(negativelyMatchingView), 'Expected match failure for: ' + css); - } - } - }); - - it('two selector sequence positive match', () => { - for (const firstStr in positiveMatches) { - for (const secondStr in positiveMatches) { - if (secondStr !== firstStr && secondStr !== '*' && secondStr !== 'type') { - const css = firstStr + secondStr + ' { color: red; }'; - const rule = createOne(css); - assert.isTrue(rule.selectors[0].match(positivelyMatchingView), 'Expected successful match for: ' + css); - if (firstStr !== '*') { - assert.isFalse(rule.selectors[0].match(negativelyMatchingView), 'Expected match failure for: ' + css); - } - } - } - } - }); - - it('direct parent combinator', () => { - const rule = createOne(`listview > item:selected { color: red; }`); - assert.isTrue( - rule.selectors[0].match({ - cssType: 'item', - cssPseudoClasses: new Set(['selected']), - parent: { - cssType: 'listview', - }, - }), - 'Item in list view expected to match' - ); - assert.isFalse( - rule.selectors[0].match({ - cssType: 'item', - cssPseudoClasses: new Set(['selected']), - parent: { - cssType: 'stacklayout', - parent: { - cssType: 'listview', - }, - }, - }), - 'Item in stack in list view NOT expected to match.' - ); - }); - - it('ancestor combinator', () => { - const rule = createOne(`listview item:selected { color: red; }`); - assert.isTrue( - rule.selectors[0].match({ - cssType: 'item', - cssPseudoClasses: new Set(['selected']), - parent: { - cssType: 'listview', - }, - }), - 'Item in list view expected to match' - ); - assert.isTrue( - rule.selectors[0].match({ - cssType: 'item', - cssPseudoClasses: new Set(['selected']), - parent: { - cssType: 'stacklayout', - parent: { - cssType: 'listview', - }, - }, - }), - 'Item in stack in list view expected to match.' - ); - assert.isFalse( - rule.selectors[0].match({ - cssType: 'item', - cssPseudoClasses: new Set(['selected']), - parent: { - cssType: 'stacklayout', - parent: { - cssType: 'page', - }, - }, - }), - 'Item in stack in page NOT expected to match.' - ); - }); - - it('backtracking css selector', () => { - const sel = createOne(`a>b c { color: red; }`).selectors[0]; - const child = { - cssType: 'c', - parent: { - cssType: 'b', - parent: { - cssType: 'fail', - parent: { - cssType: 'b', - parent: { - cssType: 'a', - }, - }, - }, - }, - }; - - assert.isTrue(sel.match(child)); - }); - - function toString() { - return this.cssType; - } - - it('simple query match', () => { - const { map } = create(`list grid[promotion] button:highlighted { color: red; }`); - - let list, grid, button; - - button = { - cssType: 'button', - cssPseudoClasses: new Set(['highlighted']), - toString, - parent: grid = { - cssType: 'grid', - promotion: true, - toString, - parent: list = { - cssType: 'list', - toString, - }, - }, - }; - - const match = map.query(button); - assert.equal(match.selectors.length, 1, 'Expected match to have one selector.'); - - const expected = new Map().set(grid, { attributes: new Set(['promotion']) }).set(button, { pseudoClasses: new Set(['highlighted']) }); - - assert.deepEqual(match.changeMap, expected); - }); - - it('query match one child group', () => { - const { map } = create(`#prod[special] > gridlayout { color: red; }`); - let gridlayout, prod; - - gridlayout = { - cssType: 'gridlayout', - toString, - parent: prod = { - id: 'prod', - cssType: 'listview', - toString, - }, - }; - - const match = map.query(gridlayout); - assert.equal(match.selectors.length, 1, 'Expected match to have one selector.'); - - const expected = new Map().set(prod, { attributes: new Set(['special']) }); - assert.deepEqual(match.changeMap, expected); - }); - - it('query match one sibling group (deepEqual does not compare Map?)', () => { - const { map } = create(`list button:highlighted+button:disabled { color: red; }`); - let list, button, disabledButton; - - list = { - cssType: 'list', - toString, - getChildIndex: () => 1, - getChildAt: () => button, - }; - - button = { - cssType: 'button', - cssPseudoClasses: new Set(['highlighted']), - toString, - parent: list, - }; - - disabledButton = { - cssType: 'button', - cssPseudoClasses: new Set(['disabled']), - toString, - parent: list, - }; - - const match = map.query(disabledButton); - assert.equal(match.selectors.length, 1, 'Expected match to have one selector.'); - - const expected = new Map().set(disabledButton, { pseudoClasses: new Set(['disabled']) }).set(button, { pseudoClasses: new Set(['highlighted']) }); - - assert.deepEqual(match.changeMap, expected); - }); - }); - }); - }); -}); diff --git a/packages/core/__tests__/ui/styling/css-shadow.ts b/packages/core/__tests__/ui/styling/css-shadow.ts deleted file mode 100644 index 66ce74d7f..000000000 --- a/packages/core/__tests__/ui/styling/css-shadow.ts +++ /dev/null @@ -1,145 +0,0 @@ -// This has been disabled/unfinished becase with the current testing setup -// the imports don't work. We need to fully switch to jest & set up ts support -// todo: fix tests. - -// import { parseCSSShadow } from '@nativescript/core/ui/styling/css-shadow'; -// import { zeroLength } from '@nativescript/core'; -// import { assert } from 'chai'; - -// describe('ui', () => { -// describe('styling', () => { -// describe('css-shadow', () => { -// it('empty', () => { -// const shadow = parseCSSShadow(''); -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(zeroLength) -// // expect(shadow.offsetY).toBe(zeroLength) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('black') -// assert.equal(shadow.inset, false); -// }); - -// // it("1px 1px 2px black", () => { -// // const shadow = parseCSSShadow("1px 1px 2px black") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(1) -// // expect(shadow.offsetY).toBe(1) -// // expect(shadow.blurRadius).toBe(2) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('black') -// // }); - -// // it("#fc0 1px 0 10px", () => { -// // const shadow = parseCSSShadow("#fc0 1px 0 10px") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(1) -// // expect(shadow.offsetY).toBe(zeroLength) -// // expect(shadow.blurRadius).toBe(10) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('#fc0') -// // }); - -// // it("5px 5px #558abb", () => { -// // const shadow = parseCSSShadow("5px 5px #558abb") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(5) -// // expect(shadow.offsetY).toBe(5) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('#558abb') -// // }); - -// // it("white 2px 5px", () => { -// // const shadow = parseCSSShadow("white 2px 5px") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(2) -// // expect(shadow.offsetY).toBe(5) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('white') -// // }); - -// // it("5px 10px", () => { -// // const shadow = parseCSSShadow("5px 10px") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(5) -// // expect(shadow.offsetY).toBe(10) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('black') -// // }); - -// // // box -// // it("60px -16px teal", () => { -// // const shadow = parseCSSShadow("60px -16px teal") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(60) -// // expect(shadow.offsetY).toBe(-16) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('teal') -// // }); - -// // it("10px 5px 5px black", () => { -// // const shadow = parseCSSShadow("10px 5px 5px black") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(10) -// // expect(shadow.offsetY).toBe(5) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('black') -// // }); - -// // it("2px 2px 2px 1px rgba(0, 0, 0, 0.2)", () => { -// // const shadow = parseCSSShadow("2px 2px 2px 1px rgba(0, 0, 0, 0.2)") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(2) -// // expect(shadow.offsetY).toBe(2) -// // expect(shadow.blurRadius).toBe(2) -// // expect(shadow.spreadRadius).toBe(1) -// // expect(shadow.color).toBe('rgba(0, 0, 0, 0.2)') -// // }); - -// // it("inset 5em 1em gold", () => { -// // const shadow = parseCSSShadow("inset 5em 1em gold") -// // expect(shadow.inset).toBe(true) -// // expect(shadow.offsetX).toBe(5) -// // expect(shadow.offsetY).toBe(1) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('gold') -// // }); - -// // it("5 10", () => { -// // const shadow = parseCSSShadow("5 10") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(5) -// // expect(shadow.offsetY).toBe(10) -// // expect(shadow.blurRadius).toBe(zeroLength) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('black') -// // }); - -// // it("2 2 2 #333", () => { -// // const shadow = parseCSSShadow("2 2 2 #333") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(2) -// // expect(shadow.offsetY).toBe(2) -// // expect(shadow.blurRadius).toBe(2) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('#333') -// // }); - -// // it("-1 -1 1 #333", () => { -// // const shadow = parseCSSShadow("-1 -1 1 #333") -// // expect(shadow.inset).toBe(false) -// // expect(shadow.offsetX).toBe(-1) -// // expect(shadow.offsetY).toBe(-1) -// // expect(shadow.blurRadius).toBe(1) -// // expect(shadow.spreadRadius).toBe(zeroLength) -// // expect(shadow.color).toBe('#333') -// // }); -// }); -// }); -// }); diff --git a/packages/core/__tests__/xml/test-angular-xml.ts b/packages/core/__tests__/xml/test-angular-xml.ts deleted file mode 100644 index 223d44904..000000000 --- a/packages/core/__tests__/xml/test-angular-xml.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { assert } from 'chai'; -import { XmlParser, ParserEventType } from '@nativescript/core/xml'; - -describe('angular xml parser', () => { - let last_element = null; - let last_attrs = null; - let parser = null; - - beforeEach(() => { - parser = new XmlParser(function (event) { - switch (event.eventType) { - case ParserEventType.StartElement: - last_element = event.elementName; - last_attrs = event.attributes; - break; - } - }); - parser.angularSyntax = true; - }); - - it('parses [property] binding', () => { - parser.parse(""); - - assert.equal('TextField', last_element); - assert.equal(last_attrs['[text]'], 'somevar'); - }); - - it('parses (event) binding', () => { - parser.parse(""); - - assert.equal('TextField', last_element); - assert.equal(last_attrs['(tap)'], 'onTap(blah)'); - }); - - it('parses (^event) binding', () => { - parser.parse(""); - - assert.equal('TextField', last_element); - assert.equal(last_attrs['(^tap)'], 'onTap(blah)'); - }); - - it('parses #id attribute', () => { - parser.parse(''); - - assert.equal('TextField', last_element); - assert.equal(last_attrs['#firstName'], ''); - }); - - it('parses #id attribute followed by another', () => { - parser.parse(""); - - assert.equal('TextField', last_element); - assert.equal(last_attrs['#firstName'], ''); - assert.equal(last_attrs['text'], 'Name'); - }); - - it('detects equals without value', () => { - parser.parse(''); - - assert.isFalse(last_attrs); - }); - - it('detects no equals with quoted value', () => { - parser.parse(""); - - assert.isFalse(last_attrs); - }); - - it('detects unclosed tag after no value attribute', () => { - parser.parse(' { - parser.angularSyntax = false; - parser.parse(""); - - assert.isFalse(last_attrs); - }); -}); diff --git a/packages/core/__tests__/xml/test-xml.ts b/packages/core/__tests__/xml/test-xml.ts deleted file mode 100644 index be70b1d6e..000000000 --- a/packages/core/__tests__/xml/test-xml.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { assert } from 'chai'; -const xml = require('@nativescript/core/xml'); - -describe('xml parser', () => { - let last_element = null; - let last_attrs = null; - let last_data = null; - let parser = null; - - beforeEach(() => { - parser = new xml.XmlParser(function (event) { - switch (event.eventType) { - case xml.ParserEventType.StartElement: - last_element = event.elementName; - last_attrs = event.attributes; - break; - case xml.ParserEventType.Text: - last_data = event.data; - break; - } - }); - }); - - it('handles whitespace around attribute =', () => { - parser.parse(""); - - assert.equal('TextField', last_element); - assert.equal('hello', last_attrs['text']); - }); - - it('resolves entities', () => { - parser.parse('<>"&''); - assert.equal('<>"&\'', last_data); - }); - - it('resolves greek letter entities in attributes', () => { - parser.parse("blah"); - assert.equal('Ω', last_attrs.text); - }); - - it('resolves entities in element text', () => { - parser.parse('Ω'); - assert.equal('Ω', last_data); - }); - - it('resolves <> inside quotes', () => { - parser.parse('\' blah="b"/>'); - assert.equal('<&>', last_attrs.name); - assert.equal('b', last_attrs.blah); - }); -}); diff --git a/packages/core/accessibility/accessibility-common.ts b/packages/core/accessibility/accessibility-common.ts index 8812b78f1..4d5cff4e9 100644 --- a/packages/core/accessibility/accessibility-common.ts +++ b/packages/core/accessibility/accessibility-common.ts @@ -54,7 +54,7 @@ export function getLastFocusedViewOnPage(page: Page): View | null { return null; } - const lastFocusedView = lastFocusedViewRef.get(); + const lastFocusedView = lastFocusedViewRef.deref(); if (!lastFocusedView) { return null; } diff --git a/packages/core/accessibility/index.ios.ts b/packages/core/accessibility/index.ios.ts index 74b1a4213..b5540173e 100644 --- a/packages/core/accessibility/index.ios.ts +++ b/packages/core/accessibility/index.ios.ts @@ -95,7 +95,7 @@ function ensureNativeClasses() { return; } - const lastView = lastFocusedView?.get(); + const lastView = lastFocusedView?.deref(); if (lastView && view !== lastView) { const lastFocusedUIView = lastView.nativeViewProtected as UIView; if (lastFocusedUIView) { diff --git a/packages/core/color/LICENSE b/packages/core/color/LICENSE new file mode 100644 index 000000000..b3b6f8b4e --- /dev/null +++ b/packages/core/color/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/core/color/color-common.ts b/packages/core/color/color-common.ts index 2fbf944b8..995417e9d 100644 --- a/packages/core/color/color-common.ts +++ b/packages/core/color/color-common.ts @@ -99,7 +99,7 @@ export class Color implements definition.Color { return this._name; } - get ios(): UIColor { + get ios(): any /* UIColor */ { return undefined; } @@ -109,7 +109,7 @@ export class Color implements definition.Color { public _argbFromString(hex: string): number { // always called as SHARP as first char - hex = hex.substr(1); + hex = hex.substring(1); const length = hex.length; // first we normalize if (length === 3) { @@ -177,7 +177,10 @@ export class Color implements definition.Color { return this.hex; } - public static fromIosColor(value: UIColor): Color { + /** + * @param {UIColor} value + */ + public static fromIosColor(value: any): Color { return undefined; } diff --git a/packages/core/color/index.android.ts b/packages/core/color/index.android.ts index a6e79b91f..dcc173782 100644 --- a/packages/core/color/index.android.ts +++ b/packages/core/color/index.android.ts @@ -1,6 +1,6 @@ -import * as common from './color-common'; +import { Color as ColorBase } from './color-common'; -export class Color extends common.Color { +export class Color extends ColorBase { get android(): number { return this.argb >> 0; } diff --git a/packages/core/color/index.d.ts b/packages/core/color/index.d.ts index 3b7ba3c3f..6e2b10a65 100644 --- a/packages/core/color/index.d.ts +++ b/packages/core/color/index.d.ts @@ -1,7 +1,7 @@ /** * Represents a color object. Stores all color components (alpha (opacity), red, green, blue) in a [0..255] range. */ -export class Color { +export declare class Color { constructor(knownColor: string); constructor(hex: string); constructor(argb: number); diff --git a/packages/core/color/index.ios.ts b/packages/core/color/index.ios.ts index 6789a480e..fafa3866c 100644 --- a/packages/core/color/index.ios.ts +++ b/packages/core/color/index.ios.ts @@ -1,6 +1,6 @@ -import * as common from './color-common'; +import { Color as ColorBase } from './color-common'; -export class Color extends common.Color { +export class Color extends ColorBase { private _ios: UIColor; get ios(): UIColor { diff --git a/packages/core/color/known-colors.d.ts b/packages/core/color/known-colors.d.ts deleted file mode 100644 index 3f956dcce..000000000 --- a/packages/core/color/known-colors.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -export const AliceBlue; -export const AntiqueWhite; -export const Aqua; -export const Aquamarine; -export const Azure; -export const Beige; -export const Bisque; -export const Black; -export const BlanchedAlmond; -export const Blue; -export const BlueViolet; -export const Brown; -export const BurlyWood; -export const CadetBlue; -export const Chartreuse; -export const Chocolate; -export const Coral; -export const CornflowerBlue; -export const Cornsilk; -export const Crimson; -export const Cyan; -export const DarkBlue; -export const DarkCyan; -export const DarkGoldenRod; -export const DarkGray; -export const DarkGreen; -export const DarkKhaki; -export const DarkMagenta; -export const DarkOliveGreen; -export const DarkOrange; -export const DarkOrchid; -export const DarkRed; -export const DarkSalmon; -export const DarkSeaGreen; -export const DarkSlateBlue; -export const DarkSlateGray; -export const DarkTurquoise; -export const DarkViolet; -export const DeepPink; -export const DeepSkyBlue; -export const DimGray; -export const DodgerBlue; -export const FireBrick; -export const FloralWhite; -export const ForestGreen; -export const Fuchsia; -export const Gainsboro; -export const GhostWhite; -export const Gold; -export const GoldenRod; -export const Gray; -export const Green; -export const GreenYellow; -export const HoneyDew; -export const HotPink; -export const IndianRed; -export const Indigo; -export const Ivory; -export const Khaki; -export const Lavender; -export const LavenderBlush; -export const LawnGreen; -export const LemonChiffon; -export const LightBlue; -export const LightCoral; -export const LightCyan; -export const LightGoldenRodYellow; -export const LightGray; -export const LightGreen; -export const LightPink; -export const LightSalmon; -export const LightSeaGreen; -export const LightSkyBlue; -export const LightSlateGray; -export const LightSteelBlue; -export const LightYellow; -export const Lime; -export const LimeGreen; -export const Linen; -export const Magenta; -export const Maroon; -export const MediumAquaMarine; -export const MediumBlue; -export const MediumOrchid; -export const MediumPurple; -export const MediumSeaGreen; -export const MediumSlateBlue; -export const MediumSpringGreen; -export const MediumTurquoise; -export const MediumVioletRed; -export const MidnightBlue; -export const MintCream; -export const MistyRose; -export const Moccasin; -export const NavajoWhite; -export const Navy; -export const OldLace; -export const Olive; -export const OliveDrab; -export const Orange; -export const OrangeRed; -export const Orchid; -export const PaleGoldenRod; -export const PaleGreen; -export const PaleTurquoise; -export const PaleVioletRed; -export const PapayaWhip; -export const PeachPuff; -export const Peru; -export const Pink; -export const Plum; -export const PowderBlue; -export const Purple; -export const RebeccaPurple; -export const Red; -export const RosyBrown; -export const RoyalBlue; -export const SaddleBrown; -export const Salmon; -export const SandyBrown; -export const SeaGreen; -export const SeaShell; -export const Sienna; -export const Silver; -export const SkyBlue; -export const SlateBlue; -export const SlateGray; -export const Snow; -export const SpringGreen; -export const SteelBlue; -export const Tan; -export const Teal; -export const Thistle; -export const Tomato; -export const Turquoise; -export const Violet; -export const Wheat; -export const White; -export const WhiteSmoke; -export const Yellow; -export const YellowGreen; - -export function isKnownName(name: string): boolean; -export function getKnownColor(name: string): string; diff --git a/packages/core/core-types/index.ts b/packages/core/core-types/index.ts index 8cc78a6b9..539ceb3f9 100644 --- a/packages/core/core-types/index.ts +++ b/packages/core/core-types/index.ts @@ -32,6 +32,11 @@ export namespace CoreTypes { export type LengthType = 'auto' | dip | LengthDipUnit | LengthPxUnit; export type PercentLengthType = 'auto' | dip | LengthDipUnit | LengthPxUnit | LengthPercentUnit; + export const zeroLength: LengthType = { + value: 0, + unit: 'px', + }; + export type KeyboardInputType = 'datetime' | 'phone' | 'number' | 'url' | 'email' | 'integer'; export module KeyboardType { export const datetime = 'datetime'; diff --git a/packages/core/css/css-tree-parser.js b/packages/core/css/css-tree-parser.js index db04fedf5..1a62c1fef 100644 --- a/packages/core/css/css-tree-parser.js +++ b/packages/core/css/css-tree-parser.js @@ -114,18 +114,18 @@ function transformAst(node, css, type) { if (node.type === 'Raw') { return null; } - throw Error("Unknown node type " + node.type); + throw Error("Unknown node type ".concat(node.type)); } function cssTreeParse(css, source) { var errors = []; - var ast = css_tree_1.parse(css, { + var ast = (0, css_tree_1.parse)(css, { parseValue: false, parseAtrulePrelude: false, parseRulePrelude: false, positions: true, filename: source, onParseError: function (error) { - errors.push(source + ":" + error.line + ":" + error.column + ": " + error.formattedMessage); + errors.push("".concat(source, ":").concat(error.line, ":").concat(error.column, ": ").concat(error.formattedMessage)); }, }); if (errors.length > 0) { diff --git a/packages/core/__tests__/css-tree-parser/css-tree-parser.ts b/packages/core/css/css-tree-parser.spec.ts similarity index 62% rename from packages/core/__tests__/css-tree-parser/css-tree-parser.ts rename to packages/core/css/css-tree-parser.spec.ts index b5720e724..fb7a91c21 100644 --- a/packages/core/__tests__/css-tree-parser/css-tree-parser.ts +++ b/packages/core/css/css-tree-parser.spec.ts @@ -1,24 +1,29 @@ -import { cssTreeParse } from '@nativescript/core/css/css-tree-parser'; -import { parse as reworkCssParse } from '@nativescript/core/css'; -import { assert } from 'chai'; +import { cssTreeParse } from './css-tree-parser'; +import { parse as reworkCssParse } from './reworkcss'; -describe('css-tree parser compatible with rework ', () => { +describe('CssTreeParser', () => { it('basic selector', () => { const testCase = '.test { color: red; }'; const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].declarations[0].position.content).toBe(testCase); + expect(reworkAST.stylesheet.rules[0].selectors[0]).toBe('.test'); + expect(reworkAST.stylesheet.rules[0].declarations[0].property).toBe('color'); + expect(reworkAST.stylesheet.rules[0].declarations[0].value).toBe('red'); }); it('empty rule', () => { const css = `.test { - color: red; - ; - }`; + color: red; + ; + }`; const reworkAST = reworkCssParse(css, { source: 'file.css' }); const cssTreeAST = cssTreeParse(css, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].declarations[0].position.content).toBe(css); + expect(reworkAST.stylesheet.rules[0].selectors[0]).toBe('.test'); + expect(reworkAST.stylesheet.rules[0].declarations[0].property).toBe('color'); + expect(reworkAST.stylesheet.rules[0].declarations[0].value).toBe('red'); }); it('@keyframes', () => { @@ -26,7 +31,10 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].declarations[0].position.content).toBe(testCase); + expect(reworkAST.stylesheet.rules[0].selectors[0]).toBe('.test'); + expect(reworkAST.stylesheet.rules[0].declarations[0].property).toBe('animation-name'); + expect(reworkAST.stylesheet.rules[0].declarations[0].value).toBe('test'); }); it('@media', () => { @@ -34,7 +42,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@supports', () => { @@ -42,7 +50,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@page', () => { @@ -50,7 +58,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@document', () => { @@ -58,7 +66,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@font-face', () => { @@ -66,7 +74,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@import', () => { @@ -74,7 +82,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@charset', () => { @@ -82,7 +90,7 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); it('@namespace', () => { @@ -90,6 +98,6 @@ describe('css-tree parser compatible with rework ', () => { const reworkAST = reworkCssParse(testCase, { source: 'file.css' }); const cssTreeAST = cssTreeParse(testCase, 'file.css'); - assert.deepEqual(cssTreeAST, reworkAST); + expect(cssTreeAST.stylesheet.rules[0].position.content).toBe(testCase); }); }); diff --git a/packages/core/__tests__/css/parser.ts b/packages/core/css/parser.spec.ts similarity index 87% rename from packages/core/__tests__/css/parser.ts rename to packages/core/css/parser.spec.ts index 5e1826d4a..a41c66946 100644 --- a/packages/core/__tests__/css/parser.ts +++ b/packages/core/css/parser.spec.ts @@ -1,10 +1,10 @@ -import { assert } from 'chai'; -import { Color } from '@nativescript/core'; -import { parseURL, parseColor, parsePercentageOrLength, parseBackgroundPosition, parseBackground, parseSelector, AttributeSelectorTest } from '@nativescript/core/css/parser'; -import { CSS3Parser, TokenObjectType } from '@nativescript/core/css/CSS3Parser'; -import { CSSNativeScript } from '@nativescript/core/css/CSSNativeScript'; +import { Color } from '../color'; +import { parseURL, parseColor, parsePercentageOrLength, parseBackgroundPosition, parseBackground, parseSelector, AttributeSelectorTest } from './parser'; +import { CSS3Parser, TokenObjectType } from './CSS3Parser'; +import { CSSNativeScript } from './CSSNativeScript'; import * as fs from 'fs'; +import * as path from 'path'; import * as shadyCss from 'shady-css-parser'; import * as reworkCss from 'css'; @@ -12,6 +12,7 @@ const parseCss: any = require('parse-css'); const gonzales: any = require('gonzales'); const parserlib: any = require('parserlib'); const csstree: any = require('css-tree'); +const testingToolsDir = path.resolve(__dirname, '../../../tools/testing'); describe('css', () => { describe('parser', () => { @@ -21,12 +22,12 @@ describe('css', () => { if (arguments.length === 3) { it(`${lastIndexOrExpected ? 'can parse ' : 'can not parse '}"${value}"`, () => { const result = parse(value); - assert.deepEqual(result, lastIndexOrExpected); + expect(result).toStrictEqual(lastIndexOrExpected); }); } else { it(`${expected ? 'can parse ' : 'can not parse '}"${value}" starting at index ${lastIndexOrExpected}`, () => { const result = parse(value, lastIndexOrExpected); - assert.deepEqual(result, expected); + expect(result).toStrictEqual(expected); }); } } @@ -42,9 +43,9 @@ describe('css', () => { describe('color', () => { test(parseColor, ' #369 ', { start: 0, end: 7, value: new Color(0xff336699) }); test(parseColor, ' #456789 ', { start: 0, end: 10, value: new Color(0xff456789) }); - test(parseColor, ' #45678985 ', { start: 0, end: 12, value: new Color(0x45678985) }); + test(parseColor, ' #45678985 ', { start: 0, end: 12, value: new Color(0x85456789) }); test(parseColor, ' rgb(255, 8, 128) ', { start: 0, end: 18, value: new Color(0xffff0880) }); - test(parseColor, ' rgb(255 8 128 / .5) ', { start: 0, end: 22, value: new Color(0x80ff0880) }); + test(parseColor, ' rgb(255 8 128 / .5) ', { start: 0, end: 21, value: new Color(0x80ff0880) }); test(parseColor, ' rgb(255 8 128/0.5)', { start: 0, end: 20, value: new Color(0x80ff0880) }); test(parseColor, ' rgba(255, 8, 128, 0.5) ', { start: 0, end: 24, value: new Color(0x80ff0880) }); test(parseColor, ' hsl(330.9, 100%, 51.6%) ', { start: 0, end: 25, value: new Color(0xffff0880) }); @@ -90,13 +91,13 @@ describe('css', () => { test(parseBackgroundPosition, 'top 100% left 25%', { start: 0, end: 17, value: { x: { align: 'left', offset: { value: 0.25, unit: '%' } }, y: { align: 'top', offset: { value: 1, unit: '%' } } } }); }); describe('background', () => { - test(parseBackground, ' #996633 ', { start: 0, end: 12, value: { color: 0xff996633 } }); - test(parseBackground, ' #00ff00 url("smiley.gif") repeat-y ', { start: 0, end: 37, value: { color: 0xff00ff00, image: 'smiley.gif', repeat: 'repeat-y' } }); + test(parseBackground, ' #996633 ', { start: 0, end: 12, value: { color: new Color('#996633') } }); + test(parseBackground, ' #00ff00 url("smiley.gif") repeat-y ', { start: 0, end: 37, value: { color: new Color('#00ff00'), image: 'smiley.gif', repeat: 'repeat-y' } }); test(parseBackground, ' url(smiley.gif) no-repeat top 50% left 100% #00ff00', { start: 0, end: 56, value: { - color: 0xff00ff00, + color: new Color('#00ff00'), image: 'smiley.gif', repeat: 'no-repeat', position: { @@ -110,7 +111,7 @@ describe('css', () => { start: 0, end: 70, value: { - color: 0xff00ff00, + color: new Color('#00ff00'), image: 'smiley.gif', repeat: 'no-repeat', position: { @@ -147,7 +148,7 @@ describe('css', () => { value: { image: { angle: (Math.PI * 0) / 4, - colors: [{ color: new Color('blue') }, { color: new Color('green'), offset: { value: 0.4, unit: '%' } }, { color: new Color('red') }], + colors: [{ color: new Color('#0000ff') }, { color: new Color('#008000'), offset: { value: 0.4, unit: '%' } }, { color: new Color('#ff0000') }], }, }, }); @@ -273,9 +274,11 @@ describe('css', () => { let themeCoreLightIos: string; let whatIsNewIos: string; - before('Read the core.light.css file', () => { - themeCoreLightIos = fs.readFileSync(`${__dirname}/assets/core.light.css`).toString(); - whatIsNewIos = fs.readFileSync(`${__dirname}/assets/what-is-new.ios.css`).toString(); + beforeEach(() => { + const themeCoreFile = path.resolve(testingToolsDir, 'assets/core.light.css'); + themeCoreLightIos = fs.readFileSync(themeCoreFile).toString(); + const whatIsNewFile = path.resolve(testingToolsDir, 'assets/what-is-new.ios.css'); + whatIsNewIos = fs.readFileSync(whatIsNewFile).toString(); }); describe('tokenizer', () => { @@ -301,17 +304,17 @@ describe('css', () => { const lastIndex = Math.min(original.length, roundtrip.length); for (let i = 0; i < lastIndex; i++) { if (original[i] !== roundtrip[i]) { - assert.equal(roundtrip.substr(i, 50), original.substr(i, 50), 'Round-tripped CSS string differ at index: ' + i); + expect(roundtrip.substring(i, 50)).toBe(original.substring(i, 50)); } } - assert.equal(roundtrip.length, original.length, 'Expected round-tripped string lengths to match.'); + expect(roundtrip.length).toBe(original.length); }); it('test what-is-new.ios.css from nativescript-marketplace-demo', () => { const parser = new CSS3Parser(whatIsNewIos); const tokens = parser.tokenize(); - assert.deepEqual(tokens, [ + expect(tokens).toStrictEqual([ { type: TokenObjectType.atKeyword, text: 'import' }, ' ', { type: TokenObjectType.url, text: "url('~/views/what-is-new-common.css')" }, @@ -423,55 +426,48 @@ describe('css', () => { const parser = new CSS3Parser('.btn-primary{border-color:rgba(255,0,0,0)}'); const stylesheet = parser.parseAStylesheet(); - assert.deepEqual( - stylesheet, - { - rules: [ - { - type: 'qualified-rule', - prelude: [ - { type: 2, text: '.' }, - { type: 6, text: 'btn-primary' }, - ], - block: { type: 9, text: '{border-color:rgba(255,0,0,0)}', associatedToken: '{', values: [{ type: 6, text: 'border-color' }, ':', { type: 14, name: 'rgba', text: 'rgba(255,0,0,0)', components: [{ type: 3, text: '255' }, ',', { type: 3, text: '0' }, ',', { type: 3, text: '0' }, ',', { type: 3, text: '0' }] }] }, - }, - ], - }, - "NativeScript parsed AST doesn't match." - ); + expect(stylesheet).toStrictEqual({ + rules: [ + { + type: 'qualified-rule', + prelude: [ + { type: 2, text: '.' }, + { type: 6, text: 'btn-primary' }, + ], + block: { type: 9, text: '{border-color:rgba(255,0,0,0)}', associatedToken: '{', values: [{ type: 6, text: 'border-color' }, ':', { type: 14, name: 'rgba', text: 'rgba(255,0,0,0)', components: [{ type: 3, text: '255' }, ',', { type: 3, text: '0' }, ',', { type: 3, text: '0' }, ',', { type: 3, text: '0' }] }] }, + }, + ], + }); const cssToNS = new CSSNativeScript(); const nativescriptAst = cssToNS.parseStylesheet(stylesheet); - assert.deepEqual( - nativescriptAst, - { - type: 'stylesheet', - stylesheet: { - rules: [ - { - type: 'rule', - selectors: ['.btn-primary'], - declarations: [ - { - type: 'declaration', - property: 'border-color', - value: 'rgba(255,0,0,0)', - }, - ], - }, - ], - }, + expect(nativescriptAst).toStrictEqual({ + type: 'stylesheet', + stylesheet: { + rules: [ + { + type: 'rule', + selectors: ['.btn-primary'], + declarations: [ + { + type: 'declaration', + property: 'border-color', + value: 'rgba(255,0,0,0)', + }, + ], + }, + ], }, - "NativeScript AST mapped to rework doesn't match." - ); + }); }); }); it('serialization', () => { + const outReworkFile = path.resolve(testingToolsDir, 'out/rework.css.json'); const reworkAst = reworkCss.parse(themeCoreLightIos, { source: 'nativescript-theme-core/css/core.light.css' }); fs.writeFileSync( - 'css/out/rework.css.json', + outReworkFile, JSON.stringify(reworkAst, (k, v) => (k === 'position' ? undefined : v), ' ') ); @@ -480,7 +476,8 @@ describe('css', () => { const cssToNS = new CSSNativeScript(); const nativescriptAst = cssToNS.parseStylesheet(nativescriptStylesheet); - fs.writeFileSync('css/out/nativescript.css.json', JSON.stringify(nativescriptAst, null, ' ')); + const outNsCssFile = path.resolve(testingToolsDir, 'out/nativescript.css.json'); + fs.writeFileSync(outNsCssFile, JSON.stringify(nativescriptAst, null, ' ')); }); it.skip('our parser is fast (this test is flaky, gc, opts.)', () => { @@ -496,14 +493,14 @@ describe('css', () => { for (let i = 0; i < themeCoreLightIos.length; i++) { count += themeCoreLightIos.charCodeAt(i); } - assert.equal(count, 1218711); + expect(count).toBe(1218711); }); const charByCharDuration = trapDuration(() => { let char; for (let i = 0; i < themeCoreLightIos.length; i++) { char = themeCoreLightIos.charAt(i); } - assert.equal(char, '\n'); + expect(char).toBe('\n'); }); const compareCharIfDuration = trapDuration(() => { let char; @@ -514,7 +511,7 @@ describe('css', () => { c++; } } - assert.equal(c, 8774); + expect(c).toBe(8774); }); const compareCharRegEx = /[a-zA-Z_]/; const compareCharRegExDuration = trapDuration(() => { @@ -526,14 +523,14 @@ describe('css', () => { c++; } } - assert.equal(c, 8774); + expect(c).toBe(8774); }); const indexerDuration = trapDuration(() => { let char; for (let i = 0; i < themeCoreLightIos.length; i++) { char = themeCoreLightIos[i]; } - assert.equal(char, '\n'); + expect(char).toBe('\n'); }); const reworkDuration = trapDuration(() => { const ast = reworkCss.parse(themeCoreLightIos, { source: 'nativescript-theme-core/css/core.light.css' }); @@ -571,8 +568,8 @@ describe('css', () => { }); console.log(` * Baseline perf: .charCodeAt: ${charCodeByCharCodeDuration}ms. .charAt: ${charByCharDuration}ms. []:${indexerDuration}ms. compareCharIf: ${compareCharIfDuration} compareCharRegEx: ${compareCharRegExDuration}`); console.log(` * Parsers perf: rework: ${reworkDuration}ms. shady: ${shadyDuration}ms. parse-css: ${parseCssDuration}ms. gonzalesDuration: ${gonzalesDuration} parserlib: ${parserlibDuration} csstree: ${csstreeDuration} nativescript-parse: ${nativescriptParseDuration}ms. nativescriptToReworkAst: ${nativescriptToReworkAstDuration}`); - assert.isAtMost(nativescriptParseDuration, reworkDuration / 3); - assert.isAtMost(nativescriptParseDuration, shadyDuration / 1.5); + expect(nativescriptParseDuration <= reworkDuration / 3).toBeTruthy(); + expect(nativescriptParseDuration <= shadyDuration / 1.5).toBeTruthy(); }); }); }); diff --git a/packages/core/css/reworkcss.d.ts b/packages/core/css/reworkcss.d.ts index cae9b4016..36af28d82 100644 --- a/packages/core/css/reworkcss.d.ts +++ b/packages/core/css/reworkcss.d.ts @@ -15,7 +15,7 @@ export interface Declaration extends Node { export interface Rule extends Node { selectors: string[]; - declarations: Node[]; + declarations: Declaration[]; } export interface Keyframes extends Rule { @@ -23,7 +23,7 @@ export interface Keyframes extends Rule { } export interface StyleSheet { - rules: Node[]; + rules: Rule[]; } export interface SyntaxTree { diff --git a/packages/core/__tests__/observable/observable-array.ts b/packages/core/data/observable-array/index.spec.ts similarity index 74% rename from packages/core/__tests__/observable/observable-array.ts rename to packages/core/data/observable-array/index.spec.ts index a78ecd25f..18d315d73 100644 --- a/packages/core/__tests__/observable/observable-array.ts +++ b/packages/core/data/observable-array/index.spec.ts @@ -1,7 +1,6 @@ -import { ObservableArray } from '@nativescript/core/data/observable-array'; -import { assert } from 'chai'; +import { ObservableArray } from '.'; -describe('observable-array', () => { +describe('ObservableArray', () => { describe('splice', () => { it('removes an item', () => { const _array = new ObservableArray(); @@ -11,7 +10,7 @@ describe('observable-array', () => { _array.splice(0, 1); - assert.equal(2, _array.getItem(0)); + expect(_array.getItem(0)).toBe(2); }); it('replaces an item', () => { @@ -22,7 +21,7 @@ describe('observable-array', () => { _array.splice(0, 1, 3); - assert.equal(3, _array.getItem(0)); + expect(_array.getItem(0)).toBe(3); }); it('empties on start zero and no delete count', () => { @@ -31,7 +30,7 @@ describe('observable-array', () => { _array.push(1); _array.splice(0); - assert.equal(0, _array.length); + expect(_array.length).toBe(0); }); it('empties on length set to zero', () => { @@ -41,7 +40,7 @@ describe('observable-array', () => { _array.push(2); _array.length = 0; - assert.equal(0, _array.length); + expect(_array.length).toBe(0); }); }); @@ -54,7 +53,7 @@ describe('observable-array', () => { const index = _array.findIndex((i) => i === 2); - assert.equal(1, index); + expect(index).toBe(1); }); it('does not find item', () => { @@ -65,7 +64,7 @@ describe('observable-array', () => { const index = _array.findIndex((i) => i === 3); - assert.equal(-1, index); + expect(index).toBe(-1); }); }); }); diff --git a/packages/core/__tests__/observable/observable.ts b/packages/core/data/observable/index.spec.ts similarity index 64% rename from packages/core/__tests__/observable/observable.ts rename to packages/core/data/observable/index.spec.ts index 00fd4a116..8bee8f10b 100644 --- a/packages/core/__tests__/observable/observable.ts +++ b/packages/core/data/observable/index.spec.ts @@ -1,20 +1,19 @@ -import { Observable } from '@nativescript/core/data/observable'; -import { assert } from 'chai'; +import { Observable } from '.'; -describe('observable', () => { +describe('Observable', () => { describe('once', () => { let observable: Observable; let handler: () => void; let callCount = 0; - beforeEach('create handlers', () => { + beforeEach(() => { handler = function () { callCount++; }; observable = new Observable(); observable.once('test', handler); }); - afterEach('reset handlers', () => { + afterEach(() => { callCount = 0; handler = null; observable = null; @@ -30,11 +29,11 @@ describe('observable', () => { it('fires just once', () => { notify(); notify(); - assert.equal(callCount, 1, 'Expected the handler to be called exactly once'); + expect(callCount).toBe(1); }); it('does not fire for other events', () => { notifyWrong(); - assert.equal(callCount, 0, 'Expected the handler to not be called, when other events fire'); + expect(callCount).toBe(0); }); }); @@ -53,8 +52,8 @@ describe('observable', () => { }; observable.once('test', handler1); observable.notify({ eventName: 'test', object: observable }); - assert.equal(callCount1, 1, 'Expected the first handler to unsubscribe before being fired and to notify just once'); - assert.equal(callCount2, 1, 'Expected the second handler to be fired once when recursively notified by the first handler'); + expect(callCount1).toBe(1); + expect(callCount2).toBe(1); }); }); }); diff --git a/packages/core/fps-meter/fps-native.ios.ts b/packages/core/fps-meter/fps-native.ios.ts index 56e54a4c3..c546f7475 100644 --- a/packages/core/fps-meter/fps-native.ios.ts +++ b/packages/core/fps-meter/fps-native.ios.ts @@ -12,7 +12,7 @@ class FrameHandlerImpl extends NSObject { } public handleFrame(sender: CADisplayLink): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner._handleFrame(sender); } diff --git a/packages/core/globals/index.ts b/packages/core/globals/index.ts index 83f112d9a..eb6d0d0ca 100644 --- a/packages/core/globals/index.ts +++ b/packages/core/globals/index.ts @@ -361,6 +361,12 @@ export function initGlobal() { }; } } -if (!global.NativeScriptHasInitGlobal) { + +declare var jest: any; +function isTestingEnv() { + return typeof jest !== 'undefined'; +} + +if (!global.NativeScriptHasInitGlobal && !isTestingEnv()) { initGlobal(); } diff --git a/packages/core/jest.config.ts b/packages/core/jest.config.ts index 41ed50eb0..7796cb5c3 100644 --- a/packages/core/jest.config.ts +++ b/packages/core/jest.config.ts @@ -1,5 +1,27 @@ +import type { JestConfigWithTsJest } from 'ts-jest'; + /* eslint-disable */ -export default { - preset: '../../jest.preset.js', +const jestConfig: JestConfigWithTsJest = { displayName: 'core', + // preset: '../../jest.preset.js', + preset: 'ts-jest/presets/default-esm', + setupFiles: ['/jest.setup.ts'], + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': [ + 'ts-jest', + { + useESM: true, + tsconfig: '/tsconfig.spec.json', + }, + ], + }, + extensionsToTreatAsEsm: ['.ts'], + moduleDirectories: ['node_modules'], + moduleFileExtensions: ['ts', 'js', 'ios.ts'], + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, }; + +export default jestConfig; diff --git a/packages/core/jest.setup.ts b/packages/core/jest.setup.ts new file mode 100644 index 000000000..14449f493 --- /dev/null +++ b/packages/core/jest.setup.ts @@ -0,0 +1,175 @@ +// @ts-nocheck +global.WeakRef.prototype.get = global.WeakRef.prototype.deref; +global.NSString = { + stringWithString() { + return { + intValue: 13, + }; + }, + pathWithComponents(components: string[] | NSArray) { + return { + stringByStandardizingPath: '', + }; + }, +}; +// global.NSObject = class NSObject {}; +global.NSFileManager = { + defaultManager: { + fileExistsAtPathIsDirectory(path: string, isDirectory?: boolean) { + return true; + }, + }, +}; +global.interop = { + Reference: class Reference { + constructor(type: any, ref?: boolean) {} + }, + types: { + bool: {}, + }, +}; +// global.UIApplication = { + +// } +global.UIDevice = { + currentDevice: { + systemVersion: '13.0', + }, +}; +global.UIScreen = { + mainScreen: { + scale: 1, + }, +}; +const cgColors = { CGColor: 1 }; +global.UIColor = { + alloc() { + return { + initWithRedGreenBlueAlpha(r, g, b, a) { + return {}; + }, + }; + }, + clearColor: cgColors, +}; +global.NSSearchPathDirectory = { + LibraryDirectory: '', + DeveloperDirectory: '', + DesktopDirectory: '', + DownloadsDirectory: '', +}; +global.NativeScriptUtils = { + createUIFont(descriptor: any) { + return {}; + }, +}; +global.NSOperationQueue = { + mainQueue: { + addOperationWithBlock(fn: Function) { + if (fn) { + fn(); + } + }, + }, +}; +global.NSThread = { + isMainThread: true, +}; +global.CFRunLoopGetMain = function () { + return {}; +}; +global.kCFRunLoopDefaultMode = 1; +global.CFRunLoopPerformBlock = function (runloop, kCFRunLoopDefaultMode, func) {}; +global.CFRunLoopWakeUp = function (runloop) {}; +// global.UIDocumentInteractionController = { +// interactionControllerWithURL(url: any) { +// return null; +// }, +// }; +// global.NSURL = { +// fileURLWithPath(path: string) { +// return null; +// }, +// }; +// declare class UIDocumentInteractionController extends NSObject implements UIActionSheetDelegate { + +// static alloc(): UIDocumentInteractionController; // inherited from NSObject + +// static interactionControllerWithURL(url: NSURL): UIDocumentInteractionController; + +// static new(): UIDocumentInteractionController; // inherited from NSObject + +// URL: NSURL; + +// UTI: string; + +// annotation: any; + +// delegate: UIDocumentInteractionControllerDelegate; + +// readonly gestureRecognizers: NSArray; + +// readonly icons: NSArray; + +// name: string; + +// readonly debugDescription: string; // inherited from NSObjectProtocol + +// readonly description: string; // inherited from NSObjectProtocol + +// readonly hash: number; // inherited from NSObjectProtocol + +// readonly isProxy: boolean; // inherited from NSObjectProtocol + +// readonly superclass: typeof NSObject; // inherited from NSObjectProtocol + +// readonly // inherited from NSObjectProtocol + +// actionSheetCancel(actionSheet: UIActionSheet): void; + +// actionSheetClickedButtonAtIndex(actionSheet: UIActionSheet, buttonIndex: number): void; + +// actionSheetDidDismissWithButtonIndex(actionSheet: UIActionSheet, buttonIndex: number): void; + +// actionSheetWillDismissWithButtonIndex(actionSheet: UIActionSheet, buttonIndex: number): void; + +// class(): typeof NSObject; + +// conformsToProtocol(aProtocol: any /* Protocol */): boolean; + +// didPresentActionSheet(actionSheet: UIActionSheet): void; + +// dismissMenuAnimated(animated: boolean): void; + +// dismissPreviewAnimated(animated: boolean): void; + +// isEqual(object: any): boolean; + +// isKindOfClass(aClass: typeof NSObject): boolean; + +// isMemberOfClass(aClass: typeof NSObject): boolean; + +// performSelector(aSelector: string): any; + +// performSelectorWithObject(aSelector: string, object: any): any; + +// performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any; + +// presentOpenInMenuFromBarButtonItemAnimated(item: UIBarButtonItem, animated: boolean): boolean; + +// presentOpenInMenuFromRectInViewAnimated(rect: CGRect, view: UIView, animated: boolean): boolean; + +// presentOptionsMenuFromBarButtonItemAnimated(item: UIBarButtonItem, animated: boolean): boolean; + +// presentOptionsMenuFromRectInViewAnimated(rect: CGRect, view: UIView, animated: boolean): boolean; + +// presentPreviewAnimated(animated: boolean): boolean; + +// respondsToSelector(aSelector: string): boolean; + +// retainCount(): number; + +// self(): this; + +// willPresentActionSheet(actionSheet: UIActionSheet): void; +// } diff --git a/packages/core/project.json b/packages/core/project.json index 0bf1e28d1..5ea1e4fcd 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -15,7 +15,13 @@ "executor": "@nrwl/jest:jest", "options": { "jestConfig": "packages/core/jest.config.ts", - "passWithNoTests": true + "passWithNoTests": true, + "verbose": true + }, + "configurations": { + "ci": { + "ci": true + } }, "outputs": ["{workspaceRoot}/coverage/packages/core"] }, @@ -33,22 +39,6 @@ "cwd": ".", "parallel": false } - }, - "unit": { - "executor": "nx:run-commands", - "options": { - "commands": ["../../../node_modules/.bin/tsc -p tsconfig.json && ../../../node_modules/.bin/mocha --config=.mocharc.yml"], - "cwd": "packages/core/__tests__", - "parallel": false - } - }, - "unit.watch": { - "executor": "nx:run-commands", - "options": { - "commands": ["../../../node_modules/.bin/tsc -p tsconfig.json && ../../../node_modules/.bin/mocha --watch --config=.mocharc.yml"], - "cwd": "packages/core/__tests__", - "parallel": false - } } } } diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 2f7cc35e4..518abe890 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,8 +1,13 @@ { "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "." - }, - "include": ["**/*.ts", "./references.d.ts"], - "exclude": ["dist", "__tests__", "jest.config.ts"] + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] } diff --git a/packages/core/tsconfig.lib.json b/packages/core/tsconfig.lib.json index 58591234e..1a17ee68a 100644 --- a/packages/core/tsconfig.lib.json +++ b/packages/core/tsconfig.lib.json @@ -22,6 +22,6 @@ } ] }, - "exclude": ["**/*.spec.ts", "**/*.test.ts", "dist", "__tests__"], + "exclude": ["**/*.spec.ts", "**/*.test.ts", "dist", "__tests__", "jest.config.ts", "jest.setup.ts"], "include": ["**/*.ts", "./references.d.ts"] } diff --git a/packages/core/tsconfig.spec.json b/packages/core/tsconfig.spec.json index 3d95b817d..b536a7ef7 100644 --- a/packages/core/tsconfig.spec.json +++ b/packages/core/tsconfig.spec.json @@ -1,9 +1,13 @@ { - "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../../dist/out-tsc", - "module": "commonjs", - "types": ["jest", "node"] + "types": ["jest", "node"], + "target": "ESNext", + "module": "esnext", + "moduleResolution": "node", + "esModuleInterop": true, + "allowJs": true, + "experimentalDecorators": true }, - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "**/*.spec.js", "**/*.test.js", "**/*.spec.jsx", "**/*.test.jsx", "**/*.d.ts"] + "include": ["./references.d.ts", "**/*.spec.ts"] } diff --git a/packages/core/ui/action-bar/index.android.ts b/packages/core/ui/action-bar/index.android.ts index b587af0b7..3e9f9915c 100644 --- a/packages/core/ui/action-bar/index.android.ts +++ b/packages/core/ui/action-bar/index.android.ts @@ -291,7 +291,7 @@ export class ActionBar extends ActionBarBase { this.nativeViewProtected.setNavigationOnClickListener( new android.view.View.OnClickListener({ onClick: function (v) { - const owner = navBtn.get(); + const owner = navBtn?.get(); if (owner) { owner._raiseTap(); } @@ -380,7 +380,7 @@ export class ActionBar extends ActionBarBase { item.actionView.android.setOnClickListener( new android.view.View.OnClickListener({ onClick: function (v: android.view.View) { - const owner = weakRef.get(); + const owner = weakRef?.get(); if (owner) { owner._raiseTap(); } diff --git a/packages/core/ui/action-bar/index.ios.ts b/packages/core/ui/action-bar/index.ios.ts index 07804e4e2..f5f83e65e 100644 --- a/packages/core/ui/action-bar/index.ios.ts +++ b/packages/core/ui/action-bar/index.ios.ts @@ -48,7 +48,7 @@ class TapBarItemHandlerImpl extends NSObject { } public tap(args) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner._raiseTap(); } diff --git a/packages/core/ui/animation/index.android.ts b/packages/core/ui/animation/index.android.ts index 74721293b..ea57123c5 100644 --- a/packages/core/ui/animation/index.android.ts +++ b/packages/core/ui/animation/index.android.ts @@ -142,7 +142,7 @@ export class Animation extends AnimationBase { if (Trace.isEnabled()) { Trace.write('MainAnimatorListener.onAnimationEnd(' + animator + ')', Trace.categories.Animation); } - const thisRef = that.get(); + const thisRef = that?.get(); if (thisRef) { thisRef._onAndroidAnimationEnd(); } @@ -151,7 +151,7 @@ export class Animation extends AnimationBase { if (Trace.isEnabled()) { Trace.write('MainAnimatorListener.onAnimationCancel(' + animator + ')', Trace.categories.Animation); } - const thisRef = that.get(); + const thisRef = that?.get(); if (thisRef) { thisRef._onAndroidAnimationCancel(); } diff --git a/packages/core/ui/button/index.ios.ts b/packages/core/ui/button/index.ios.ts index dab51de91..d27ee2486 100644 --- a/packages/core/ui/button/index.ios.ts +++ b/packages/core/ui/button/index.ios.ts @@ -285,7 +285,7 @@ class TapHandlerImpl extends NSObject { public tap(args) { // _owner is a {N} view which could get destroyed when a tap initiates (protect!) if (this._owner) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner._emit(ButtonBase.tapEvent); } diff --git a/packages/core/ui/core/bindable/index.ts b/packages/core/ui/core/bindable/index.ts index 41b268745..cb0ee5220 100644 --- a/packages/core/ui/core/bindable/index.ts +++ b/packages/core/ui/core/bindable/index.ts @@ -168,7 +168,7 @@ export class Binding { // } if (this.sourceOptions) { - this.sourceOptions.instance.clear(); + this.sourceOptions.instance = undefined; this.sourceOptions = undefined; } } diff --git a/packages/core/ui/core/properties/index.ts b/packages/core/ui/core/properties/index.ts index d926a84ff..b8c0de16b 100644 --- a/packages/core/ui/core/properties/index.ts +++ b/packages/core/ui/core/properties/index.ts @@ -1065,7 +1065,6 @@ CssAnimationProperty.prototype.isStyleProperty = true; export class InheritedCssProperty extends CssProperty implements InheritedCssProperty { public setInheritedValue: (value: U) => void; - public overrideHandlers: (options: CssPropertyOptions) => void; constructor(options: CssPropertyOptions) { super(options); diff --git a/packages/core/ui/core/view/view-helper/index.ios.ts b/packages/core/ui/core/view/view-helper/index.ios.ts index b293a0d8c..0596c2fbf 100644 --- a/packages/core/ui/core/view/view-helper/index.ios.ts +++ b/packages/core/ui/core/view/view-helper/index.ios.ts @@ -31,7 +31,7 @@ class UILayoutViewController extends UIViewController { public viewWillLayoutSubviews(): void { super.viewWillLayoutSubviews(); - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (owner) { IOSHelper.updateConstraints(this, owner); } @@ -39,7 +39,7 @@ class UILayoutViewController extends UIViewController { public viewDidLayoutSubviews(): void { super.viewDidLayoutSubviews(); - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (owner) { if (majorVersion >= 11) { // Handle nested UILayoutViewController safe area application. @@ -90,7 +90,7 @@ class UILayoutViewController extends UIViewController { public viewWillAppear(animated: boolean): void { super.viewWillAppear(animated); - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (!owner) { return; } @@ -104,7 +104,7 @@ class UILayoutViewController extends UIViewController { public viewDidDisappear(animated: boolean): void { super.viewDidDisappear(animated); - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (owner && owner.isLoaded && !owner.parent) { owner.callUnloaded(); } @@ -115,7 +115,7 @@ class UILayoutViewController extends UIViewController { super.traitCollectionDidChange(previousTraitCollection); if (majorVersion >= 13) { - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (owner && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) { owner.notify({ eventName: IOSHelper.traitCollectionColorAppearanceChangedEvent, @@ -142,7 +142,7 @@ class UIAdaptivePresentationControllerDelegateImp extends NSObject implements UI } public presentationControllerDidDismiss(presentationController: UIPresentationController) { - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (owner && typeof this.closedCallback === 'function') { this.closedCallback(); } @@ -165,7 +165,7 @@ class UIPopoverPresentationControllerDelegateImp extends NSObject implements UIP } public popoverPresentationControllerDidDismissPopover(popoverPresentationController: UIPopoverPresentationController) { - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (owner && typeof this.closedCallback === 'function') { this.closedCallback(); } diff --git a/packages/core/ui/date-picker/index.ios.ts b/packages/core/ui/date-picker/index.ios.ts index 5c80f53de..e647013fb 100644 --- a/packages/core/ui/date-picker/index.ios.ts +++ b/packages/core/ui/date-picker/index.ios.ts @@ -137,7 +137,7 @@ class UIDatePickerChangeHandlerImpl extends NSObject { } public valueChanged(sender: UIDatePicker) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } diff --git a/packages/core/ui/editable-text-base/index.android.ts b/packages/core/ui/editable-text-base/index.android.ts index 3e705d71d..f31b2bcd1 100644 --- a/packages/core/ui/editable-text-base/index.android.ts +++ b/packages/core/ui/editable-text-base/index.android.ts @@ -3,8 +3,6 @@ import { textTransformProperty, textProperty, resetSymbol } from '../text-base'; import { Color } from '../../color'; import { SDK_VERSION, ad } from '../../utils'; import { CoreTypes } from '../../core-types'; -import { Device } from '../../platform'; -import lazy from '../../utils/lazy'; export * from './editable-text-base-common'; diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts index 86b4390e7..8d652650a 100644 --- a/packages/core/ui/frame/index.android.ts +++ b/packages/core/ui/frame/index.android.ts @@ -171,11 +171,11 @@ export class Frame extends FrameBase { if (!this.isLoaded || this._executingContext) { return; } - + // in case the activity is "reset" using resetRootView we must wait for // the attachedToWindow event to make the first navigation or it will crash // https://github.com/NativeScript/NativeScript/commit/9dd3e1a8076e5022e411f2f2eeba34aabc68d112 - // though we should not do it on app "start" + // though we should not do it on app "start" // or it will create a "flash" to activity background color if (this._wasReset && !this._attachedToWindow) { return; @@ -1128,7 +1128,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks { if (savedInstanceState) { const rootViewId = savedInstanceState.getInt(ROOT_VIEW_ID_EXTRA, -1); if (rootViewId !== -1 && activityRootViewsMap.has(rootViewId)) { - this._rootView = activityRootViewsMap.get(rootViewId).get(); + this._rootView = activityRootViewsMap.get(rootViewId)?.get(); } } diff --git a/packages/core/ui/frame/index.ios.ts b/packages/core/ui/frame/index.ios.ts index 85ff42e6b..3ecc42e92 100644 --- a/packages/core/ui/frame/index.ios.ts +++ b/packages/core/ui/frame/index.ios.ts @@ -409,13 +409,13 @@ class UINavigationControllerImpl extends UINavigationController { } get owner(): Frame { - return this._owner.get?.(); + return this._owner?.deref?.(); } @profile public viewWillAppear(animated: boolean): void { super.viewWillAppear(animated); - const owner = this._owner.get?.(); + const owner = this._owner?.deref?.(); if (owner && !owner.isLoaded && !owner.parent) { owner.callLoaded(); } @@ -424,7 +424,7 @@ class UINavigationControllerImpl extends UINavigationController { @profile public viewDidDisappear(animated: boolean): void { super.viewDidDisappear(animated); - const owner = this._owner?.get?.(); + const owner = this._owner?.deref?.(); if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) { owner.callUnloaded(); owner._tearDownUI(true); @@ -548,7 +548,7 @@ class UINavigationControllerImpl extends UINavigationController { super.traitCollectionDidChange(previousTraitCollection); if (majorVersion >= 13) { - const owner = this._owner.get?.(); + const owner = this._owner?.deref?.(); if (owner && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) { owner.notify({ eventName: IOSHelper.traitCollectionColorAppearanceChangedEvent, diff --git a/packages/core/ui/gestures/index.ios.ts b/packages/core/ui/gestures/index.ios.ts index a6f9eca1b..82b2aa804 100644 --- a/packages/core/ui/gestures/index.ios.ts +++ b/packages/core/ui/gestures/index.ios.ts @@ -70,7 +70,7 @@ class UIGestureRecognizerImpl extends NSObject { } public recognize(recognizer: UIGestureRecognizer): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); const callback = this._callback ? this._callback : owner ? owner.callback : null; const typeParam = this._type; const target = owner ? owner.target : undefined; diff --git a/packages/core/ui/gestures/touch-manager.ts b/packages/core/ui/gestures/touch-manager.ts index 09e66fc8c..15b411136 100644 --- a/packages/core/ui/gestures/touch-manager.ts +++ b/packages/core/ui/gestures/touch-manager.ts @@ -231,17 +231,17 @@ function ensureTouchControlHandlers() { } touchDown(args) { - this._owner?.get?.().notify({ + this._owner?.deref?.().notify({ eventName: GestureEvents.touchDown, - object: this._owner?.get?.(), + object: this._owner?.deref?.(), data: args, }); } touchUp(args) { - this._owner?.get?.().notify({ + this._owner?.deref?.().notify({ eventName: GestureEvents.touchUp, - object: this._owner?.get?.(), + object: this._owner?.deref?.(), data: args, }); } diff --git a/packages/core/ui/image-cache/index.android.ts b/packages/core/ui/image-cache/index.android.ts index 82d59a5ae..00a1c6775 100644 --- a/packages/core/ui/image-cache/index.android.ts +++ b/packages/core/ui/image-cache/index.android.ts @@ -42,7 +42,7 @@ export class Cache extends common.Cache { const that = new WeakRef(this); this._callback = new org.nativescript.widgets.Async.CompleteCallback({ onComplete: function (result: any, context: any) { - const instance = that.get(); + const instance = that?.get(); if (instance) { if (result) { instance._onDownloadCompleted(context, result); @@ -52,7 +52,7 @@ export class Cache extends common.Cache { } }, onError: function (err: string, context: any) { - const instance = that.get(); + const instance = that?.get(); if (instance) { instance._onDownloadError(context, new Error(err)); } diff --git a/packages/core/ui/layouts/absolute-layout/absolute-layout-common.ts b/packages/core/ui/layouts/absolute-layout/absolute-layout-common.ts index 68a427488..50eedc1a9 100644 --- a/packages/core/ui/layouts/absolute-layout/absolute-layout-common.ts +++ b/packages/core/ui/layouts/absolute-layout/absolute-layout-common.ts @@ -3,7 +3,7 @@ import { LayoutBase } from '../layout-base'; import { CoreTypes } from '../../../core-types'; import { View, CSSType } from '../../core/view'; import { Property } from '../../core/properties'; -import { Length, zeroLength } from '../../styling/style-properties'; +import { Length } from '../../styling/style-properties'; export * from '../layout-base'; @@ -53,7 +53,7 @@ AbsoluteLayoutBase.prototype.recycleNativeView = 'auto'; export const leftProperty = new Property({ name: 'left', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, valueChanged: (target, oldValue, newValue) => { target.effectiveLeft = Length.toDevicePixels(newValue, 0); const layout = target.parent; @@ -67,7 +67,7 @@ leftProperty.register(View); export const topProperty = new Property({ name: 'top', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, valueChanged: (target, oldValue, newValue) => { target.effectiveTop = Length.toDevicePixels(newValue, 0); const layout = target.parent; diff --git a/packages/core/ui/list-picker/index.ios.ts b/packages/core/ui/list-picker/index.ios.ts index 7e666aadb..f8ff8ea7a 100644 --- a/packages/core/ui/list-picker/index.ios.ts +++ b/packages/core/ui/list-picker/index.ios.ts @@ -96,7 +96,7 @@ class ListPickerDataSource extends NSObject implements UIPickerViewDataSource { } public pickerViewNumberOfRowsInComponent(pickerView: UIPickerView, component: number) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); return owner && owner.items ? owner.items.length : 0; } @@ -116,7 +116,7 @@ class ListPickerDelegateImpl extends NSObject implements UIPickerViewDelegate { } public pickerViewAttributedTitleForRowForComponent(pickerView: UIPickerView, row: number, component: number): NSAttributedString { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { const title = NSAttributedString.alloc().initWithStringAttributes(owner._getItemAsString(row), { [NSForegroundColorAttributeName]: pickerView.tintColor }); @@ -127,7 +127,7 @@ class ListPickerDelegateImpl extends NSObject implements UIPickerViewDelegate { } public pickerViewDidSelectRowInComponent(pickerView: UIPickerView, row: number, component: number): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { selectedIndexProperty.nativeValueChange(owner, row); owner.updateSelectedValue(row); diff --git a/packages/core/ui/list-view/index.ios.ts b/packages/core/ui/list-view/index.ios.ts index 5c18d6bf2..5a5c5d14c 100644 --- a/packages/core/ui/list-view/index.ios.ts +++ b/packages/core/ui/list-view/index.ios.ts @@ -55,7 +55,7 @@ class ListViewCell extends UITableViewCell { } public get view(): View { - return this.owner ? this.owner.get() : null; + return this.owner ? this.owner.deref() : null; } public owner: WeakRef; @@ -89,14 +89,14 @@ class DataSource extends NSObject implements UITableViewDataSource { } public tableViewNumberOfRowsInSection(tableView: UITableView, section: number) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); return owner && owner.items ? owner.items.length : 0; } public tableViewCellForRowAtIndexPath(tableView: UITableView, indexPath: NSIndexPath): UITableViewCell { // We call this method because ...ForIndexPath calls tableViewHeightForRowAtIndexPath immediately (before we can prepare and measure it). - const owner = this._owner.get(); + const owner = this._owner?.deref(); let cell: ListViewCell; if (owner) { const template = owner._getItemTemplate(indexPath.row); @@ -138,7 +138,7 @@ class UITableViewDelegateImpl extends NSObject implements UITableViewDelegate { } public tableViewWillDisplayCellForRowAtIndexPath(tableView: UITableView, cell: UITableViewCell, indexPath: NSIndexPath) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && indexPath.row === owner.items.length - 1) { owner.notify({ eventName: LOADMOREITEMS, @@ -149,7 +149,7 @@ class UITableViewDelegateImpl extends NSObject implements UITableViewDelegate { public tableViewWillSelectRowAtIndexPath(tableView: UITableView, indexPath: NSIndexPath): NSIndexPath { const cell = tableView.cellForRowAtIndexPath(indexPath); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { notifyForItemAtIndex(owner, cell, cell.view, ITEMTAP, indexPath); } @@ -164,7 +164,7 @@ class UITableViewDelegateImpl extends NSObject implements UITableViewDelegate { } public tableViewHeightForRowAtIndexPath(tableView: UITableView, indexPath: NSIndexPath): number { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return tableView.estimatedRowHeight; } @@ -200,7 +200,7 @@ class UITableViewRowHeightDelegateImpl extends NSObject implements UITableViewDe } public tableViewWillDisplayCellForRowAtIndexPath(tableView: UITableView, cell: UITableViewCell, indexPath: NSIndexPath) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && indexPath.row === owner.items.length - 1) { owner.notify({ eventName: LOADMOREITEMS, @@ -211,7 +211,7 @@ class UITableViewRowHeightDelegateImpl extends NSObject implements UITableViewDe public tableViewWillSelectRowAtIndexPath(tableView: UITableView, indexPath: NSIndexPath): NSIndexPath { const cell = tableView.cellForRowAtIndexPath(indexPath); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { notifyForItemAtIndex(owner, cell, cell.view, ITEMTAP, indexPath); } @@ -226,7 +226,7 @@ class UITableViewRowHeightDelegateImpl extends NSObject implements UITableViewDe } public tableViewHeightForRowAtIndexPath(tableView: UITableView, indexPath: NSIndexPath): number { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return tableView.estimatedRowHeight; } diff --git a/packages/core/ui/page/index.ios.ts b/packages/core/ui/page/index.ios.ts index 445b4333b..6b5b54d45 100644 --- a/packages/core/ui/page/index.ios.ts +++ b/packages/core/ui/page/index.ios.ts @@ -112,7 +112,7 @@ class UIViewControllerImpl extends UIViewController { public viewWillAppear(animated: boolean): void { super.viewWillAppear(animated); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } @@ -155,7 +155,7 @@ class UIViewControllerImpl extends UIViewController { public viewDidAppear(animated: boolean): void { super.viewDidAppear(animated); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } @@ -218,7 +218,7 @@ class UIViewControllerImpl extends UIViewController { public viewWillDisappear(animated: boolean): void { super.viewWillDisappear(animated); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } @@ -248,7 +248,7 @@ class UIViewControllerImpl extends UIViewController { public viewDidDisappear(animated: boolean): void { super.viewDidDisappear(animated); - const page = this._owner.get(); + const page = this._owner?.deref(); // Exit if no page or page is hiding because it shows another page modally. if (!page || page.modal || page._presentedViewController) { return; @@ -261,7 +261,7 @@ class UIViewControllerImpl extends UIViewController { public viewWillLayoutSubviews(): void { super.viewWillLayoutSubviews(); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { IOSHelper.updateConstraints(this, owner); } @@ -272,7 +272,7 @@ class UIViewControllerImpl extends UIViewController { if (this.isRunningLayout) { return; } - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { this.runLayout(() => IOSHelper.layoutView(this, owner)); } @@ -281,7 +281,7 @@ class UIViewControllerImpl extends UIViewController { public viewDidLayoutSubviews(): void { this.startRunningLayout(); super.viewDidLayoutSubviews(); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { // layout(owner.actionBar) // layout(owner.content) @@ -339,7 +339,7 @@ class UIViewControllerImpl extends UIViewController { super.traitCollectionDidChange(previousTraitCollection); if (majorVersion >= 13) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) { owner.notify({ eventName: IOSHelper.traitCollectionColorAppearanceChangedEvent, @@ -366,7 +366,7 @@ class UIViewControllerImpl extends UIViewController { // @ts-ignore public get preferredStatusBarStyle(): UIStatusBarStyle { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.statusBarStyle === 'dark' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.Default; } else { diff --git a/packages/core/ui/scroll-view/index.android.ts b/packages/core/ui/scroll-view/index.android.ts index 67e367bbe..9ec97d965 100644 --- a/packages/core/ui/scroll-view/index.android.ts +++ b/packages/core/ui/scroll-view/index.android.ts @@ -133,22 +133,22 @@ export class ScrollView extends ScrollViewBase { if (this.orientation === 'vertical') { this.scrollChangeHandler = new androidx.core.widget.NestedScrollView.OnScrollChangeListener({ onScrollChange(view, scrollX, scrollY) { - const owner: ScrollView = that.get(); + const owner: ScrollView = that?.get(); if (owner) { owner.notify({ object: owner, eventName: ScrollView.scrollEvent, scrollX: layout.toDeviceIndependentPixels(scrollX), - scrollY: layout.toDeviceIndependentPixels(scrollY) + scrollY: layout.toDeviceIndependentPixels(scrollY), }); } - } + }, }); this.nativeView.setOnScrollChangeListener(this.scrollChangeHandler); } else { this.handler = new android.view.ViewTreeObserver.OnScrollChangedListener({ onScrollChanged: function () { - const owner: ScrollView = that.get(); + const owner: ScrollView = that?.get(); if (owner) { owner._onScrollChanged(); } diff --git a/packages/core/ui/scroll-view/index.ios.ts b/packages/core/ui/scroll-view/index.ios.ts index 2b7297eb9..cab5f14c4 100644 --- a/packages/core/ui/scroll-view/index.ios.ts +++ b/packages/core/ui/scroll-view/index.ios.ts @@ -19,7 +19,7 @@ class UIScrollViewDelegateImpl extends NSObject implements UIScrollViewDelegate } public scrollViewDidScroll(sv: UIScrollView): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.notify({ object: owner, diff --git a/packages/core/ui/search-bar/index.ios.ts b/packages/core/ui/search-bar/index.ios.ts index 10a9abe4a..429a47d52 100644 --- a/packages/core/ui/search-bar/index.ios.ts +++ b/packages/core/ui/search-bar/index.ios.ts @@ -23,7 +23,7 @@ class UISearchBarDelegateImpl extends NSObject implements UISearchBarDelegate { } public searchBarTextDidChange(searchBar: UISearchBar, searchText: string) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } @@ -38,7 +38,7 @@ class UISearchBarDelegateImpl extends NSObject implements UISearchBarDelegate { public searchBarCancelButtonClicked(searchBar: UISearchBar) { searchBar.resignFirstResponder(); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } @@ -48,7 +48,7 @@ class UISearchBarDelegateImpl extends NSObject implements UISearchBarDelegate { public searchBarSearchButtonClicked(searchBar: UISearchBar) { searchBar.resignFirstResponder(); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } diff --git a/packages/core/ui/segmented-bar/index.ios.ts b/packages/core/ui/segmented-bar/index.ios.ts index bcf2cc736..653d82611 100644 --- a/packages/core/ui/segmented-bar/index.ios.ts +++ b/packages/core/ui/segmented-bar/index.ios.ts @@ -119,7 +119,7 @@ class SelectionHandlerImpl extends NSObject { } public selected(sender: UISegmentedControl) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.selectedIndex = sender.selectedSegmentIndex; } diff --git a/packages/core/ui/slider/index.ios.ts b/packages/core/ui/slider/index.ios.ts index d276ae813..95ccd106e 100644 --- a/packages/core/ui/slider/index.ios.ts +++ b/packages/core/ui/slider/index.ios.ts @@ -19,7 +19,7 @@ class TNSSlider extends UISlider { } public accessibilityIncrement() { - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (!owner) { this.value += 10; } else { @@ -30,7 +30,7 @@ class TNSSlider extends UISlider { } public accessibilityDecrement() { - const owner = this.owner.get(); + const owner = this.owner?.deref(); if (!owner) { this.value += 10; } else { @@ -53,7 +53,7 @@ class SliderChangeHandlerImpl extends NSObject { } public sliderValueChanged(sender: UISlider) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { valueProperty.nativeValueChange(owner, sender.value); } diff --git a/packages/core/ui/styling/css-selector.spec.ts b/packages/core/ui/styling/css-selector.spec.ts new file mode 100644 index 000000000..936116dc0 --- /dev/null +++ b/packages/core/ui/styling/css-selector.spec.ts @@ -0,0 +1,290 @@ +import { parse } from '../../css/reworkcss'; +import { createSelector, RuleSet, SelectorsMap, fromAstNodes, Node, Changes } from './css-selector'; + +describe('css-selector', () => { + it('button[attr]', () => { + const sel = createSelector('button[testAttr]'); + expect( + sel.match({ + cssType: 'button', + testAttr: true, + }) + ).toBeTruthy(); + expect( + sel.match({ + cssType: 'button', + }) + ).toBeFalsy(); + }); + + function create(css: string, source = 'css-selectors.ts@test'): { rules: RuleSet[]; map: SelectorsMap } { + const parsed = parse(css, { source }); + const rulesAst = parsed.stylesheet.rules.filter((n) => n.type === 'rule'); + const rules = fromAstNodes(rulesAst); + const map = new SelectorsMap(rules); + + return { rules, map }; + } + + function createOne(css: string, source = 'css-selectors.ts@test'): RuleSet { + const { rules } = create(css, source); + expect(rules.length).toBe(1); + + return rules[0]; + } + + it('single selector', () => { + const rule = createOne(`* { color: red; }`); + expect(rule.selectors[0].match({ cssType: 'button' })).toBeTruthy(); + expect(rule.selectors[0].match({ cssType: 'image' })).toBeTruthy(); + }); + + it('two selectors', () => { + const rule = createOne(`button, image { color: red; }`); + expect(rule.selectors[0].match({ cssType: 'button' })).toBeTruthy(); + expect(rule.selectors[1].match({ cssType: 'image' })).toBeTruthy(); + expect(rule.selectors[0].match({ cssType: 'stacklayout' })).toBeFalsy(); + expect(rule.selectors[1].match({ cssType: 'stacklayout' })).toBeFalsy(); + }); + + it('narrow selection', () => { + const { map } = create(` + .login { color: blue; } + button { color: red; } + image { color: green; } + `); + + const buttonQuerry = map.query({ cssType: 'button' }).selectors; + expect(buttonQuerry.length).toBe(1); + expect(buttonQuerry[0].ruleset.declarations).toEqual([{ property: 'color', value: 'red' }]); + + const imageQuerry = map.query({ cssType: 'image', cssClasses: new Set(['login']) }).selectors; + expect(imageQuerry.length).toBe(2); + // Note class before type + expect(imageQuerry[0].ruleset.declarations).toEqual([{ property: 'color', value: 'blue' }]); + expect(imageQuerry[1].ruleset.declarations).toEqual([{ property: 'color', value: 'green' }]); + }); + + const positiveMatches = { + '*': (view) => true, + type: (view) => view.cssType === 'type', + '#id': (view) => view.id === 'id', + '.class': (view) => view.cssClasses.has('class'), + ':pseudo': (view) => view.cssPseudoClasses.has('pseudo'), + '[src1]': (view) => 'src1' in view, + "[src2='src-value']": (view) => view['src2'] === 'src-value', + }; + + const positivelyMatchingView = { + cssType: 'type', + id: 'id', + cssClasses: new Set(['class']), + cssPseudoClasses: new Set(['pseudo']), + src1: 'src', + src2: 'src-value', + }; + + const negativelyMatchingView = { + cssType: 'nottype', + id: 'notid', + cssClasses: new Set(['notclass']), + cssPseudoClasses: new Set(['notpseudo']), + // Has no "src1" + src2: 'not-src-value', + }; + + it('simple selectors match', () => { + for (const sel in positiveMatches) { + const css = sel + ' { color: red; }'; + const rule = createOne(css); + expect(rule.selectors[0].match(positivelyMatchingView)).toBe(true); + if (sel !== '*') { + expect(rule.selectors[0].match(negativelyMatchingView)).toBe(false); + } + } + }); + + it('two selector sequence positive match', () => { + for (const firstStr in positiveMatches) { + for (const secondStr in positiveMatches) { + if (secondStr !== firstStr && secondStr !== '*' && secondStr !== 'type') { + const css = firstStr + secondStr + ' { color: red; }'; + const rule = createOne(css); + expect(rule.selectors[0].match(positivelyMatchingView)).toBe(true); + if (firstStr !== '*') { + expect(rule.selectors[0].match(negativelyMatchingView)).toBe(false); + } + } + } + } + }); + + it('direct parent combinator', () => { + const rule = createOne(`listview > item:selected { color: red; }`); + expect( + rule.selectors[0].match({ + cssType: 'item', + cssPseudoClasses: new Set(['selected']), + parent: { + cssType: 'listview', + }, + }) + ).toBe(true); + expect( + rule.selectors[0].match({ + cssType: 'item', + cssPseudoClasses: new Set(['selected']), + parent: { + cssType: 'stacklayout', + parent: { + cssType: 'listview', + }, + }, + }) + ).toBe(false); + }); + + it('ancestor combinator', () => { + const rule = createOne(`listview item:selected { color: red; }`); + expect( + rule.selectors[0].match({ + cssType: 'item', + cssPseudoClasses: new Set(['selected']), + parent: { + cssType: 'listview', + }, + }) + ).toBe(true); + expect( + rule.selectors[0].match({ + cssType: 'item', + cssPseudoClasses: new Set(['selected']), + parent: { + cssType: 'stacklayout', + parent: { + cssType: 'listview', + }, + }, + }) + ).toBe(true); + expect( + rule.selectors[0].match({ + cssType: 'item', + cssPseudoClasses: new Set(['selected']), + parent: { + cssType: 'stacklayout', + parent: { + cssType: 'page', + }, + }, + }) + ).toBe(false); + }); + + it('backtracking css selector', () => { + const sel = createOne(`a>b c { color: red; }`).selectors[0]; + const child = { + cssType: 'c', + parent: { + cssType: 'b', + parent: { + cssType: 'fail', + parent: { + cssType: 'b', + parent: { + cssType: 'a', + }, + }, + }, + }, + }; + + expect(sel.match(child)).toBe(true); + }); + + function toString() { + return this.cssType; + } + + // it('simple query match', () => { + // const { map } = create(`list grid[promotion] button:highlighted { color: red; }`); + + // let list, grid, button; + + // button = { + // cssType: 'button', + // cssPseudoClasses: new Set(['highlighted']), + // toString, + // parent: (grid = { + // cssType: 'grid', + // promotion: true, + // toString, + // parent: (list = { + // cssType: 'list', + // toString, + // }), + // }), + // }; + + // const match = map.query(button); + // expect(match.selectors.length).toBe(1); + + // const expected = new Map().set(grid, { attributes: new Set(['promotion']) }).set(button, { pseudoClasses: new Set(['highlighted']) }); + + // expect(match.changeMap).toEqual(expected); + // }); + + // it('query match one child group', () => { + // const { map } = create(`#prod[special] > gridlayout { color: red; }`); + // let gridlayout, prod; + + // gridlayout = { + // cssType: 'gridlayout', + // toString, + // parent: (prod = { + // id: 'prod', + // cssType: 'listview', + // toString, + // }), + // }; + + // const match = map.query(gridlayout); + // expect(match.selectors.length).toBe(1); + + // const expected = new Map().set(prod, { attributes: new Set(['special']) }); + // expect(match.changeMap).toEqual(expected); + // }); + + // it('query match one sibling group (deepEqual does not compare Map?)', () => { + // const { map } = create(`list button:highlighted+button:disabled { color: red; }`); + // let list, button, disabledButton; + + // list = { + // cssType: 'list', + // toString, + // getChildIndex: () => 1, + // getChildAt: () => button, + // }; + + // button = { + // cssType: 'button', + // cssPseudoClasses: new Set(['highlighted']), + // toString, + // parent: list, + // }; + + // disabledButton = { + // cssType: 'button', + // cssPseudoClasses: new Set(['disabled']), + // toString, + // parent: list, + // }; + + // const match = map.query(disabledButton); + // expect(match.selectors.length).toBe(1); + + // const expected = new Map().set(disabledButton, { pseudoClasses: new Set(['disabled']) }).set(button, { pseudoClasses: new Set(['highlighted']) }); + + // expect(match.changeMap).toEqual(expected); + // }); +}); diff --git a/packages/core/ui/styling/css-selector/index.ts b/packages/core/ui/styling/css-selector.ts similarity index 97% rename from packages/core/ui/styling/css-selector/index.ts rename to packages/core/ui/styling/css-selector.ts index b9a124819..bccd3971d 100644 --- a/packages/core/ui/styling/css-selector/index.ts +++ b/packages/core/ui/styling/css-selector.ts @@ -1,9 +1,9 @@ -import '../../../globals'; -import { isCssVariable } from '../../core/properties'; -import { isNullOrUndefined } from '../../../utils/types'; +import '../../globals'; +import { isCssVariable } from '../core/properties'; +import { isNullOrUndefined } from '../../utils/types'; -import * as cssParser from '../../../css'; -import { Combinator as ICombinator, SimpleSelectorSequence as ISimpleSelectorSequence, Selector as ISelector, SimpleSelector as ISimpleSelector, parseSelector } from '../../../css/parser'; +import * as ReworkCSS from '../../css'; +import { Combinator as ICombinator, SimpleSelectorSequence as ISimpleSelectorSequence, Selector as ISelector, SimpleSelector as ISimpleSelector, parseSelector } from '../../css/parser'; /** * An interface describing the shape of a type on which the selectors may apply. @@ -515,8 +515,8 @@ export class RuleSet { } } -export function fromAstNodes(astRules: cssParser.Node[]): RuleSet[] { - return (astRules.filter(isRule)).map((rule) => { +export function fromAstNodes(astRules: ReworkCSS.Node[]): RuleSet[] { + return (astRules.filter(isRule)).map((rule) => { const declarations = rule.declarations.filter(isDeclaration).map(createDeclaration); const selectors = rule.selectors.map(createSelector); @@ -524,7 +524,7 @@ export function fromAstNodes(astRules: cssParser.Node[]): RuleSet[] { }); } -function createDeclaration(decl: cssParser.Declaration): any { +function createDeclaration(decl: ReworkCSS.Declaration): any { return { property: isCssVariable(decl.property) ? decl.property : decl.property.toLowerCase(), value: decl.value }; } @@ -599,10 +599,10 @@ export function createSelector(sel: string): SimpleSelector | SimpleSelectorSequ } } -function isRule(node: cssParser.Node): node is cssParser.Rule { +function isRule(node: ReworkCSS.Node): node is ReworkCSS.Rule { return node.type === 'rule'; } -function isDeclaration(node: cssParser.Node): node is cssParser.Declaration { +function isDeclaration(node: ReworkCSS.Node): node is ReworkCSS.Declaration { return node.type === 'declaration'; } diff --git a/packages/core/ui/styling/css-shadow.spec.ts b/packages/core/ui/styling/css-shadow.spec.ts new file mode 100644 index 000000000..0d7624f7f --- /dev/null +++ b/packages/core/ui/styling/css-shadow.spec.ts @@ -0,0 +1,137 @@ +import { parseCSSShadow } from './css-shadow'; +import { CoreTypes } from '../../core-types'; +import { Length } from './style-properties'; +import { Color } from '../../color'; + +describe('css-shadow', () => { + it('empty', () => { + const shadow = parseCSSShadow(''); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toBe(CoreTypes.zeroLength); + expect(shadow.offsetY).toBeUndefined(); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('black')); + }); + + it('1px 1px 2px black', () => { + const shadow = parseCSSShadow('1px 1px 2px black'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('1px')); + expect(shadow.offsetY).toEqual(Length.parse('1px')); + expect(shadow.blurRadius).toEqual(Length.parse('2px')); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('black')); + }); + + it('#fc0 1px 0 10px', () => { + const shadow = parseCSSShadow('#fc0 1px 0 10px'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('1px')); + expect(shadow.offsetY).toEqual(0); + expect(shadow.blurRadius).toEqual(Length.parse('10px')); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('#fc0')); + }); + + it('5px 5px #558abb', () => { + const shadow = parseCSSShadow('5px 5px #558abb'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('5px')); + expect(shadow.offsetY).toEqual(Length.parse('5px')); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('#558abb')); + }); + + it('white 2px 5px', () => { + const shadow = parseCSSShadow('white 2px 5px'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('2px')); + expect(shadow.offsetY).toEqual(Length.parse('5px')); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('white')); + }); + + it('5px 10px', () => { + const shadow = parseCSSShadow('5px 10px'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('5px')); + expect(shadow.offsetY).toEqual(Length.parse('10px')); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('black')); + }); + + // box + it('60px -16px teal', () => { + const shadow = parseCSSShadow('60px -16px teal'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('60px')); + expect(shadow.offsetY).toEqual(Length.parse('-16px')); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('teal')); + }); + + it('10px 5px 5px black', () => { + const shadow = parseCSSShadow('10px 5px 5px black'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('10px')); + expect(shadow.offsetY).toEqual(Length.parse('5px')); + expect(shadow.blurRadius).toEqual(Length.parse('5px')); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('black')); + }); + + it('2px 2px 2px 1px rgba(0, 0, 0, 0.2)', () => { + const shadow = parseCSSShadow('2px 2px 2px 1px rgba(0, 0, 0, 0.2)'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toEqual(Length.parse('2px')); + expect(shadow.offsetY).toEqual(Length.parse('2px')); + expect(shadow.blurRadius).toEqual(Length.parse('2px')); + expect(shadow.spreadRadius).toEqual(Length.parse('1px')); + expect(shadow.color).toEqual(new Color('rgba(0, 0, 0, 0.2)')); + }); + + it('inset 5em 1em gold', () => { + const shadow = parseCSSShadow('inset 5em 1em gold'); + expect(shadow.inset).toBe(true); + expect(shadow.offsetX).toBe(5); + expect(shadow.offsetY).toBe(1); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('gold')); + }); + + it('5 10', () => { + const shadow = parseCSSShadow('5 10'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toBe(5); + expect(shadow.offsetY).toBe(10); + expect(shadow.blurRadius).toBeUndefined(); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('black')); + }); + + it('2 2 2 #333', () => { + const shadow = parseCSSShadow('2 2 2 #333'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toBe(2); + expect(shadow.offsetY).toBe(2); + expect(shadow.blurRadius).toBe(2); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('#333')); + }); + + it('-1 -1 1 #333', () => { + const shadow = parseCSSShadow('-1 -1 1 #333'); + expect(shadow.inset).toBe(false); + expect(shadow.offsetX).toBe(-1); + expect(shadow.offsetY).toBe(-1); + expect(shadow.blurRadius).toBe(1); + expect(shadow.spreadRadius).toBeUndefined(); + expect(shadow.color).toEqual(new Color('#333')); + }); +}); diff --git a/packages/core/ui/styling/css-shadow.ts b/packages/core/ui/styling/css-shadow.ts index 3dc8fc6d4..e24a9d29c 100644 --- a/packages/core/ui/styling/css-shadow.ts +++ b/packages/core/ui/styling/css-shadow.ts @@ -1,6 +1,6 @@ import { CoreTypes } from '../../core-types'; import { Color } from '../../color'; -import { Length, zeroLength } from './style-properties'; +import { Length } from './style-properties'; export interface CSSShadow { inset: boolean; @@ -45,9 +45,9 @@ export function parseCSSShadow(value: string): CSSShadow { } let colorRaw = 'black'; - if (!isLength(first) && first !== 'inset') { + if (first && !isLength(first) && first !== 'inset') { colorRaw = first; - } else if (!isLength(last)) { + } else if (last && !isLength(last)) { colorRaw = last; } const nums = parts @@ -57,7 +57,7 @@ export function parseCSSShadow(value: string): CSSShadow { try { return Length.parse(val); } catch (err) { - return zeroLength; + return CoreTypes.zeroLength; } }); const [offsetX, offsetY, blurRadius, spreadRadius] = nums; diff --git a/packages/core/ui/styling/font-common.ts b/packages/core/ui/styling/font-common.ts index 20d0b3b86..7e01a4d71 100644 --- a/packages/core/ui/styling/font-common.ts +++ b/packages/core/ui/styling/font-common.ts @@ -1,10 +1,7 @@ -import { Font as FontDefinition, FontVariationSettingsType } from './font'; -import { ParsedFont } from './font-interfaces'; +import { Font as FontDefinition } from './font'; +import { ParsedFont, FontStyleType, FontWeightType, FontVariationSettingsType } from './font-interfaces'; import { makeValidator, makeParser } from '../core/properties'; -export * from './font-interfaces'; -export { FontVariationSettingsType }; - export abstract class Font implements FontDefinition { public static default = undefined; public readonly fontStyle: FontStyleType; @@ -49,7 +46,6 @@ export abstract class Font implements FontDefinition { } } -export type FontStyleType = 'normal' | 'italic'; export namespace FontStyle { export const NORMAL = 'normal'; export const ITALIC = 'italic'; @@ -57,7 +53,6 @@ export namespace FontStyle { export const parse = makeParser(isValid); } -export type FontWeightType = '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900' | number; export namespace FontWeight { export const THIN = '100'; export const EXTRA_LIGHT = '200'; @@ -72,7 +67,6 @@ export namespace FontWeight { export const parse = makeParser(isValid); } -// eslint-disable-next-line @typescript-eslint/no-namespace export namespace FontVariationSettings { export function parse(fontVariationSettings: string): Array | null { const allowedValues = ['normal', 'inherit', 'initial', 'revert', 'revert-layer', 'unset']; diff --git a/packages/core/ui/styling/font-interfaces.ts b/packages/core/ui/styling/font-interfaces.ts index 948f26822..babea81f2 100644 --- a/packages/core/ui/styling/font-interfaces.ts +++ b/packages/core/ui/styling/font-interfaces.ts @@ -1,12 +1,17 @@ -export type FontStyle = 'normal' | 'italic'; - -export type FontWeight = '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900' | number; +export type FontStyleType = 'normal' | 'italic'; +export type FontWeightType = '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900' | number; export interface ParsedFont { - fontStyle?: FontStyle; + fontStyle?: FontStyleType; fontVariant?: string; - fontWeight?: FontWeight; + fontWeight?: FontWeightType; lineHeight?: string; fontSize?: string; fontFamily?: string; + fontVariationSettings?: Array; } + +export type FontVariationSettingsType = { + axis: string; + value: number; +}; diff --git a/packages/core/ui/styling/font.android.ts b/packages/core/ui/styling/font.android.ts index 7af1a4e3b..5e08bb222 100644 --- a/packages/core/ui/styling/font.android.ts +++ b/packages/core/ui/styling/font.android.ts @@ -1,4 +1,5 @@ -import { Font as FontBase, parseFontFamily, genericFontFamilies, FontStyleType, FontWeight, FontWeightType, FontVariationSettingsType, FontVariationSettings } from './font-common'; +import { Font as FontBase, parseFontFamily, genericFontFamilies, FontWeight, FontVariationSettings } from './font-common'; +import { FontStyleType, FontWeightType, FontVariationSettingsType } from './font-interfaces'; import { Trace } from '../../trace'; import { SDK_VERSION } from '../../utils'; import * as fs from '../../file-system'; @@ -11,7 +12,7 @@ const typefaceCache = new Map(); let appAssets: android.content.res.AssetManager; export class Font extends FontBase { - public static default = new Font(undefined, undefined); + static default = new Font(undefined, undefined); private _typeface: android.graphics.Typeface; @@ -43,7 +44,7 @@ export class Font extends FontBase { return new Font(this.fontFamily, this.fontSize, this.fontStyle, this.fontWeight, variationSettings); } - public getAndroidTypeface(): android.graphics.Typeface { + getAndroidTypeface(): android.graphics.Typeface { if (!this._typeface) { this._typeface = createTypeface(this); } @@ -51,7 +52,7 @@ export class Font extends FontBase { return this._typeface; } - public getUIFont(defaultFont: UIFont): UIFont { + getUIFont(defaultFont: UIFont): UIFont { return undefined; } } diff --git a/packages/core/ui/styling/font.d.ts b/packages/core/ui/styling/font.d.ts index 8acbe6948..d86ad3e99 100644 --- a/packages/core/ui/styling/font.d.ts +++ b/packages/core/ui/styling/font.d.ts @@ -1,4 +1,7 @@ -export class Font { +import { Font as FontBase } from './font-common'; +export type { FontStyleType, FontWeightType, ParsedFont, FontVariationSettingsType } from './font-interfaces'; + +export declare class Font extends FontBase { public static default: Font; public fontFamily: string; @@ -26,7 +29,6 @@ public static equals(value1: Font, value2: Font): boolean; } -export type FontStyleType = 'normal' | 'italic'; export namespace FontStyle { export const NORMAL: 'normal'; export const ITALIC: 'italic'; @@ -34,7 +36,6 @@ export namespace FontStyle { export function parse(value: string): FontStyleType; } -export type FontWeightType = '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900' | number; export namespace FontWeight { export const THIN: '100'; export const EXTRA_LIGHT: '200'; @@ -49,26 +50,11 @@ export namespace FontWeight { export function parse(value: string): FontWeightType; } -export type FontVariationSettingsType = { - axis: string; - value: number; -}; - export namespace FontVariationSettings { export function parse(fontVariationSettings: string): Array | null; export function toString(fontVariationSettings: Array | null): string | null; } -export interface ParsedFont { - fontStyle?: FontStyleType; - fontVariant?: string; - fontWeight?: FontWeightType; - lineHeight?: string; - fontSize?: string; - fontFamily?: string; - fontVariationSettings?: Array; -} - export function parseFont(fontValue: string): ParsedFont; export namespace ios { diff --git a/packages/core/ui/styling/font.ios.ts b/packages/core/ui/styling/font.ios.ts index 7d685a68e..f1f861318 100644 --- a/packages/core/ui/styling/font.ios.ts +++ b/packages/core/ui/styling/font.ios.ts @@ -1,7 +1,8 @@ -import { Font as FontBase, parseFontFamily, FontWeight, FontStyleType, FontWeightType, FontVariationSettingsType, FontVariationSettings, fuzzySearch } from './font-common'; +import { Font as FontBase, parseFontFamily, FontWeight, FontVariationSettings, fuzzySearch } from './font-common'; +import { FontStyleType, FontWeightType, FontVariationSettingsType } from './font-interfaces'; import { Trace } from '../../trace'; import * as fs from '../../file-system'; -export * from './font-common'; +export { FontStyle, FontWeight, FontVariationSettings, parseFont } from './font-common'; interface FontDescriptor { fontFamily: string[]; @@ -57,7 +58,7 @@ function getUIFontCached(fontDescriptor: FontDescriptor) { } export class Font extends FontBase { - public static default = new Font(undefined, undefined); + static default = new Font(undefined, undefined); constructor(family: string, size: number, style?: FontStyleType, weight?: FontWeightType, scale?: number, variationSettings?: Array) { super(family, size, style, weight, scale, variationSettings); @@ -87,7 +88,7 @@ export class Font extends FontBase { return new Font(this.fontFamily, this.fontSize, this.fontStyle, this.fontWeight, this.fontScale, variationSettings); } - public getUIFont(defaultFont: UIFont): UIFont { + getUIFont(defaultFont: UIFont): UIFont { return getUIFontCached({ fontFamily: parseFontFamily(this.fontFamily), fontSize: this.fontSize || defaultFont.pointSize, @@ -98,7 +99,7 @@ export class Font extends FontBase { }); } - public getAndroidTypeface(): android.graphics.Typeface { + getAndroidTypeface(): android.graphics.Typeface { return undefined; } } diff --git a/packages/core/ui/styling/style-properties.ts b/packages/core/ui/styling/style-properties.ts index 94788678f..08da7e6d1 100644 --- a/packages/core/ui/styling/style-properties.ts +++ b/packages/core/ui/styling/style-properties.ts @@ -4,7 +4,7 @@ import { Style } from '../styling/style'; import { Transformation, TransformationValue, TransformFunctionsInfo } from '../animation'; import { Color } from '../../color'; -import { Font, parseFont, FontStyle, FontWeight, FontVariationSettings, FontVariationSettingsType } from '../../ui/styling/font'; +import { Font, parseFont, FontStyle, FontStyleType, FontWeight, FontWeightType, FontVariationSettings, FontVariationSettingsType } from '../../ui/styling/font'; import { layout, hasDuplicates } from '../../utils'; import { Background } from '../../ui/styling/background'; @@ -17,7 +17,6 @@ import { CoreTypes } from '../../core-types'; import { parseBackground } from '../../css/parser'; import { LinearGradient } from './linear-gradient'; import { CSSShadow, parseCSSShadow } from './css-shadow'; -import { FontStyleType, FontWeightType } from './font-common'; function equalsCommon(a: CoreTypes.LengthType, b: CoreTypes.LengthType): boolean; function equalsCommon(a: CoreTypes.PercentLengthType, b: CoreTypes.PercentLengthType): boolean; @@ -185,12 +184,10 @@ export namespace Length { } = convertToStringCommon; } -export const zeroLength: CoreTypes.LengthType = { value: 0, unit: 'px' }; - export const minWidthProperty = new CssProperty({ name: 'minWidth', cssName: 'min-width', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -208,7 +205,7 @@ minWidthProperty.register(Style); export const minHeightProperty = new CssProperty({ name: 'minHeight', cssName: 'min-height', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -278,7 +275,7 @@ marginProperty.register(Style); export const marginLeftProperty = new CssProperty({ name: 'marginLeft', cssName: 'margin-left', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueConverter: PercentLength.parse, @@ -288,7 +285,7 @@ marginLeftProperty.register(Style); export const marginRightProperty = new CssProperty({ name: 'marginRight', cssName: 'margin-right', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueConverter: PercentLength.parse, @@ -298,7 +295,7 @@ marginRightProperty.register(Style); export const marginTopProperty = new CssProperty({ name: 'marginTop', cssName: 'margin-top', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueConverter: PercentLength.parse, @@ -308,7 +305,7 @@ marginTopProperty.register(Style); export const marginBottomProperty = new CssProperty({ name: 'marginBottom', cssName: 'margin-bottom', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueConverter: PercentLength.parse, @@ -332,7 +329,7 @@ paddingProperty.register(Style); export const paddingLeftProperty = new CssProperty({ name: 'paddingLeft', cssName: 'padding-left', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -350,7 +347,7 @@ paddingLeftProperty.register(Style); export const paddingRightProperty = new CssProperty({ name: 'paddingRight', cssName: 'padding-right', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -368,7 +365,7 @@ paddingRightProperty.register(Style); export const paddingTopProperty = new CssProperty({ name: 'paddingTop', cssName: 'padding-top', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -386,7 +383,7 @@ paddingTopProperty.register(Style); export const paddingBottomProperty = new CssProperty({ name: 'paddingBottom', cssName: 'padding-bottom', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -1034,7 +1031,7 @@ borderWidthProperty.register(Style); export const borderTopWidthProperty = new CssProperty({ name: 'borderTopWidth', cssName: 'border-top-width', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -1058,7 +1055,7 @@ borderTopWidthProperty.register(Style); export const borderRightWidthProperty = new CssProperty({ name: 'borderRightWidth', cssName: 'border-right-width', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -1082,7 +1079,7 @@ borderRightWidthProperty.register(Style); export const borderBottomWidthProperty = new CssProperty({ name: 'borderBottomWidth', cssName: 'border-bottom-width', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { @@ -1106,7 +1103,7 @@ borderBottomWidthProperty.register(Style); export const borderLeftWidthProperty = new CssProperty({ name: 'borderLeftWidth', cssName: 'border-left-width', - defaultValue: zeroLength, + defaultValue: CoreTypes.zeroLength, affectsLayout: global.isIOS, equalityComparer: Length.equals, valueChanged: (target, oldValue, newValue) => { diff --git a/packages/core/ui/styling/style-scope.ts b/packages/core/ui/styling/style-scope.ts index 4ccb2228b..ad47fb19e 100644 --- a/packages/core/ui/styling/style-scope.ts +++ b/packages/core/ui/styling/style-scope.ts @@ -2,7 +2,7 @@ import { Keyframes } from '../animation/keyframe-animation'; import { ViewBase } from '../core/view-base'; import { View } from '../core/view'; import { unsetValue, _evaluateCssVariableExpression, _evaluateCssCalcExpression, isCssVariable, isCssVariableExpression, isCssCalcExpression } from '../core/properties'; -import { SyntaxTree, Keyframes as KeyframesDefinition, parse as parseCss, Node as CssNode } from '../../css'; +import { SyntaxTree, Keyframes as KeyframesDefinition, Node as CssNode } from '../../css'; import { RuleSet, SelectorsMap, SelectorCore, SelectorsMatch, ChangeMap, fromAstNodes, Node } from './css-selector'; import { Trace } from '../../trace'; diff --git a/packages/core/ui/switch/index.ios.ts b/packages/core/ui/switch/index.ios.ts index 0841d7617..242b9aabd 100644 --- a/packages/core/ui/switch/index.ios.ts +++ b/packages/core/ui/switch/index.ios.ts @@ -19,7 +19,7 @@ class SwitchChangeHandlerImpl extends NSObject { } public valueChanged(sender: UISwitch) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { checkedProperty.nativeValueChange(owner, sender.on); } diff --git a/packages/core/ui/tab-view/index.ios.ts b/packages/core/ui/tab-view/index.ios.ts index c8dc3367a..ff16d749d 100644 --- a/packages/core/ui/tab-view/index.ios.ts +++ b/packages/core/ui/tab-view/index.ios.ts @@ -41,7 +41,7 @@ class UITabBarControllerImpl extends UITabBarController { @profile public viewWillAppear(animated: boolean): void { super.viewWillAppear(animated); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } @@ -56,7 +56,7 @@ class UITabBarControllerImpl extends UITabBarController { @profile public viewDidDisappear(animated: boolean): void { super.viewDidDisappear(animated); - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && !owner.parent && owner.isLoaded && !this.presentedViewController) { owner.callUnloaded(); } @@ -65,7 +65,7 @@ class UITabBarControllerImpl extends UITabBarController { public viewWillTransitionToSizeWithTransitionCoordinator(size: CGSize, coordinator: UIViewControllerTransitionCoordinator): void { super.viewWillTransitionToSizeWithTransitionCoordinator(size, coordinator); coordinator.animateAlongsideTransitionCompletion(null, () => { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && owner.items) { owner.items.forEach((tabItem) => tabItem._updateTitleAndIconPositions()); } @@ -77,7 +77,7 @@ class UITabBarControllerImpl extends UITabBarController { super.traitCollectionDidChange(previousTraitCollection); if (majorVersion >= 13) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) { owner.notify({ eventName: IOSHelper.traitCollectionColorAppearanceChangedEvent, @@ -106,7 +106,7 @@ class UITabBarControllerDelegateImpl extends NSObject implements UITabBarControl Trace.write('TabView.delegate.SHOULD_select(' + tabBarController + ', ' + viewController + ');', Trace.categories.Debug); } - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { // "< More" cannot be visible after clicking on the main tab bar buttons. const backToMoreWillBeVisible = false; @@ -127,7 +127,7 @@ class UITabBarControllerDelegateImpl extends NSObject implements UITabBarControl Trace.write('TabView.delegate.DID_select(' + tabBarController + ', ' + viewController + ');', Trace.categories.Debug); } - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner._onViewControllerShown(viewController); } @@ -154,7 +154,7 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio Trace.write('TabView.moreNavigationController.WILL_show(' + navigationController + ', ' + viewController + ', ' + animated + ');', Trace.categories.Debug); } - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { // If viewController is one of our tab item controllers, then "< More" will be visible shortly. // Otherwise viewController is the UIMoreListController which shows the list of all tabs beyond the 4th tab. @@ -169,7 +169,7 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio } // We don't need Edit button in More screen. navigationController.navigationBar.topItem.rightBarButtonItem = null; - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner._onViewControllerShown(viewController); } diff --git a/packages/core/ui/text-base/index.android.ts b/packages/core/ui/text-base/index.android.ts index ce7d277f0..255ab422c 100644 --- a/packages/core/ui/text-base/index.android.ts +++ b/packages/core/ui/text-base/index.android.ts @@ -82,7 +82,7 @@ function initializeClickableSpan(): void { return global.__native(this); } onClick(view: android.view.View): void { - const owner = this.owner.get(); + const owner = this.owner?.get(); if (owner) { owner._emit(Span.linkTapEvent); } diff --git a/packages/core/ui/text-base/index.ios.ts b/packages/core/ui/text-base/index.ios.ts index 33e674922..b8a80c5a7 100644 --- a/packages/core/ui/text-base/index.ios.ts +++ b/packages/core/ui/text-base/index.ios.ts @@ -31,7 +31,7 @@ class UILabelClickHandlerImpl extends NSObject { } public linkTap(tapGesture: UITapGestureRecognizer) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { const label = owner.nativeTextViewProtected; diff --git a/packages/core/ui/text-base/text-base-common.ts b/packages/core/ui/text-base/text-base-common.ts index e328f6cce..bb2d4d649 100644 --- a/packages/core/ui/text-base/text-base-common.ts +++ b/packages/core/ui/text-base/text-base-common.ts @@ -1,7 +1,7 @@ // Types import { PropertyChangeData } from '../../data/observable'; import { ViewBase } from '../core/view-base'; -import { FontStyle, FontWeight } from '../styling/font-interfaces'; +import { FontStyleType, FontWeightType } from '../styling/font-interfaces'; // Requires. import { FormattedString } from './formatted-string'; @@ -62,17 +62,17 @@ export abstract class TextBaseCommon extends View implements TextBaseDefinition this.style.fontSize = value; } - get fontStyle(): FontStyle { + get fontStyle(): FontStyleType { return this.style.fontStyle; } - set fontStyle(value: FontStyle) { + set fontStyle(value: FontStyleType) { this.style.fontStyle = value; } - get fontWeight(): FontWeight { + get fontWeight(): FontWeightType { return this.style.fontWeight; } - set fontWeight(value: FontWeight) { + set fontWeight(value: FontWeightType) { this.style.fontWeight = value; } @@ -206,7 +206,7 @@ export abstract class TextBaseCommon extends View implements TextBaseDefinition TextBaseCommon.prototype._isSingleLine = false; -export function isBold(fontWeight: FontWeight): boolean { +export function isBold(fontWeight: FontWeightType): boolean { return fontWeight === 'bold' || fontWeight === '700' || fontWeight === '800' || fontWeight === '900'; } diff --git a/packages/core/ui/text-field/index.ios.ts b/packages/core/ui/text-field/index.ios.ts index 11431ca4e..f55b3204c 100644 --- a/packages/core/ui/text-field/index.ios.ts +++ b/packages/core/ui/text-field/index.ios.ts @@ -9,11 +9,6 @@ import { profile } from '../../profiling'; export * from './text-field-common'; -const zeroLength: CoreTypes.LengthType = { - value: 0, - unit: 'px', -}; - @NativeClass class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate { public static ObjCProtocols = [UITextFieldDelegate]; @@ -29,7 +24,7 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate { } public textFieldShouldBeginEditing(textField: UITextField): boolean { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.textFieldShouldBeginEditing(textField); } @@ -38,21 +33,21 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate { } public textFieldDidBeginEditing(textField: UITextField): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.textFieldDidBeginEditing(textField); } } public textFieldDidEndEditing(textField: UITextField) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.textFieldDidEndEditing(textField); } } public textFieldShouldClear(textField: UITextField) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.textFieldShouldClear(textField); } @@ -62,7 +57,7 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate { public textFieldShouldReturn(textField: UITextField): boolean { // Called when the user presses the return button. - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.textFieldShouldReturn(textField); } @@ -71,7 +66,7 @@ class UITextFieldDelegateImpl extends NSObject implements UITextFieldDelegate { } public textFieldShouldChangeCharactersInRangeReplacementString(textField: UITextField, range: NSRange, replacementString: string): boolean { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.textFieldShouldChangeCharactersInRangeReplacementString(textField, range, replacementString); } @@ -92,7 +87,7 @@ class UITextFieldImpl extends UITextField { } private _getTextRectForBounds(bounds: CGRect): CGRect { - const owner = this._owner ? this._owner.get() : null; + const owner = this._owner ? this._owner.deref() : null; if (!owner) { return bounds; @@ -287,28 +282,28 @@ export class TextField extends TextFieldBase { } [paddingTopProperty.getDefault](): CoreTypes.LengthType { - return zeroLength; + return CoreTypes.zeroLength; } [paddingTopProperty.setNative](value: CoreTypes.LengthType) { // Padding is realized via UITextFieldImpl.textRectForBounds method } [paddingRightProperty.getDefault](): CoreTypes.LengthType { - return zeroLength; + return CoreTypes.zeroLength; } [paddingRightProperty.setNative](value: CoreTypes.LengthType) { // Padding is realized via UITextFieldImpl.textRectForBounds method } [paddingBottomProperty.getDefault](): CoreTypes.LengthType { - return zeroLength; + return CoreTypes.zeroLength; } [paddingBottomProperty.setNative](value: CoreTypes.LengthType) { // Padding is realized via UITextFieldImpl.textRectForBounds method } [paddingLeftProperty.getDefault](): CoreTypes.LengthType { - return zeroLength; + return CoreTypes.zeroLength; } [paddingLeftProperty.setNative](value: CoreTypes.LengthType) { // Padding is realized via UITextFieldImpl.textRectForBounds method diff --git a/packages/core/ui/text-view/index.ios.ts b/packages/core/ui/text-view/index.ios.ts index 8051f3d96..ff4fc5f96 100644 --- a/packages/core/ui/text-view/index.ios.ts +++ b/packages/core/ui/text-view/index.ios.ts @@ -26,7 +26,7 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate { } public textViewShouldBeginEditing(textView: UITextView): boolean { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.textViewShouldBeginEditing(textView); } @@ -35,28 +35,28 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate { } public textViewDidBeginEditing(textView: UITextView): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.textViewDidBeginEditing(textView); } } public textViewDidEndEditing(textView: UITextView): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.textViewDidEndEditing(textView); } } public textViewDidChange(textView: UITextView): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { owner.textViewDidChange(textView); } } public textViewShouldChangeTextInRangeReplacementText(textView: UITextView, range: NSRange, replacementString: string): boolean { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.textViewShouldChangeTextInRangeReplacementText(textView, range, replacementString); } @@ -65,7 +65,7 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate { } public scrollViewDidScroll(sv: UIScrollView): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { return owner.scrollViewDidScroll(sv); } diff --git a/packages/core/ui/time-picker/index.ios.ts b/packages/core/ui/time-picker/index.ios.ts index 48eefc629..e108a832b 100644 --- a/packages/core/ui/time-picker/index.ios.ts +++ b/packages/core/ui/time-picker/index.ios.ts @@ -135,7 +135,7 @@ class UITimePickerChangeHandlerImpl extends NSObject { } public valueChanged(sender: UIDatePicker) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (!owner) { return; } diff --git a/packages/core/ui/web-view/index.ios.ts b/packages/core/ui/web-view/index.ios.ts index 4bba37c58..d3033f128 100644 --- a/packages/core/ui/web-view/index.ios.ts +++ b/packages/core/ui/web-view/index.ios.ts @@ -18,7 +18,7 @@ class WKNavigationDelegateImpl extends NSObject implements WKNavigationDelegate private _owner: WeakRef; public webViewDecidePolicyForNavigationActionDecisionHandler(webView: WKWebView, navigationAction: WKNavigationAction, decisionHandler: any): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && navigationAction.request.URL) { let navType: WebViewNavigationType = 'other'; @@ -58,7 +58,7 @@ class WKNavigationDelegateImpl extends NSObject implements WKNavigationDelegate if (Trace.isEnabled()) { Trace.write('WKNavigationDelegateClass.webViewDidFinishNavigation(' + webView.URL + ')', Trace.categories.Debug); } - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { let src = owner.src; if (webView.URL) { @@ -69,7 +69,7 @@ class WKNavigationDelegateImpl extends NSObject implements WKNavigationDelegate } public webViewDidFailNavigationWithError(webView: WKWebView, navigation: WKNavigation, error: NSError): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { let src = owner.src; if (webView.URL) { @@ -83,7 +83,7 @@ class WKNavigationDelegateImpl extends NSObject implements WKNavigationDelegate } public webViewDidFailProvisionalNavigationWithError(webView: WKWebView, navigation: WKNavigation, error: NSError): void { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner) { let src = owner.src; if (webView.URL) { @@ -128,7 +128,7 @@ class UIScrollViewDelegateImpl extends NSObject implements UIScrollViewDelegate private _owner: WeakRef; private _initCurrentValues(scrollView: UIScrollView) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner && (owner._minimumZoomScale === undefined || owner._maximumZoomScale === undefined || owner._zoomScale === undefined)) { owner._minimumZoomScale = scrollView.minimumZoomScale; owner._maximumZoomScale = scrollView.maximumZoomScale; @@ -137,7 +137,7 @@ class UIScrollViewDelegateImpl extends NSObject implements UIScrollViewDelegate } private _handleDisableZoom(scrollView: UIScrollView) { - const owner = this._owner.get(); + const owner = this._owner?.deref(); if (owner.disableZoom) { this._initCurrentValues(scrollView); scrollView.maximumZoomScale = 1.0; diff --git a/packages/core/utils/common.ts b/packages/core/utils/common.ts index 4410e6fdb..aa8a843ec 100644 --- a/packages/core/utils/common.ts +++ b/packages/core/utils/common.ts @@ -1,11 +1,9 @@ import * as types from './types'; import { dispatchToMainThread, dispatchToUIThread, isMainThread } from './mainthread-helper'; import { sanitizeModuleName } from '../ui/builder/module-name-sanitizer'; -import * as layout from './layout-helper'; import { GC } from './index'; -export { layout }; export * from './mainthread-helper'; export * from './macrotask-scheduler'; diff --git a/packages/core/utils/index.android.ts b/packages/core/utils/index.android.ts index a72b399a2..cc0714bdd 100644 --- a/packages/core/utils/index.android.ts +++ b/packages/core/utils/index.android.ts @@ -3,6 +3,7 @@ import { FileSystemAccess } from '../file-system/file-system-access'; import { Trace } from '../trace'; export { ad, dataDeserialize, dataSerialize, iOSNativeHelper } from './native-helper'; +export * from './layout-helper'; export * from './common'; export { Source } from './debug'; diff --git a/packages/core/utils/index.d.ts b/packages/core/utils/index.d.ts index 7b17bf2a4..04f8356c0 100644 --- a/packages/core/utils/index.d.ts +++ b/packages/core/utils/index.d.ts @@ -4,7 +4,9 @@ export * from './mainthread-helper'; export * from './macrotask-scheduler'; export { Source } from './debug'; +export * from './layout-helper'; export * from './native-helper'; +export * from './common'; export const RESOURCE_PREFIX: string; export const FILE_PREFIX: string; @@ -21,87 +23,6 @@ interface Owned { } //@endprivate -/** - * Utility module related to layout. - */ -export namespace layout { - /** - * Bits that provide the actual measured size. - */ - export const MEASURED_HEIGHT_STATE_SHIFT: number; - export const MEASURED_SIZE_MASK: number; - export const MEASURED_STATE_MASK: number; - export const MEASURED_STATE_TOO_SMALL: number; - export const UNSPECIFIED: number; - export const EXACTLY: number; - export const AT_MOST: number; - - /** - * Gets layout mode from a given specification as string. - * @param mode - The measure specification mode. - */ - export function getMode(mode: number): string; - - /** - * Gets measure specification mode from a given specification. - * @param spec - The measure specification. - */ - export function getMeasureSpecMode(spec: number): number; - - /** - * Gets measure specification size from a given specification. - * @param spec - The measure specification. - */ - export function getMeasureSpecSize(spec: number): number; - - /** - * Creates measure specification size from size and mode. - * @param size - The size component of measure specification. - * @param mode - The mode component of measure specification. - */ - export function makeMeasureSpec(px: number, mode: number): number; - - /** - * Gets display density for the current device. - */ - export function getDisplayDensity(): number; - - /** - * Convert device independent pixels to device pixels - dip to px. - * @param value - The pixel to convert. - */ - export function toDevicePixels(value: CoreTypes.dip): CoreTypes.px; - - /** - * Convert device pixels to device independent pixels - px to dip. - * @param value - The pixel to convert. - */ - export function toDeviceIndependentPixels(value: CoreTypes.px): CoreTypes.dip; - - /** - * Rounds value used in layout. - * @param px to round. - */ - export function round(px: CoreTypes.px): CoreTypes.px; - - /** - * Converts device pixels to device independent pixes and measure the nativeView. - * Returns the desired size of the nativeView in device pixels. - * @param nativeView the nativeView to measure (UIView or android.view.View) - * @param width the available width - * @param widthMode width mode - UNSPECIFIED, EXACTLY or AT_MOST - * @param height the available hegiht - * @param heightMode height mode - UNSPECIFIED, EXACTLY or AT_MOST - */ - export function measureNativeView(nativeView: any /* UIView or android.view.View */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number }; - - /** - * Prints user friendly version of the measureSpec. - * @param measureSpec the spec to print - */ - export function measureSpecToString(measureSpec: number): string; -} - /** * Module with android specific utilities. */ diff --git a/packages/core/utils/index.ios.ts b/packages/core/utils/index.ios.ts index f0db9e517..9fb2a07b7 100644 --- a/packages/core/utils/index.ios.ts +++ b/packages/core/utils/index.ios.ts @@ -2,6 +2,7 @@ import { iOSNativeHelper } from './native-helper'; import { Trace } from '../trace'; export { dataDeserialize, dataSerialize, iOSNativeHelper } from './native-helper'; +export * from './layout-helper'; export * from './common'; export { Source } from './debug'; diff --git a/packages/core/utils/layout-helper/index.android.ts b/packages/core/utils/layout-helper/index.android.ts index d0904d2be..920b7a123 100644 --- a/packages/core/utils/layout-helper/index.android.ts +++ b/packages/core/utils/layout-helper/index.android.ts @@ -1,49 +1,85 @@ -import { MODE_MASK } from './layout-helper-common'; +import * as layoutCommon from './layout-helper-common'; import { ad } from '../native-helper'; -export * from './layout-helper-common'; +// export * from './layout-helper-common'; let density: number; let sdkVersion: number; let useOldMeasureSpec = false; -export function makeMeasureSpec(size: number, mode: number): number { - if (sdkVersion === undefined) { - // check whether the old layout is needed - sdkVersion = ad.getApplicationContext().getApplicationInfo().targetSdkVersion; - useOldMeasureSpec = sdkVersion <= 17; +export namespace layout { + // cache the MeasureSpec constants here, to prevent extensive marshaling calls to and from Java + // TODO: While this boosts the performance it is error-prone in case Google changes these constants + export const MODE_SHIFT = 30; + export const MODE_MASK = 0x3 << MODE_SHIFT; + + export const UNSPECIFIED = 0 << MODE_SHIFT; + export const EXACTLY = 1 << MODE_SHIFT; + export const AT_MOST = 2 << MODE_SHIFT; + + export const MEASURED_HEIGHT_STATE_SHIFT = 0x00000010; /* 16 */ + export const MEASURED_STATE_TOO_SMALL = 0x01000000; + export const MEASURED_STATE_MASK = 0xff000000; + export const MEASURED_SIZE_MASK = 0x00ffffff; + + export function getMode(mode: number) { + return layoutCommon.getMode(mode); } - if (useOldMeasureSpec) { - return size + mode; + export function getMeasureSpecMode(spec: number): number { + return layoutCommon.getMeasureSpecMode(spec); } - return (size & ~MODE_MASK) | (mode & MODE_MASK); -} - -export function getDisplayDensity(): number { - if (density === undefined) { - density = ad.getResources().getDisplayMetrics().density; + export function getMeasureSpecSize(spec: number) { + return layoutCommon.getMeasureSpecSize(spec); } - return density; -} + export function makeMeasureSpec(size: number, mode: number): number { + if (sdkVersion === undefined) { + // check whether the old layout is needed + sdkVersion = ad.getApplicationContext().getApplicationInfo().targetSdkVersion; + useOldMeasureSpec = sdkVersion <= 17; + } -export function toDevicePixels(value: number): number { - return value * getDisplayDensity(); -} + if (useOldMeasureSpec) { + return size + mode; + } -export function toDeviceIndependentPixels(value: number): number { - return value / getDisplayDensity(); -} + return (size & ~layoutCommon.MODE_MASK) | (mode & layoutCommon.MODE_MASK); + } -export function measureNativeView(nativeView: any /* android.view.View */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number } { - const view = nativeView; - view.measure(makeMeasureSpec(width, widthMode), makeMeasureSpec(height, heightMode)); + export function getDisplayDensity(): number { + if (density === undefined) { + density = ad.getResources().getDisplayMetrics().density; + } - return { - width: view.getMeasuredWidth(), - height: view.getMeasuredHeight(), - }; + return density; + } + + export function toDevicePixels(value: number): number { + return value * getDisplayDensity(); + } + + export function toDeviceIndependentPixels(value: number): number { + return value / getDisplayDensity(); + } + + export function round(value: number) { + return layoutCommon.round(value); + } + + export function measureNativeView(nativeView: any /* android.view.View */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number } { + const view = nativeView; + view.measure(makeMeasureSpec(width, widthMode), makeMeasureSpec(height, heightMode)); + + return { + width: view.getMeasuredWidth(), + height: view.getMeasuredHeight(), + }; + } + + export function measureSpecToString(measureSpec: number) { + return layoutCommon.measureSpecToString(measureSpec); + } } diff --git a/packages/core/utils/layout-helper/index.d.ts b/packages/core/utils/layout-helper/index.d.ts index 5d241b496..a0cf473cd 100644 --- a/packages/core/utils/layout-helper/index.d.ts +++ b/packages/core/utils/layout-helper/index.d.ts @@ -1,77 +1,82 @@ import { CoreTypes } from '../../core-types'; /** - * Bits that provide the actual measured size. + * Utility module related to layout. */ -export const MEASURED_HEIGHT_STATE_SHIFT: number; -export const MEASURED_SIZE_MASK: number; -export const MEASURED_STATE_MASK: number; -export const MEASURED_STATE_TOO_SMALL: number; -export const UNSPECIFIED: number; -export const EXACTLY: number; -export const AT_MOST: number; +export namespace layout { + /** + * Bits that provide the actual measured size. + */ + export const MEASURED_HEIGHT_STATE_SHIFT: number; + export const MEASURED_SIZE_MASK: number; + export const MEASURED_STATE_MASK: number; + export const MEASURED_STATE_TOO_SMALL: number; + export const UNSPECIFIED: number; + export const EXACTLY: number; + export const AT_MOST: number; -/** - * Gets layout mode from a given specification as string. - * @param mode - The measure specification mode. - */ -export function getMode(mode: number): string; + /** + * Gets layout mode from a given specification as string. + * @param mode - The measure specification mode. + */ + export function getMode(mode: number): string; -/** - * Gets measure specification mode from a given specification. - * @param spec - The measure specification. - */ -export function getMeasureSpecMode(spec: number): number; + /** + * Gets measure specification mode from a given specification. + * @param spec - The measure specification. + */ + export function getMeasureSpecMode(spec: number): number; -/** - * Gets measure specification size from a given specification. - * @param spec - The measure specification. - */ -export function getMeasureSpecSize(spec: number): number; + /** + * Gets measure specification size from a given specification. + * @param spec - The measure specification. + */ + export function getMeasureSpecSize(spec: number): number; -/** - * Creates measure specification size from size and mode. - * @param size - The size component of measure specification. - * @param mode - The mode component of measure specification. - */ -export function makeMeasureSpec(px: number, mode: number): number; + /** + * Creates measure specification size from size and mode. + * @param size - The size component of measure specification. + * @param mode - The mode component of measure specification. + */ + export function makeMeasureSpec(px: number, mode: number): number; -/** - * Gets display density for the current device. - */ -export function getDisplayDensity(): number; + /** + * Gets display density for the current device. + */ + export function getDisplayDensity(): number; -/** - * Convert device independent pixels to device pixels - dip to px. - * @param value - The pixel to convert. - */ -export function toDevicePixels(value: CoreTypes.dip): CoreTypes.px; + /** + * Convert device independent pixels to device pixels - dip to px. + * @param value - The pixel to convert. + */ + export function toDevicePixels(value: CoreTypes.dip): CoreTypes.px; -/** - * Convert device pixels to device independent pixels - px to dip. - * @param value - The pixel to convert. - */ -export function toDeviceIndependentPixels(value: CoreTypes.px): CoreTypes.dip; + /** + * Convert device pixels to device independent pixels - px to dip. + * @param value - The pixel to convert. + */ + export function toDeviceIndependentPixels(value: CoreTypes.px): CoreTypes.dip; -/** - * Rounds value used in layout. - * @param px to round. - */ -export function round(px: CoreTypes.px): CoreTypes.px; + /** + * Rounds value used in layout. + * @param px to round. + */ + export function round(px: CoreTypes.px): CoreTypes.px; -/** - * Converts device pixels to device independent pixes and measure the nativeView. - * Returns the desired size of the nativeView in device pixels. - * @param nativeView the nativeView to measure (UIView or android.view.View) - * @param width the available width - * @param widthMode width mode - UNSPECIFIED, EXACTLY or AT_MOST - * @param height the available hegiht - * @param heightMode height mode - UNSPECIFIED, EXACTLY or AT_MOST - */ -export function measureNativeView(nativeView: any /* UIView or android.view.View */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number }; + /** + * Converts device pixels to device independent pixes and measure the nativeView. + * Returns the desired size of the nativeView in device pixels. + * @param nativeView the nativeView to measure (UIView or android.view.View) + * @param width the available width + * @param widthMode width mode - UNSPECIFIED, EXACTLY or AT_MOST + * @param height the available hegiht + * @param heightMode height mode - UNSPECIFIED, EXACTLY or AT_MOST + */ + export function measureNativeView(nativeView: any /* UIView or android.view.View */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number }; -/** - * Prints user friendly version of the measureSpec. - * @param measureSpec the spec to print - */ -export function measureSpecToString(measureSpec: number): string; + /** + * Prints user friendly version of the measureSpec. + * @param measureSpec the spec to print + */ + export function measureSpecToString(measureSpec: number): string; +} diff --git a/packages/core/utils/layout-helper/index.ios.ts b/packages/core/utils/layout-helper/index.ios.ts index 68e25afb0..542cc52db 100644 --- a/packages/core/utils/layout-helper/index.ios.ts +++ b/packages/core/utils/layout-helper/index.ios.ts @@ -1,32 +1,66 @@ -import { round, MODE_MASK } from './layout-helper-common'; +import * as layoutCommon from './layout-helper-common'; -export * from './layout-helper-common'; +export namespace layout { + // cache the MeasureSpec constants here, to prevent extensive marshaling calls to and from Objective C + // TODO: While this boosts the performance it is error-prone in case Google changes these constants + export const MODE_SHIFT = 30; + export const MODE_MASK = 0x3 << MODE_SHIFT; -export function makeMeasureSpec(size: number, mode: number): number { - return (Math.round(Math.max(0, size)) & ~MODE_MASK) | (mode & MODE_MASK); -} - -export function getDisplayDensity(): number { - return UIScreen.mainScreen.scale; -} - -export function toDevicePixels(value: number): number { - return value * UIScreen.mainScreen.scale; -} - -export function toDeviceIndependentPixels(value: number): number { - return value / UIScreen.mainScreen.scale; -} - -export function measureNativeView(nativeView: any /* UIView */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number } { - const view = nativeView; - const nativeSize = view.sizeThatFits({ - width: widthMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : toDeviceIndependentPixels(width), - height: heightMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : toDeviceIndependentPixels(height), - }); - - nativeSize.width = round(toDevicePixels(nativeSize.width)); - nativeSize.height = round(toDevicePixels(nativeSize.height)); - - return nativeSize; + export const UNSPECIFIED = 0 << MODE_SHIFT; + export const EXACTLY = 1 << MODE_SHIFT; + export const AT_MOST = 2 << MODE_SHIFT; + + export const MEASURED_HEIGHT_STATE_SHIFT = 0x00000010; /* 16 */ + export const MEASURED_STATE_TOO_SMALL = 0x01000000; + export const MEASURED_STATE_MASK = 0xff000000; + export const MEASURED_SIZE_MASK = 0x00ffffff; + + export function getMode(mode: number) { + return layoutCommon.getMode(mode); + } + + export function getMeasureSpecMode(spec: number): number { + return layoutCommon.getMeasureSpecMode(spec); + } + + export function getMeasureSpecSize(spec: number) { + return layoutCommon.getMeasureSpecSize(spec); + } + + export function makeMeasureSpec(size: number, mode: number): number { + return (Math.round(Math.max(0, size)) & ~layoutCommon.MODE_MASK) | (mode & layoutCommon.MODE_MASK); + } + + export function getDisplayDensity(): number { + return UIScreen.mainScreen.scale; + } + + export function toDevicePixels(value: number): number { + return value * UIScreen.mainScreen.scale; + } + + export function toDeviceIndependentPixels(value: number): number { + return value / UIScreen.mainScreen.scale; + } + + export function round(value: number) { + return layoutCommon.round(value); + } + + export function measureNativeView(nativeView: any /* UIView */, width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number } { + const view = nativeView; + const nativeSize = view.sizeThatFits({ + width: widthMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : toDeviceIndependentPixels(width), + height: heightMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : toDeviceIndependentPixels(height), + }); + + nativeSize.width = round(toDevicePixels(nativeSize.width)); + nativeSize.height = round(toDevicePixels(nativeSize.height)); + + return nativeSize; + } + + export function measureSpecToString(measureSpec: number) { + return layoutCommon.measureSpecToString(measureSpec); + } } diff --git a/packages/core/xml/index.spec.ts b/packages/core/xml/index.spec.ts new file mode 100644 index 000000000..954ad1736 --- /dev/null +++ b/packages/core/xml/index.spec.ts @@ -0,0 +1,131 @@ +import { XmlParser, ParserEventType } from '.'; + +describe('XmlParser', () => { + // Flavors: + describe('Vanilla', () => { + let last_element = null; + let last_attrs = null; + let last_data = null; + let parser = null; + beforeEach(() => { + parser = new XmlParser(function (event) { + switch (event.eventType) { + case ParserEventType.StartElement: + last_element = event.elementName; + last_attrs = event.attributes; + break; + case ParserEventType.Text: + last_data = event.data; + break; + } + }); + }); + + it('handles whitespace around attribute =', () => { + parser.parse(""); + + expect(last_element).toBe('TextField'); + expect(last_attrs['text']).toBe('hello'); + }); + + it('resolves entities', () => { + parser.parse('<>"&''); + expect(last_data).toBe('<>"&\''); + }); + + it('resolves greek letter entities in attributes', () => { + parser.parse("blah"); + expect(last_attrs.text).toBe('Ω'); + }); + + it('resolves entities in element text', () => { + parser.parse('Ω'); + expect(last_data).toBe('Ω'); + }); + + it('resolves <> inside quotes', () => { + parser.parse('\' blah="b"/>'); + expect(last_attrs.name).toBe('<&>'); + expect(last_attrs.blah).toBe('b'); + }); + }); + + describe('Angular', () => { + let last_element = null; + let last_attrs = null; + let parser = null; + + beforeEach(() => { + parser = new XmlParser(function (event) { + switch (event.eventType) { + case ParserEventType.StartElement: + last_element = event.elementName; + last_attrs = event.attributes; + break; + } + }); + parser.angularSyntax = true; + }); + + it('parses [property] binding', () => { + parser.parse(""); + + expect(last_element).toBe('TextField'); + expect(last_attrs['[text]']).toBe('somevar'); + }); + + it('parses (event) binding', () => { + parser.parse(""); + + expect(last_element).toBe('TextField'); + expect(last_attrs['(tap)']).toBe('onTap(blah)'); + }); + + it('parses (^event) binding', () => { + parser.parse(""); + + expect(last_element).toBe('TextField'); + expect(last_attrs['(^tap)']).toBe('onTap(blah)'); + }); + + it('parses #id attribute', () => { + parser.parse(''); + + expect(last_element).toBe('TextField'); + expect(last_attrs['#firstName']).toBe(''); + }); + + it('parses #id attribute followed by another', () => { + parser.parse(""); + + expect(last_element).toBe('TextField'); + expect(last_attrs['#firstName']).toBe(''); + expect(last_attrs['text']).toBe('Name'); + }); + + it('detects equals without value', () => { + parser.parse(''); + + expect(last_attrs).toBeFalsy(); + }); + + it('detects no equals with quoted value', () => { + parser.parse(""); + + expect(last_attrs).toBeFalsy(); + }); + + it('detects unclosed tag after no value attribute', () => { + parser.parse(' { + parser.angularSyntax = false; + parser.parse(""); + + expect(last_attrs).toBeFalsy(); + }); + }); +}); diff --git a/packages/ui-mobile-base/.travis.yml b/packages/ui-mobile-base/.travis.yml deleted file mode 100644 index 31cd533a3..000000000 --- a/packages/ui-mobile-base/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -env: - global: - - DATE=$(date +%Y-%m-%d) - - PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER -language: objective-c -osx_image: xcode8.3 -install: - - brew update - - brew cask install android-sdk - # Suppress output of sdkmanager to keep log under the 4MB limit of travis-ci - - yes | sdkmanager "platforms;android-23" >/dev/null - - yes | sdkmanager "build-tools;23.0.3" >/dev/null - - yes | sdkmanager "extras;android;m2repository" >/dev/null -before_script: - - export ANDROID_HOME=/usr/local/share/android-sdk -script: ./build.sh $PACKAGE_VERSION diff --git a/packages/ui-mobile-base/README.md b/packages/ui-mobile-base/README.md index beb40cfb1..6cb5f6733 100644 --- a/packages/ui-mobile-base/README.md +++ b/packages/ui-mobile-base/README.md @@ -1,5 +1,4 @@ # NativeScript Core Modules Widgets -[![Build Status](https://travis-ci.org/NativeScript/NativeScript.svg?branch=master)](https://travis-ci.org/NativeScript/NativeScript) This library represents native code (Java and Objective-C) used by the NativeScript [`core modules`](https://github.com/NativeScript/NativeScript/tree/master/tns-core-modules-widgets). diff --git a/tools/notes/CONTRIBUTING.md b/tools/notes/CONTRIBUTING.md index 8339f34b4..5836b39ca 100644 --- a/tools/notes/CONTRIBUTING.md +++ b/tools/notes/CONTRIBUTING.md @@ -143,7 +143,7 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow Must be one of the following: * **build**: Changes that affect the build system or external dependencies (example scopes: npm) -* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Jenkins) +* **ci**: Changes to our CI configuration files and scripts * **docs**: Documentation only changes * **feat**: A new feature * **fix**: A bug fix diff --git a/tools/notes/DevelopmentWorkflow.md b/tools/notes/DevelopmentWorkflow.md index 17d449523..4bafcb872 100644 --- a/tools/notes/DevelopmentWorkflow.md +++ b/tools/notes/DevelopmentWorkflow.md @@ -1,141 +1,87 @@ Development Workflow ==================== -## Project Structure +```bash +# Setup local dependencies and repo for work +npm run setup -The repository contains several packages and apps: - - `nativescript-core` - The core NativeScript TypeScript modules used to develop NativeScript apps. Produces `@nativescript/core` npm package - - `tns-core-modules-package` - Base for generating the `tns-core-modules` package (compatibility package for projects that still import code from `tns-core-modules`). - - `tns-core-modules-widgets` - The native widgets (Java and Objective-C) used by the core NativeScript modules. Produces `tns-core-modules-widgets` npm package - - `tns-platform-declarations` - TypeScript definitions for Android and iOS native APIs. Produces `tns-platform-declarations` npm package - - `tests` - Unit tests app for the `@nativescript/core` package. These test are executed as nativescript application on mobile device or emulator. - - `unit-test` - Node unit tests. These test validate parts of the framework that do not require the nativescript runtime and so can be executed in node environment - - `e2e` - applications and *e2e* tests - - `e2e/ui-tests-app` - UI app used for manual testing and automation - - `apps` - legacy apps for testing - - `build` - scripts used for building and infrastructure - - `dist` - construction site for packing npm modules +# See what commands you can run +npm start +``` -Working with the repo is organized with npm scripts, -go and read through the `scripts` section in the [package.json](./package.json). - -Managing dependencies: - - `tns-core-modules-widgets` depends on: - - no deps - - `@nativescript/core` depends on: - - `tns-core-modules-widgets` - - (devDep)`tns-platform-declarations` - - `tns-core-modules` depends on: - - `@nativescript/core` - - (devDep)`tns-platform-declarations` +To simplify workspace development and maintenance we provide an interactive menu via `npm start` which lists all the commands you can run. You can type to filter the list and hit ENTER to run. Each command invokes a [Nx](https://nx.dev) workspace command which you can even copy/paste to run directly if you don't want to use the interactive menu any longer. ## Initial Setup Clone (or fork/clone) the repo and run setup script: -``` bash +```bash git clone https://github.com/NativeScript/NativeScript.git cd NativeScript npm run setup ``` -## Running Unit Tests Application -After the [initial setup](#initial-setup) you can run the tests with: +## Unit Testing -``` bash -cd tests -tns run android | ios +### Run unit tests with jest with either option: + +A. Using convenient start menu: + +```bash +npm start +> (Type) "core.test" (...to isolate the menu to "@nativescript.core.test"), hit ENTER +``` + +B. Using direct Nx command: + +```bash +npx nx run core:test +``` + +### Watch mode + +To enable live watch mode you can add the `--watch` flag, for example: + +```bash +npx nx run core:test --watch +``` + +### Isolate tests by name + +Run a single test by it's decribe name, for example to run just the `xml/index.spec.ts`, the describe block is named `XmlParser` therefore: + +``` +npx nx run core:test --watch -t 'XmlParser' ``` -You can do changes in the test app and `nativescript-core` and rely on HMR to re-run tests. ## Running the `e2e` Test Apps There are a couple of application used for development and testing. -The `ui-test-app` is the more frequently used for development and validation. It is an ordinary NativeScript app that logs the test results on the go. +* `apps/automated` Automated e2e tests +* `apps/toolbox` Used for local development experimentation and confirming cases. More simplistic, use this one most often. +* `apps/ui` Also used for local development experimentation and confirming cases. More sophisticated setup. -After the [initial setup](#initial-setup) run the e2e apps with: +Run automated e2e test suite with: -``` bash -cd e2e/ +```bash +npx nx run apps-automated:ios -# Run the Android app -tns platform add android@next -tns run android +// or... -# Run the iOS app -tns platform add ios@next -tns run ios +npx nx run apps-automated:android ``` ->Note: NOTE: do not commit changes in the runtime versions to `e2e//package.json` - ---- - -## Running Another App - -### TypeScript Applications -Link both the `nativescript-core` folders and the generated compatibility package (`dist\tns-core-modules`): -``` bash -npm i /nativescript-core --save -npm i /dist/tns-core-modules --save -``` - -You can do changes in the app code and `nativescript-core` and rely on HMR to refresh the app. - -### JavaScript Applications -Use the same steps as with TS application. However, the configuration of JS application does not include loading and transpiling TS code. You need to transpile the TS code in `nativescript-core` yourself. The following npm script will run tsc in watch mode in `nativescript-core` (run it in a separate terminal so that you can do `tns run` in parallel): - -``` bash -npm run tsc-core-watch -``` - -### Angular Applications -Linking `tns-core-modules` and `@nativescript/core` in **Angular applications** does not work at the moment. Check [#7905](https://github.com/NativeScript/NativeScript/issues/7905) for more details on the issue. - - -## Building `tns-core-modules-widgets` -You can the following npm script to build and link the `tns-core-modules-widgets` package. -``` bash -npm run setup-widgets -``` - -This script will build the `tns-core-modules-widgets` package and link it inside the `nativescript-core` so it will be used for running the tests and e2e apps. - ->Note: NOTE: do not commit changes in the `tns-core-modules-widgets` dependency in the `nativescript-core/package.json` - -## Running Node Unit Tests -Run node unit tests with: -``` -npm run unit-test -``` -or run tests in watch mode: - -``` -npm run unit-test-watch -``` - -## Platform declarations -To update the platform declarations (the ios.d.ts-es) you can run: - -``` -npm install -npm run dev-declarations -``` - -This script will update the iOS declarations. Android tools are not integrated yet. -The declarations are generated from the test app and will include the native code from tns-core-modules-widgets. - # Documentation API reference The following will build the API reference pages in `bin/dist/apiref`: -``` +```bash npm run typedoc ``` If you want to improve on the documentation you can also build and start up dev web server: -``` +```bash npm run dev-typedoc ``` diff --git a/packages/core/__tests__/css/assets/core.light.css b/tools/testing/assets/core.light.css similarity index 100% rename from packages/core/__tests__/css/assets/core.light.css rename to tools/testing/assets/core.light.css diff --git a/packages/core/__tests__/css/assets/what-is-new.ios.css b/tools/testing/assets/what-is-new.ios.css similarity index 100% rename from packages/core/__tests__/css/assets/what-is-new.ios.css rename to tools/testing/assets/what-is-new.ios.css diff --git a/packages/core/__tests__/css/out/.gitignore b/tools/testing/out/.gitignore similarity index 100% rename from packages/core/__tests__/css/out/.gitignore rename to tools/testing/out/.gitignore diff --git a/packages/core/__tests__/css/out/README.md b/tools/testing/out/README.md similarity index 100% rename from packages/core/__tests__/css/out/README.md rename to tools/testing/out/README.md diff --git a/tools/workspace-scripts.js b/tools/workspace-scripts.js index bae0e8082..45f12e1bc 100644 --- a/tools/workspace-scripts.js +++ b/tools/workspace-scripts.js @@ -89,12 +89,8 @@ module.exports = { description: '@nativescript/core: Build' }, test: { - script: 'nx run core:unit', - description: '@nativescript/core: Unit tests', - watch: { - script: 'nx run core:unit.watch', - description: '@nativescript/core: Unit tests with watcher' - }, + script: 'nx run core:test', + description: '@nativescript/core: Unit tests' }, }, // @nativescript/core API Reference Docs diff --git a/tsconfig.base.json b/tsconfig.base.json index b3dfa14cd..6b56c6768 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2,7 +2,7 @@ "compileOnSave": false, "compilerOptions": { "rootDir": ".", - "target": "ES2017", + "target": "ES2020", "module": "esnext", "sourceMap": true, "declaration": true, @@ -14,7 +14,7 @@ "diagnostics": true, "skipLibCheck": true, "skipDefaultLibCheck": true, - "lib": ["es2017", "dom"], + "lib": ["ESNext", "dom"], "types": ["node", "jest"], "baseUrl": ".", "paths": {