54 Commits

Author SHA1 Message Date
50eb372929 fix(css): parse css selectors with escape sequences (for real) (#8496)
* fix(css): CSS escape sequences

* Missing semicolon

Co-authored-by: Vasil Trifonov <v.trifonov@gmail.com>
2020-04-03 19:43:52 +03:00
49a7607f4e feat(css): Added optional css-tree parser (#8076)
* feat(css): Added optional css-tree parser

* test: css-tree parser compat tests

* test: more css-tree compat tests
2019-12-05 10:23:32 +02:00
7b78f3b0c6 feat: System css classes for modals (#8155)
* feat: update modal views CSS classes

* chore: fix failing test
2019-12-03 11:08:33 +02:00
fc2a233e95 fix: nested css-calc and css-variables with fallback (#7987) 2019-11-07 17:30:03 +02:00
cc97a16800 feat: Scoped Packages (#7911)
* chore: move tns-core-modules to nativescript-core

* chore: preparing compat generate script

* chore: add missing definitions

* chore: no need for http-request to be private

* chore: packages chore

* test: generate tests for tns-core-modules

* chore: add anroid module for consistency

* chore: add .npmignore

* chore: added privateModulesWhitelist

* chore(webpack): added bundle-entry-points

* chore: scripts

* chore: tests changed to use @ns/core

* test: add scoped-packages test project

* test: fix types

* test: update test project

* chore: build scripts

* chore: update build script

* chore: npm scripts cleanup

* chore: make the compat pgk work with old wp config

* test: generate diff friendly tests

* chore: create barrel exports

* chore: move files after rebase

* chore: typedoc config

* chore: compat mode

* chore: review of barrels

* chore: remove tns-core-modules import after rebase

* chore: dev workflow setup

* chore: update developer-workflow

* docs: experiment with API extractor

* chore: api-extractor and barrel exports

* chore: api-extractor configs

* chore: generate d.ts rollup with api-extractor

* refactor: move methods inside Frame

* chore: fic tests to use Frame static methods

* refactor: create Builder class

* refactor: use Builder class in tests

* refactor: include Style in ui barrel

* chore: separate compat build script

* chore: fix tslint errors

* chore: update NATIVESCRIPT_CORE_ARGS

* chore: fix compat pack

* chore: fix ui-test-app build with linked modules

* chore: Application, ApplicationSettings, Connectivity and Http

* chore: export Trace, Profiling and Utils

* refactor: Static create methods for ImageSource

* chore: fix deprecated usages of ImageSource

* chore: move Span and FormattedString to ui

* chore: add events-args and ImageSource to index files

* chore: check for CLI >= 6.2 when building for IOS

* chore: update travis build

* chore: copy Pod file to compat package

* chore: update error msg ui-tests-app

* refactor: Apply suggestions from code review

Co-Authored-By: Martin Yankov <m.i.yankov@gmail.com>

* chore: typings and refs

* chore: add missing d.ts files for public API

* chore: adress code review FB

* chore: update api-report

* chore: dev-workflow for other apps

* chore: api update

* chore: update api-report
2019-10-17 00:45:33 +03:00
6c7139477e fix: UIUserInterfaceStyle is undefined for iOS <= 11 (#7931) 2019-10-16 16:41:47 +03:00
dfcbe6c319 style: formatting and whitespaces (#7840) 2019-09-19 15:40:31 +03:00
e0c4933337 chore: merge release to master (#7809)
* feat(android): fix tab resource icon size based on spec (#7737)

* feat(ios): add icon rendering mode for bottom navigation (#7738)

* fix(ios-tabs): crash when add tabstrip in loaded event (#7743)

* fix(css): parse css selectors with escape sequences (#7689) (#7732)

* fix(ios-tabs): handle nesting proxy view container (#7755)

* fix-next(css): className to preserve root views classes (#7725)

* docs: cut the 6.1.0 release (#7773)

* fix(android-list-picker): NoSuchFieldException on api29 (#7790)

* chore: hardcode tslib version to 1.10.0 (#7776)

* fix(css-calc): reduce_css_calc_1.default is not a function (#7787) (#7801)
2019-09-12 14:33:03 +03:00
552021373e fix(css): parse css selectors with escape sequences (#7689) 2019-08-26 13:59:03 +03:00
673c8087e0 feat: implement css-variables and css-calc (#7553)
* feat: implement basic support for css-variables

* fix(test): test-watch-android and test-watch-ios was broken

* fix: processing css-variables belong in CssProperty-classes

Not in the StyleScope.

* fix(css-variables): set style attribute override value from css-classes

* feat: add css calc-support using 'reduce-css-calc'

* fix(tslint): missing semicolon and incorrect quotemark

* feat: move css-variable handling to Style-class

* chor: add comments explaining css-variable implmentation

* chor: set css-variables before other style properties

* chor(css-variables): cleaning up

* chor: code style fixes

* test(CSS-CALC): Add tests for nested css-calc statements

* fix(CSS-CALC): dip-unit not supported by reduce-css-calc

* fix(tslint): use double quotemarks

* test(css-calc): test _cssCalcConverter directly

* chor(css-variables): rename and clean up _cssVariableConverter to _evaluateCssVariable

* chor: rename varname to varName for consistency

* chor: support css-calc and variables for normal properties

* chor: use string.replace to evaluate css-variables

* fix: Missing blank line before return

* chor: rename css-calc functions

* fix: undefined css-variables treated as 'unset'

* fix(tslint): use double quotemarks

* feat(css-variable): handle fallback values

* chor(css-variables): handle unsetValue

* chor: process css-calc and css-variables in style-scope

* chore: clean-up css-calc/variable expressions

* fix(css-calc): handle invalid expressions

* chore(CSSState): update comments

* chore(Style): rename css-variable functions

* chore(css-variables): describe fallback logic

* chore: move reset scoped css-variables to Style-class

* chore(CssState): simplify check for css expressions

* chore: add reduce-css-calc to /package.json
2019-08-20 00:56:56 +03:00
3adba6826b feat: add CSS classes to app/modal root views to target platform/device/orientation/type (#7606) 2019-08-19 14:09:44 +03:00
4f39fb728b chore: update tslint rules (#7391) 2019-06-26 15:13:48 +03:00
ecd9fc3e9d feat: bundle workflow support (#7337) 2019-06-20 15:58:36 +03:00
a84b6301ed chore: fix tslint errors 2019-05-07 15:58:16 +03:00
66d631ebca Revert "Revert "feat(animation): support animating width/height properties (WIP) (#4917)" (#5136)"
This reverts commit 8973a6febde4a4b41637d80b17506a7d25ffebf8.
2019-05-07 13:58:07 +03:00
44b8acd79c feat(HMR): apply changes in page styles at runtime when app root is a frame (#6857)
* feat(HMR): apply changes in page styles at runtime

* fix: livesync tests

* test: changeCssFile method

* refactor: address comments

Add a comment.
Update `let` to `const`.
Update `changesCssFile` test.

* test: add an assert
2019-02-14 14:03:13 +02:00
982acdc168 feat(iOS): Safe Area Support (#6230) 2018-09-28 18:21:50 +03:00
85b8c018a5 feat(styling): Added 2 functions to control applicationAdditionalSelectors (#6124)
* Added getAdditionalSelectors function so that nativescript-theme can be functional again in NS 4.x

* Change to a better more extensible additional css system.

* removed redunant function on the name.

* Fix lint issues

* Adding mergeSelectors to the remove function

* Added test of new add/remove css functions.

* fix: revert testRunner.ts changes that disabled all tests except style

* refactor: fix typo

* chore: fix typo and change test to no not affect global styles
2018-08-02 11:51:07 +03:00
6ce1d22d9a feat(CSS): import of relative paths (#6023)
* feat(CSS): import of relative paths

* refactor: address comments
2018-07-21 05:54:32 +03:00
03cfc0cee3 chore(tslint): update tslint rules and fix errors (#5747)
* chore(tslint): fix tslint config & errors
* chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
2018-04-26 18:36:32 +03:00
ac04ede97e Implemented showModal on View 2017-12-15 13:08:15 +02:00
8973a6febd Revert "feat(animation): support animating width/height properties (WIP) (#4917)" (#5136)
This reverts commit 57ed0cf405be44e31358ff17f372b5d926e63639.
2017-12-07 12:11:24 +02:00
57ed0cf405 feat(animation): support animating width/height properties (WIP) (#4917)
* feat(animation): support animating width/height properties

 - width/height can be specified in any valid PercentLength form that can be parsed.
 - make width/height properties be based on animatable CSS property. TODO: affectsLayout????
 - add a few basic tests. Could probably use a few more?
 - fix a few null pointer exceptions in PercentLength helpers

* test(ui): add animation examples to ui-tests-app

 - basic height animation
 - height animation in StackLayout
 - fix an issue where strings were not automatically converted to PercentLength when calling directly into `View.animate`

* test(ui): cleanup and add summary/details layout example

 - use height transition to cover textview content.
 - when clicking on the summary view, animate the summary height up to a small header and show the text view.
 - fake animating the height on the textview by very subtly animating its translateY value while shrinking the header height. This tricks your mind into think that the text view is also vertically growing, even thought it's just slightly moving up along the Y axis.

* test(ui): add animation curves test page

 - verify all built-in animation curve types work as expected.

* test(ui): update animation curve example for multiple properties

 - add a segmented bar that allows choosing which properties to animate using the various curves.
 - interestingly, a whole bunch of properties fail with spring on iOS.
 - refactor width/height animations handlers to remove duplication on iOS.
 - implement proper spring animation for width/height on iOS.

* test(ui): add stress example with 100 labels animating and fps meter

 - same curve/property selector as the curves example, but with 10x10 grid of items that stagger animate, and an FPS meter.
 - sadly it looks like width/height animations are considerably slower than the others when you have a bunch of them. I'm not sure that's entirely surprising since they interact with the layout system.
 - the better news is that even with the army example, my really old android 4 tablet manages ~30fps. On height/width animations from the curves example, the old tablet does fine with no noticeable FPS hit.

* refactor: deduplicate existing droid width/height animations

 - stash to prep for replacing with LayoutTransition.

* test(animation): unit tests for extent animation and PercentLength parse

 - update animation scaffold to allow specifying the parent stack layout height/width
 - test basic supported units, px, %
 - test basic percent length parser behaviors

* chore: cleanup cruft and remove noise from diff

 - undo the import mangling that WebStorm helpfully applied
 - remove .editorconfig file
 - clean up in tests, remove cruft

* chore: cleanup from review

 - more import changes

* chore: remove .editorconfig
2017-12-05 13:55:54 +02:00
f7a3a36b9c Housekeeping node tests, renamed to unit-tests (#4936)
Add parsers for the background css shorthand property, make ViewBase unit testable in node environment

Add background parser and linear-gradient parser

Use sticky regexes

Simplify some types, introduce generic Parsed<T> instead of & TokenRange

Apply each parser to return a { start, end, value } object

Move the css selector parser to the css/parser and unify types

Add the first steps toward building homegrown css parser

Add somewhat standards compliant tokenizer, add baseline, rework and shady css parsers

Enable all tests again, skip flaky perf test

Improve css parser tokenizer by converting some char token types to simple string

Implement 'parse a stylesheet'

Add gonzales css-parser

Add parseLib and css-tree perf

Add a thin parser layer that will convert CSS3 tokens to values, for now output is compatible with rework

Make root tsc green

Return the requires of tns-core-modules to use relative paths for webpack to work

Implement support for '@import 'url-string';

Fix function parser, function-token is no-longer neglected

Make the style-scope be able to load from "css" and "css-ast" modules

Add a loadAppCss event so theme can be added to snapshot separately from loaded
2017-10-20 10:42:07 +03:00
6d7c1ff295 Avoid applying CSS multiple times (#4784)
* Move the applyStyleFromScope to onLoaded, when the views are created and id or className properties are set the CSS selectors are queried and applied multiple times

* Condense the changes when applying properties
2017-09-25 18:32:00 +03:00
43659799bc Implement non uniform border corner radiuses and fix blinking image-view radiuses (#4573)
* Image corners were blinking in #4322 and CSS border will now draw non uniform corner radiuses if the border color is uniform

* Implement per-side corner radiuses for iOS

* Update stretch-mode example

* Update matrix-mode example

* Update image resources

* Add clipping for non uniform radii without border width, don't throw for missing image resources in css
2017-07-27 15:36:47 +03:00
014e7a8e0f add profile for functions, profile CSS-es on startup, use __time (#4227)
Call native setters once when a page is instantiated.

Fix background not being reset, Label's background is now set to background, not layer

Make the nativeView field instead of property for performance reasons
2017-06-08 09:51:09 +03:00
af38cf5f3e Create css combnators tests page in apps
Setup direct siblings apps tests

Fix direct child test

Add direct sibling test on class and type element

Add sibling combinator handling for id selectors

Completely redo sibling selector and add attributes and pseudo class selectors tests

Handle sibling via a custom group instead of a selector

Fix Selector groups creation

Add unit test for sibling selection

Fix tslint errors
2017-05-09 11:29:11 +03:00
e26032f5fe Revert the translateX/Y to be in dip 2017-04-25 14:49:12 +03:00
f350f7191d textTransform, whiteSpace & textAlignment defaultValue is now “initia” (#3948)
removed enum namespaces
add valueConverter to clipToBounds
2017-04-06 09:50:37 +03:00
5f14fc6a23 text-decoration won’t be applied to edit-text (#3932)
* text-decoration won’t be applied to edit-text

* stop printing slow tests

* remove console line

* fix failing tests

* fix wrong checks
2017-04-04 13:50:34 +03:00
a64bba62aa whiteSpace default value change to undefined (#3782)
TKUnit default message change to empty string
isSet method is now instance method of Property classes
fix detaching from parent bindingContext - were using oldParent.parent instead of parent
editable-text-base.android - onTextChanged implementation commented. Does nothing.
frame - onCreateView wrapped in try/catch and shows label with exception message if any
text-base.android - should support reset of nativeView. TransformationMethod won’t be set if TextField is secure
Change some types to their string couterparts
TextField.android won’t support multilines anymore in order to work as iOS
In android when page is removed from native backstack we won’t call tearDownUI again a second time
2017-03-14 10:26:45 +02:00
629eb6e683 Use relative imports in tns-core-modules.
Use tns-core-modules/* imports in outside code (apps, tests, etc)
2017-03-13 14:37:59 +02:00
01edf37d33 value-source-tests will now use unsetValue instead of undefined when resetting local value 2017-01-17 16:56:56 +02:00
e983295952 Style tests fixes 2017-01-12 14:24:12 +02:00
14e1da5820 Style-properties tests 2017-01-09 17:24:38 +02:00
7931ecd4f8 Fix tslint errors 2016-12-21 17:42:31 +02:00
d10ca1da03 Fix the last several errors 2016-12-20 13:36:10 +02:00
e90e2de927 Revert tests for Length where NaN or number was used 2016-12-19 15:53:44 +02:00
6feeb140e3 Fixing type errors in tests 2016-12-19 10:36:25 +02:00
39113f6fdd Fix: Invalid value 500 for property fontWeight in XML
Resolves #3175
2016-11-28 16:42:44 +02:00
414ebc67dd feat(style-scope): Resolve css sheets from tns_modules
If the css sheet is not in the app directory, try to find it in the
tns_modules folder.
2016-11-08 11:28:16 +02:00
98deeccb21 Change image.android to use the new image.Cache class from widgets. (#2832)
* Change image.android to use the new image.Cahce class from widgets.

* fix npm scripts

* npm tsc will compile all so no need for npm run dev-tsc-tests

* fix tslint error

* image-tests use memory only cache.

* fix exception in image.android

* Change image-tests so that Image won't be GC immediately.

* Change cacheMode to enum
2016-10-05 13:09:08 +03:00
08f9c941cc Fix: CSS border-color does not recognize rgb and rgba values
Resolves #2781
2016-09-21 16:35:03 +03:00
a05f842a84 Non-uniform borders 2016-09-17 09:27:36 +03:00
1236f66f44 Add npm script that generates ios .d.ts-es from the tests app
Less than 30 erros left, let's hope it still works

Added lib.*.d.ts from typescript, removed lib and dom stuff, added by hand XHR, alert etc. .d.ts-es for polyfills

Roll back some changes involved in separating UIEvent for dom and ios

Test combined dts-es will now use lib, while internally we will not to avoid UIEvent conflict with dom stuff
2016-08-29 09:58:17 +03:00
c1aeeb51a7 Inital by-type split
Split type.class from CssTypeSelector to CssCompositeSelector, probably support type#id.class selectors

Apply review comments, refactor css-selectors internally

Applied refactoring, all tests pass, button does not notify changes

Add tests for the css selectors parser.

Added tests for css-selectors

Added basic implementation of mayMatch and changeMap for css match state

Implemented TKUnit.assertDeepEqual to check key and key/values in Map and Set

Watch for property and pseudoClass changes

Add one child group test

Add typings for animations

Added mechanism to enable/disable listeners for pseudo classes

Count listeners instead of checking handlers, reverse subscription and unsubscription
2016-07-18 17:24:09 +03:00
8d40782191 Style perf improvements (#2342)
* Add css-perf app.

* Style properties now check only properties that are set.
Image utils module required on top (instead of in onMeasure) to improve performance.
Remove try/catch block when Style applies native property.

* fix tslint

* Fix broken merge
Update package.json version

* Failed miserably - if the try/catch around applyProperty method is removed - TextField fails big time.
TextField needs some good refactoring as well as calls to _updateTextDecoration & _updateTextTransform
utils - setTextTransform & setTextDecoration should be split, typing support should be added.
2016-07-08 14:39:43 +03:00
846bafc660 Change snippet syntax to the new Jekyll tag. 2016-07-06 16:09:11 +03:00
4147e47948 Make cookbook articles appear in nativescript env only. 2016-06-20 14:32:12 +03:00