diff --git a/.gitignore b/.gitignore index c74b670..f2ad902 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,25 @@ -.idea/ -.vscode/ -demo/lib/ -demo/platforms/ -demo/node_modules/ -npm-debug.log +.vscode +.idea +.DS_Store +*.esm.json +*.js +*.js.map +*.log +src/*.d.ts +!src/index.d.ts +!src/references.d.ts +!src/scripts/*.js +!seed-tests/*.js +seed-tests/seed-copy/**/*.* +seed-tests/seed-copy-new-git-repo/**/*.* +!demo/karma.conf.js +!demo/app/tests/*.js +demo/*.d.ts +!demo/references.d.ts +demo/lib +demo/platforms +node_modules +publish/src +publish/package +demo/report/report.html +demo/report/stats.json diff --git a/.npmignore b/.npmignore deleted file mode 100644 index f81441c..0000000 --- a/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea/ -.vscode/ -demo/ -screenshots/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b0f74f6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,74 @@ +matrix: + include: + - stage: "Lint" + language: node_js + os: linux + node_js: "8" + script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint + - stage: "WebPack, Build and Test" + os: osx + env: + - WebPack="iOS" + osx_image: xcode9.2 + language: node_js + node_js: "8" + jdk: oraclejdk8 + script: cd demo && npm run build.plugin && npm i && tns build ios --bundle --env.uglify + - language: android + os: linux + env: + - WebPack="Android" + jdk: oraclejdk8 + before_install: nvm install 8 + script: cd demo && npm run build.plugin && npm i && tns build android --bundle --env.uglify --env.snapshot + - language: android + env: + - BuildAndroid="26" + os: linux + jdk: oraclejdk8 + before_install: nvm install stable + script: + - cd src && npm i && npm run tsc && cd ../demo && tns build android + - os: osx + env: + - BuildiOS="11" + - Xcode="9.2" + osx_image: xcode9.2 + language: node_js + node_js: "8" + jdk: oraclejdk8 + script: + - cd src && npm i && npm run tsc && cd ../demo && tns build ios + - os: linux + language: android + dist: precise + sudo: required + jdk: oraclejdk8 + before_script: + - echo no | android create avd --force -n test -t android-21 -b armeabi-v7a + - emulator -avd test -no-audio -no-window & + - android-wait-for-emulator + before_install: + - nvm install 8 + script: cd src && npm run test.android + - os: osx + language: node_js + node_js: "8" + jdk: oraclejdk8 + osx_image: xcode9.2 + script: cd src && npm run test.ios + +android: + components: + - tools + - platform-tools + - build-tools-26.0.1 + - android-26 + - android-23 + - extra-android-m2repository + - sys-img-armeabi-v7a-android-21 + +install: + - echo no | npm install -g nativescript + - tns usage-reporting disable + - tns error-reporting disable \ No newline at end of file diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 index 23b1a30..1a7aaf0 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 TJ VanToll +Copyright (c) 2018 TJ VanToll Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/demo/app/App_Resources/Android/app.gradle b/demo/app/App_Resources/Android/app.gradle new file mode 100644 index 0000000..c9d40ec --- /dev/null +++ b/demo/app/App_Resources/Android/app.gradle @@ -0,0 +1,16 @@ +// Add your native dependencies here: + +// Uncomment to add recyclerview-v7 dependency +//dependencies { +// compile 'com.android.support:recyclerview-v7:+' +//} + +android { + defaultConfig { + generatedDensities = [] + applicationId = "org.nativescript.demo" + } + aaptOptions { + additionalParameters "--no-version-vectors" + } +} diff --git a/demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png b/demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png deleted file mode 100644 index bd53be2..0000000 Binary files a/demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png and /dev/null differ diff --git a/demo/app/App_Resources/Android/AndroidManifest.xml b/demo/app/App_Resources/Android/src/main/AndroidManifest.xml similarity index 86% rename from demo/app/App_Resources/Android/AndroidManifest.xml rename to demo/app/App_Resources/Android/src/main/AndroidManifest.xml index 8d827dc..9db8321 100644 --- a/demo/app/App_Resources/Android/AndroidManifest.xml +++ b/demo/app/App_Resources/Android/src/main/AndroidManifest.xml @@ -23,15 +23,18 @@ android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:theme="@style/AppTheme"> + + android:configChanges="keyboardHidden|orientation|screenSize" + android:theme="@style/LaunchScreenTheme"> - - + + + diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png b/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png new file mode 100644 index 0000000..eb381c2 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png differ diff --git a/demo/app/App_Resources/Android/drawable-hdpi/icon.png b/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/Android/drawable-hdpi/icon.png rename to demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png b/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png new file mode 100644 index 0000000..5218f4c Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png b/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png new file mode 100644 index 0000000..748b2ad Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png differ diff --git a/demo/app/App_Resources/Android/drawable-ldpi/icon.png b/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/Android/drawable-ldpi/icon.png rename to demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png b/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png new file mode 100644 index 0000000..b9e102a Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png b/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png new file mode 100644 index 0000000..efeaf29 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png differ diff --git a/demo/app/App_Resources/Android/drawable-mdpi/icon.png b/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/Android/drawable-mdpi/icon.png rename to demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png b/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png new file mode 100644 index 0000000..6263387 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml b/demo/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml new file mode 100644 index 0000000..ada77f9 --- /dev/null +++ b/demo/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png b/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png new file mode 100644 index 0000000..612bbd0 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png b/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png new file mode 100644 index 0000000..f291882 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png b/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png new file mode 100644 index 0000000..ad8ee2f Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png b/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png new file mode 100644 index 0000000..0fa88e2 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png differ diff --git a/demo/app/App_Resources/iOS/icon-72@2x.png b/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/icon-72@2x.png rename to demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png b/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png new file mode 100644 index 0000000..6683278 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png b/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png new file mode 100644 index 0000000..c650f64 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png b/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png new file mode 100644 index 0000000..50887a8 Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png b/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png new file mode 100644 index 0000000..fa6331c Binary files /dev/null and b/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png differ diff --git a/demo/app/App_Resources/Android/src/main/res/values-v21/colors.xml b/demo/app/App_Resources/Android/src/main/res/values-v21/colors.xml new file mode 100644 index 0000000..a64641a --- /dev/null +++ b/demo/app/App_Resources/Android/src/main/res/values-v21/colors.xml @@ -0,0 +1,4 @@ + + + #3d5afe + \ No newline at end of file diff --git a/demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml b/demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..dac8727 --- /dev/null +++ b/demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/app/App_Resources/Android/src/main/res/values/colors.xml b/demo/app/App_Resources/Android/src/main/res/values/colors.xml new file mode 100644 index 0000000..74ad882 --- /dev/null +++ b/demo/app/App_Resources/Android/src/main/res/values/colors.xml @@ -0,0 +1,7 @@ + + + #F5F5F5 + #757575 + #33B5E5 + #272734 + \ No newline at end of file diff --git a/demo/app/App_Resources/Android/src/main/res/values/styles.xml b/demo/app/App_Resources/Android/src/main/res/values/styles.xml new file mode 100644 index 0000000..1e8c7f2 --- /dev/null +++ b/demo/app/App_Resources/Android/src/main/res/values/styles.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..5f53593 --- /dev/null +++ b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,128 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-40@3x.png", + "scale" : "3x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon-57.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "icon-57@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon-60@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon-29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon-29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon-40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon-40@2x.png", + "scale" : "2x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon-50.png", + "scale" : "1x" + }, + { + "size" : "50x50", + "idiom" : "ipad", + "filename" : "icon-50@2x.png", + "scale" : "2x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "icon-72.png", + "scale" : "1x" + }, + { + "size" : "72x72", + "idiom" : "ipad", + "filename" : "icon-72@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon-76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "icon-83.5@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png new file mode 100644 index 0000000..9e15af0 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png new file mode 100644 index 0000000..7b9e555 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png new file mode 100644 index 0000000..76f61ec Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png new file mode 100644 index 0000000..15b06db Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png new file mode 100644 index 0000000..585065f Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png new file mode 100644 index 0000000..a450c42 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/demo/app/App_Resources/iOS/Icon-Small-50.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Icon-Small-50.png rename to demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png diff --git a/demo/app/App_Resources/iOS/Icon-Small-50@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Icon-Small-50@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png diff --git a/demo/app/App_Resources/iOS/icon.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/icon.png rename to demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png diff --git a/demo/app/App_Resources/iOS/icon@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/icon@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png new file mode 100644 index 0000000..457b6d9 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png new file mode 100644 index 0000000..fa5a6ac Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/demo/app/App_Resources/iOS/icon-72.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/icon-72.png rename to demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png diff --git a/demo/app/App_Resources/iOS/icon-60@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png old mode 100755 new mode 100644 similarity index 65% rename from demo/app/App_Resources/iOS/icon-60@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png index 693f67f..4f69cb2 Binary files a/demo/app/App_Resources/iOS/icon-60@2x.png and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png new file mode 100644 index 0000000..94abcf7 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png new file mode 100644 index 0000000..2e71dd3 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png new file mode 100644 index 0000000..4abc9ec Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..4414bad --- /dev/null +++ b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,158 @@ +{ + "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "Default-736h@3x.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "Default-Landscape@3x.png", + "minimum-system-version" : "8.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "Default-667h@2x.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "Default-568h@2x.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape@2x.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default@2x.png", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default-568h@2x.png", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "Default-Portrait@2x.png", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "Default-Landscape@2x.png", + "extent" : "full-screen", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/demo/app/App_Resources/iOS/Default-568h@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default-568h@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png new file mode 100644 index 0000000..b884154 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png new file mode 100644 index 0000000..faab4b6 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png differ diff --git a/demo/app/App_Resources/iOS/Default-Landscape.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default-Landscape.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png diff --git a/demo/app/App_Resources/iOS/Default-Landscape@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default-Landscape@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png new file mode 100644 index 0000000..e6dca62 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png differ diff --git a/demo/app/App_Resources/iOS/Default-Portrait.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default-Portrait.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png diff --git a/demo/app/App_Resources/iOS/Default-Portrait@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default-Portrait@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png diff --git a/demo/app/App_Resources/iOS/Default.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png diff --git a/demo/app/App_Resources/iOS/Default@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png old mode 100755 new mode 100644 similarity index 100% rename from demo/app/App_Resources/iOS/Default@2x.png rename to demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json new file mode 100644 index 0000000..4f4e9c5 --- /dev/null +++ b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchScreen-AspectFill.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchScreen-AspectFill@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png new file mode 100644 index 0000000..c293f9c Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png new file mode 100644 index 0000000..233693a Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json new file mode 100644 index 0000000..23c0ffd --- /dev/null +++ b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchScreen-Center.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchScreen-Center@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png new file mode 100644 index 0000000..a5a775a Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png differ diff --git a/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png new file mode 100644 index 0000000..154c193 Binary files /dev/null and b/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png differ diff --git a/demo/app/App_Resources/iOS/Icon-Small.png b/demo/app/App_Resources/iOS/Icon-Small.png deleted file mode 100755 index 9e13a22..0000000 Binary files a/demo/app/App_Resources/iOS/Icon-Small.png and /dev/null differ diff --git a/demo/app/App_Resources/iOS/Icon-Small@2x.png b/demo/app/App_Resources/iOS/Icon-Small@2x.png deleted file mode 100755 index 89dd84c..0000000 Binary files a/demo/app/App_Resources/iOS/Icon-Small@2x.png and /dev/null differ diff --git a/demo/app/App_Resources/iOS/Info.plist b/demo/app/App_Resources/iOS/Info.plist index 0a8e1eb..ea3e3ea 100644 --- a/demo/app/App_Resources/iOS/Info.plist +++ b/demo/app/App_Resources/iOS/Info.plist @@ -8,25 +8,6 @@ ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleIconFile - icon.png - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon-40 - icon-60 - icon-72 - icon-76 - Icon-Small - Icon-Small-50 - - UIPrerenderedIcon - - - CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/demo/app/App_Resources/iOS/LaunchScreen.storyboard b/demo/app/App_Resources/iOS/LaunchScreen.storyboard new file mode 100644 index 0000000..2ad9471 --- /dev/null +++ b/demo/app/App_Resources/iOS/LaunchScreen.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/app/App_Resources/iOS/build.xcconfig b/demo/app/App_Resources/iOS/build.xcconfig new file mode 100644 index 0000000..0562055 --- /dev/null +++ b/demo/app/App_Resources/iOS/build.xcconfig @@ -0,0 +1,5 @@ +// You can add custom settings here +// for example you can uncomment the following line to force distribution code signing +// CODE_SIGN_IDENTITY = iPhone Distribution +ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; +ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; diff --git a/demo/app/App_Resources/iOS/icon-40.png b/demo/app/App_Resources/iOS/icon-40.png deleted file mode 100755 index 9b36ac4..0000000 Binary files a/demo/app/App_Resources/iOS/icon-40.png and /dev/null differ diff --git a/demo/app/App_Resources/iOS/icon-40@2x.png b/demo/app/App_Resources/iOS/icon-40@2x.png deleted file mode 100755 index 8ce4b88..0000000 Binary files a/demo/app/App_Resources/iOS/icon-40@2x.png and /dev/null differ diff --git a/demo/app/App_Resources/iOS/icon-60.png b/demo/app/App_Resources/iOS/icon-60.png deleted file mode 100755 index d2e9518..0000000 Binary files a/demo/app/App_Resources/iOS/icon-60.png and /dev/null differ diff --git a/demo/app/App_Resources/iOS/icon-76.png b/demo/app/App_Resources/iOS/icon-76.png deleted file mode 100755 index 1c659c6..0000000 Binary files a/demo/app/App_Resources/iOS/icon-76.png and /dev/null differ diff --git a/demo/app/App_Resources/iOS/icon-76@2x.png b/demo/app/App_Resources/iOS/icon-76@2x.png deleted file mode 100755 index bcc126d..0000000 Binary files a/demo/app/App_Resources/iOS/icon-76@2x.png and /dev/null differ diff --git a/demo/app/LICENSE b/demo/app/LICENSE deleted file mode 100755 index fc15630..0000000 --- a/demo/app/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Telerik AD -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/demo/app/app.css b/demo/app/app.css index c489ddb..911130f 100644 --- a/demo/app/app.css +++ b/demo/app/app.css @@ -1,2 +1 @@ -@import "nativescript-theme-core/css/core.light.css"; - +@import '~nativescript-theme-core/css/core.light.css'; diff --git a/demo/app/app.js b/demo/app/app.js index efaf44a..701e1ac 100644 --- a/demo/app/app.js +++ b/demo/app/app.js @@ -1,2 +1,5 @@ -var application = require("application"); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var application = require("tns-core-modules/application"); application.start({ moduleName: "main-page" }); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXBwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMERBQTREO0FBQzVELFdBQVcsQ0FBQyxLQUFLLENBQUMsRUFBRSxVQUFVLEVBQUUsV0FBVyxFQUFFLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIGFwcGxpY2F0aW9uIGZyb20gJ3Rucy1jb3JlLW1vZHVsZXMvYXBwbGljYXRpb24nO1xuYXBwbGljYXRpb24uc3RhcnQoeyBtb2R1bGVOYW1lOiBcIm1haW4tcGFnZVwiIH0pO1xuIl19 \ No newline at end of file diff --git a/demo/app/app.ts b/demo/app/app.ts new file mode 100644 index 0000000..a17b0bd --- /dev/null +++ b/demo/app/app.ts @@ -0,0 +1,2 @@ +import * as application from 'tns-core-modules/application'; +application.start({ moduleName: "main-page" }); diff --git a/demo/app/main-page.js b/demo/app/main-page.js index bf94532..1f995a0 100644 --- a/demo/app/main-page.js +++ b/demo/app/main-page.js @@ -1,13 +1,15 @@ -var socialShare = require("nativescript-social-share"); -var imageSource = require("image-source"); - -exports.shareImage = function() { - var image = imageSource.fromFile("~/images/nativescript.jpg"); - socialShare.shareImage(image); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var nativescript_social_share_1 = require("nativescript-social-share"); +var image_source_1 = require("tns-core-modules/image-source"); +exports.shareImage = function () { + var image = image_source_1.fromFile("~/images/nativescript.jpg"); + nativescript_social_share_1.shareImage(image); }; -exports.shareText = function() { - socialShare.shareText("I love NativeScript!"); +exports.shareText = function () { + nativescript_social_share_1.shareText("I love NativeScript!"); }; -exports.shareUrl = function() { - socialShare.shareUrl("https://www.nativescript.org/", "Home of NativeScript", "How would you like to share this url?"); +exports.shareUrl = function () { + nativescript_social_share_1.shareUrl("https://www.nativescript.org/", "Home of NativeScript", "How would you like to share this url?"); }; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi1wYWdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsibWFpbi1wYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUVBQTRFO0FBQzVFLDhEQUF5RDtBQUV6RCxPQUFPLENBQUMsVUFBVSxHQUFHO0lBQ25CLElBQU0sS0FBSyxHQUFHLHVCQUFRLENBQUMsMkJBQTJCLENBQUMsQ0FBQztJQUNwRCxzQ0FBVSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3BCLENBQUMsQ0FBQztBQUNGLE9BQU8sQ0FBQyxTQUFTLEdBQUc7SUFDbEIscUNBQVMsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ3BDLENBQUMsQ0FBQztBQUNGLE9BQU8sQ0FBQyxRQUFRLEdBQUc7SUFDakIsb0NBQVEsQ0FBQywrQkFBK0IsRUFBRSxzQkFBc0IsRUFBRSx1Q0FBdUMsQ0FBQyxDQUFDO0FBQzdHLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHNoYXJlSW1hZ2UsIHNoYXJlVGV4dCwgc2hhcmVVcmwgfSBmcm9tIFwibmF0aXZlc2NyaXB0LXNvY2lhbC1zaGFyZVwiO1xuaW1wb3J0IHsgZnJvbUZpbGUgfSBmcm9tIFwidG5zLWNvcmUtbW9kdWxlcy9pbWFnZS1zb3VyY2VcIjtcblxuZXhwb3J0cy5zaGFyZUltYWdlID0gZnVuY3Rpb24oKSB7XG4gIGNvbnN0IGltYWdlID0gZnJvbUZpbGUoXCJ+L2ltYWdlcy9uYXRpdmVzY3JpcHQuanBnXCIpO1xuICBzaGFyZUltYWdlKGltYWdlKTtcbn07XG5leHBvcnRzLnNoYXJlVGV4dCA9IGZ1bmN0aW9uKCkge1xuICBzaGFyZVRleHQoXCJJIGxvdmUgTmF0aXZlU2NyaXB0IVwiKTtcbn07XG5leHBvcnRzLnNoYXJlVXJsID0gZnVuY3Rpb24oKSB7XG4gIHNoYXJlVXJsKFwiaHR0cHM6Ly93d3cubmF0aXZlc2NyaXB0Lm9yZy9cIiwgXCJIb21lIG9mIE5hdGl2ZVNjcmlwdFwiLCBcIkhvdyB3b3VsZCB5b3UgbGlrZSB0byBzaGFyZSB0aGlzIHVybD9cIik7XG59O1xuIl19 \ No newline at end of file diff --git a/demo/app/main-page.ts b/demo/app/main-page.ts new file mode 100644 index 0000000..ed4cd01 --- /dev/null +++ b/demo/app/main-page.ts @@ -0,0 +1,13 @@ +import { shareImage, shareText, shareUrl } from "nativescript-social-share"; +import { fromFile } from "tns-core-modules/image-source"; + +exports.shareImage = function() { + const image = fromFile("~/images/nativescript.jpg"); + shareImage(image); +}; +exports.shareText = function() { + shareText("I love NativeScript!"); +}; +exports.shareUrl = function() { + shareUrl("https://www.nativescript.org/", "Home of NativeScript", "How would you like to share this url?"); +}; diff --git a/demo/app/main-page.xml b/demo/app/main-page.xml index b83710f..3bdf0d0 100644 --- a/demo/app/main-page.xml +++ b/demo/app/main-page.xml @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/demo/app/package.json b/demo/app/package.json index 7e44d50..eb7992c 100644 --- a/demo/app/package.json +++ b/demo/app/package.json @@ -1,3 +1,109 @@ { - "main": "app.js" + "name": "tns-template-hello-world-ts", + "main": "app.js", + "version": "1.6.0", + "author": { + "name": "Telerik", + "email": "support@telerik.com" + }, + "description": "Nativescript hello-world-ts project template", + "license": "Apache-2.0", + "keywords": [ + "telerik", + "mobile", + "nativescript", + "{N}", + "tns", + "appbuilder", + "template" + ], + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/NativeScript/template-hello-world-ts.git" + }, + "bugs": { + "url": "https://github.com/NativeScript/template-hello-world-ts/issues" + }, + "homepage": "https://github.com/NativeScript/template-hello-world-ts", + "android": { + "v8Flags": "--expose_gc", + "requireModules": ["nativescript-social-share"] + }, + "devDependencies": { + "nativescript-dev-typescript": "^0.3.0" + }, + "_id": "tns-template-hello-world-ts@1.6.0", + "_shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", + "_resolved": "https://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz", + "_from": "tns-template-hello-world-ts@latest", + "scripts": { + "build.plugin": "cd ../src && npm run build", + "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'" + }, + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "enchev", + "email": "vladimir.enchev@gmail.com" + }, + "dist": { + "shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", + "tarball": "http://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz" + }, + "maintainers": [ + { + "name": "enchev", + "email": "vladimir.enchev@gmail.com" + }, + { + "name": "erjangavalji", + "email": "erjan.gavalji@gmail.com" + }, + { + "name": "fatme", + "email": "hfatme@gmail.com" + }, + { + "name": "hdeshev", + "email": "hristo@deshev.com" + }, + { + "name": "kerezov", + "email": "d.kerezov@gmail.com" + }, + { + "name": "ligaz", + "email": "stefan.dobrev@gmail.com" + }, + { + "name": "nsndeck", + "email": "nedyalko.nikolov@telerik.com" + }, + { + "name": "rosen-vladimirov", + "email": "rosen.vladimirov.91@gmail.com" + }, + { + "name": "sdobrev", + "email": "stefan.dobrev@gmail.com" + }, + { + "name": "tailsu", + "email": "tailsu@gmail.com" + }, + { + "name": "teobugslayer", + "email": "teobugslayer@gmail.com" + }, + { + "name": "valio.stoychev", + "email": "valio.stoychev@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/tns-template-hello-world-ts-1.6.0.tgz_1455717516189_0.6427943941671401" + }, + "directories": {}, + "readme": "ERROR: No README data found!" } diff --git a/demo/app/tests/tests.js b/demo/app/tests/tests.js new file mode 100644 index 0000000..8cb51d6 --- /dev/null +++ b/demo/app/tests/tests.js @@ -0,0 +1,12 @@ +var SocialShare = require("nativescript-social-share").SocialShare; +var socialShare = new SocialShare(); + +describe("greet function", function() { + it("exists", function() { + expect(socialShare.greet).toBeDefined(); + }); + + it("returns a string", function() { + expect(socialShare.greet()).toEqual("Hello, NS"); + }); +}); \ No newline at end of file diff --git a/demo/karma.conf.js b/demo/karma.conf.js new file mode 100644 index 0000000..5d2286a --- /dev/null +++ b/demo/karma.conf.js @@ -0,0 +1,77 @@ +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + 'app/**/*.js' + ], + + + // list of files to exclude + exclude: [ + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: [], + + customLaunchers: { + android: { + base: 'NS', + platform: 'android' + }, + ios: { + base: 'NS', + platform: 'ios' + }, + ios_simulator: { + base: 'NS', + platform: 'ios', + arguments: ['--emulator'] + } + }, + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true + }); +}; diff --git a/demo/package.json b/demo/package.json index 7cb2944..737e33f 100644 --- a/demo/package.json +++ b/demo/package.json @@ -1,23 +1,33 @@ { "nativescript": { - "id": "org.nativescript.socialsharedemo", - "tns-android": { - "version": "3.1.1" - }, + "id": "org.nativescript.demo", "tns-ios": { - "version": "3.1.0" + "version": "4.2.0" + }, + "tns-android": { + "version": "4.2.0" } }, "dependencies": { - "nativescript-social-share": "file:../../nativescript-social-share", - "nativescript-theme-core": "~1.0.4", - "tns-core-modules": "~3.1.1" + "nativescript-theme-core": "^1.0.4", + "nativescript-unit-test-runner": "^0.3.4", + "nativescript-social-share": "file:../src", + "tns-core-modules": "^4.2.0" }, "devDependencies": { - "babel-traverse": "6.9.0", - "babel-types": "6.10.0", - "babylon": "6.8.1", - "filewalker": "0.1.2", - "lazy": "1.0.11" + "jasmine-core": "^2.5.2", + "karma": "^1.3.0", + "karma-jasmine": "^1.0.2", + "karma-nativescript-launcher": "^0.4.0", + "nativescript-css-loader": "~0.26.1", + "nativescript-dev-typescript": "~0.7.2", + "nativescript-dev-webpack": "~0.15.1", + "tns-platform-declarations": "^4.2.0", + "tslint": "~5.4.3", + "typescript": "~2.8.2" + }, + "scripts": { + "build.plugin": "cd ../src && npm run build", + "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'" } -} +} \ No newline at end of file diff --git a/demo/references.d.ts b/demo/references.d.ts new file mode 100644 index 0000000..680f3ef --- /dev/null +++ b/demo/references.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/demo/tsconfig.json b/demo/tsconfig.json new file mode 100644 index 0000000..e5a86c7 --- /dev/null +++ b/demo/tsconfig.json @@ -0,0 +1,43 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "declaration": false, + "removeComments": true, + "noLib": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": [ + "es6", + "dom" + ], + "pretty": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noEmitHelpers": true, + "noEmitOnError": false, + "noImplicitAny": false, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "baseUrl": ".", + "paths": { + "*": [ + "./node_modules/*" + ], + "~/*": [ + "app/*" + ] + } + }, + "include": [ + "../src", + "**/*" + ], + "exclude": [ + "../src/node_modules", + "node_modules", + "platforms" + ], + "compileOnSave": false +} \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index e921d44..0000000 --- a/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "nativescript-social-share", - "version": "1.5.0", - "description": "A NativeScript module to use the native social sharing widget", - "main": "social-share", - "typings": "index.d.ts", - "nativescript": { - "platforms": { - "ios": "1.4.0", - "android": "1.4.0" - } - }, - "repository": { - "type": "git", - "url": "https://github.com/tjvantoll/nativescript-social-share.git" - }, - "keywords": [ - "NativeScript" - ], - "author": "TJ VanToll (http://tjvantoll.com/)", - "contributors": [ - { - "name": "Eddy Verbruggen", - "email": "eddyverbruggen@gmail.com", - "url": "https://github.com/EddyVerbruggen" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/tjvantoll/nativescript-social-share/issues" - }, - "homepage": "https://github.com/tjvantoll/nativescript-social-share" -} diff --git a/publish/pack.sh b/publish/pack.sh new file mode 100644 index 0000000..212f22f --- /dev/null +++ b/publish/pack.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +SOURCE_DIR=../src; +TO_SOURCE_DIR=src; +PACK_DIR=package; +ROOT_DIR=..; +PUBLISH=--publish + +install(){ + npm i +} + +pack() { + + echo 'Clearing /src and /package...' + node_modules/.bin/rimraf "$TO_SOURCE_DIR" + node_modules/.bin/rimraf "$PACK_DIR" + + # copy src + echo 'Copying src...' + node_modules/.bin/ncp "$SOURCE_DIR" "$TO_SOURCE_DIR" + + # copy README & LICENSE to src + echo 'Copying README and LICENSE to /src...' + node_modules/.bin/ncp "$ROOT_DIR"/LICENSE "$TO_SOURCE_DIR"/LICENSE + node_modules/.bin/ncp "$ROOT_DIR"/README.md "$TO_SOURCE_DIR"/README.md + + # compile package and copy files required by npm + echo 'Building /src...' + cd "$TO_SOURCE_DIR" + node_modules/.bin/tsc + cd .. + + echo 'Creating package...' + # create package dir + mkdir "$PACK_DIR" + + # create the package + cd "$PACK_DIR" + npm pack ../"$TO_SOURCE_DIR" + + # delete source directory used to create the package + cd .. + node_modules/.bin/rimraf "$TO_SOURCE_DIR" +} + +install && pack \ No newline at end of file diff --git a/publish/package.json b/publish/package.json new file mode 100644 index 0000000..d5c28e9 --- /dev/null +++ b/publish/package.json @@ -0,0 +1,9 @@ +{ + "name": "nativescript-publish", + "version": "1.0.0", + "description": "Publish helper", + "devDependencies": { + "ncp": "^2.0.0", + "rimraf": "^2.5.0" + } +} diff --git a/publish/publish.sh b/publish/publish.sh new file mode 100644 index 0000000..8e72704 --- /dev/null +++ b/publish/publish.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +PACK_DIR=package; + +publish() { + cd $PACK_DIR + echo 'Publishing to npm...' + npm publish *.tgz +} + +./pack.sh && publish \ No newline at end of file diff --git a/social-share.android.js b/social-share.android.js deleted file mode 100644 index b1d8090..0000000 --- a/social-share.android.js +++ /dev/null @@ -1,65 +0,0 @@ -var application = require("application"); -var platform = require("platform"); -var context; -var numberOfImagesCreated = 0; - -function getIntent(type) { - var intent = new android.content.Intent(android.content.Intent.ACTION_SEND); - intent.setType(type); - return intent; -} -function share(intent, subject) { - context = application.android.context; - subject = subject || "How would you like to share this?"; - - var shareIntent = android.content.Intent.createChooser(intent, subject); - shareIntent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(shareIntent); -} - -module.exports = { - shareImage: function(image, subject) { - numberOfImagesCreated ++; - - context = application.android.context; - - var intent = getIntent("image/jpeg"); - - var stream = new java.io.ByteArrayOutputStream(); - image.android.compress(android.graphics.Bitmap.CompressFormat.JPEG, 100, stream); - - var imageFileName = "socialsharing" + numberOfImagesCreated + ".jpg"; - var newFile = new java.io.File(context.getExternalFilesDir(null), imageFileName); - - var fos = new java.io.FileOutputStream(newFile); - fos.write(stream.toByteArray()); - - fos.flush(); - fos.close(); - - var shareableFileUri; - var sdkVersionInt = parseInt(platform.device.sdkVersion); - if (sdkVersionInt >= 21) { - shareableFileUri = android.support.v4.content.FileProvider.getUriForFile(context, application.android.nativeApp.getPackageName() + ".provider", newFile); - } else { - shareableFileUri = android.net.Uri.fromFile(newFile); - } - intent.putExtra(android.content.Intent.EXTRA_STREAM, shareableFileUri); - - share(intent, subject); - }, - shareText: function(text, subject) { - var intent = getIntent("text/plain"); - - intent.putExtra(android.content.Intent.EXTRA_TEXT, text); - share(intent, subject); - }, - shareUrl: function(url, text, subject) { - var intent = getIntent("text/plain"); - - intent.putExtra(android.content.Intent.EXTRA_TEXT, url); - intent.putExtra(android.content.Intent.EXTRA_SUBJECT, text); - - share(intent, subject); - } -}; diff --git a/social-share.ios.js b/social-share.ios.js deleted file mode 100644 index 726825f..0000000 --- a/social-share.ios.js +++ /dev/null @@ -1,32 +0,0 @@ -var frameModule = require("ui/frame"); -var utilsModule = require("utils/utils"); - -function share(thingsToShare, index) { - var activityController = UIActivityViewController.alloc() - .initWithActivityItemsApplicationActivities(thingsToShare, null); - var presentViewController = activityController.popoverPresentationController; - if (presentViewController) { - var page = frameModule.topmost().currentPage; - if (page && page.ios.navigationItem.rightBarButtonItems && - page.ios.navigationItem.rightBarButtonItems.count > 0) { - presentViewController.barButtonItem = page.ios.navigationItem.rightBarButtonItems[0]; - } else { - presentViewController.sourceView = page.ios.view; - } - } - - frameModule.topmost().ios.controller - .presentViewControllerAnimatedCompletion(activityController, true, null); -} - -module.exports = { - shareImage: function(image) { - share([image]); - }, - shareText: function(text) { - share([text]); - }, - shareUrl: function(url, text) { - share([NSURL.URLWithString(url), text]); - } -}; diff --git a/src/.npmignore b/src/.npmignore new file mode 100644 index 0000000..b23a9bf --- /dev/null +++ b/src/.npmignore @@ -0,0 +1,9 @@ +*.map +*.ts +!*.d.ts +tsconfig.json +scripts/* +platforms/android/* +!platforms/android/include.gradle +!platforms/android/*.aar +!platforms/android/*.jar \ No newline at end of file diff --git a/index.d.ts b/src/index.d.ts similarity index 91% rename from index.d.ts rename to src/index.d.ts index 99c08dd..3db21cd 100644 --- a/index.d.ts +++ b/src/index.d.ts @@ -1,4 +1,4 @@ -import { ImageSource } from 'image-source'; +import { ImageSource } from "tns-core-modules/image-source"; /** * Share an image. @@ -7,7 +7,6 @@ import { ImageSource } from 'image-source'; */ export function shareImage(image?: ImageSource, subject?: string); - /** * Share text. * @param {string} text - Text to share. @@ -15,7 +14,6 @@ export function shareImage(image?: ImageSource, subject?: string); */ export function shareText(text: string, subject?: string); - /** * Share URL. * @param {string} url - URL to share. diff --git a/src/package-lock.json b/src/package-lock.json new file mode 100644 index 0000000..fd99fab --- /dev/null +++ b/src/package-lock.json @@ -0,0 +1,528 @@ +{ + "name": "nativescript-social-share", + "version": "1.5.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.3" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.2.tgz", + "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ==", + "dev": true + }, + "commander": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.18.0.tgz", + "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true + }, + "deep-equal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "i": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", + "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "ncp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", + "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pkginfo": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", + "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", + "dev": true + }, + "prompt": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.0.0.tgz", + "integrity": "sha1-jlcSPDlquYiJf7Mn/Trtw+c15P4=", + "dev": true, + "requires": { + "colors": "1.3.2", + "pkginfo": "0.4.1", + "read": "1.0.7", + "revalidator": "0.1.8", + "utile": "0.3.0", + "winston": "2.1.1" + } + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "0.0.7" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "1.0.6" + } + }, + "revalidator": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", + "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.3" + } + }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tns-core-modules": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tns-core-modules/-/tns-core-modules-4.2.0.tgz", + "integrity": "sha512-tEbQfeXVp6i9RJAmC+erd63mr6NYw5nX/gzYDVb1Va52/Jdj9ZeGbXKAPyjVXZ3BGI6O9QM1jQUem/Ow6v5FqQ==", + "dev": true, + "requires": { + "tns-core-modules-widgets": "4.2.0" + } + }, + "tns-core-modules-widgets": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tns-core-modules-widgets/-/tns-core-modules-widgets-4.2.0.tgz", + "integrity": "sha512-0YlfWN1Wy2qFlnzwrwit910whA9TC9en1PxS/5Yx63lL9uXHyOB53C8POnKfM82YUFVPxifcpuYtCC7+DBXbag==", + "dev": true + }, + "tns-platform-declarations": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tns-platform-declarations/-/tns-platform-declarations-4.2.0.tgz", + "integrity": "sha512-XY31UJiLzmQsYx4fdbG6yUIoEO/p5y3ApYvIYQlSzuXDaekKk96dfBPXNe9P3JNfZZSybQttK7Vqv9w9yTjdkA==", + "dev": true + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tslint": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", + "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.1", + "commander": "2.18.0", + "diff": "3.5.0", + "glob": "7.1.3", + "js-yaml": "3.12.0", + "minimatch": "3.0.4", + "resolve": "1.8.1", + "semver": "5.5.1", + "tslib": "1.9.3", + "tsutils": "2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "1.9.3" + } + }, + "typescript": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.4.tgz", + "integrity": "sha512-IIU5cN1mR5J3z9jjdESJbnxikTrEz3lzAw/D0Tf45jHpBp55nY31UkUvmVHoffCfKHTqJs3fCLPDxknQTTFegQ==", + "dev": true + }, + "utile": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", + "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", + "dev": true, + "requires": { + "async": "0.9.2", + "deep-equal": "0.2.2", + "i": "0.3.6", + "mkdirp": "0.5.1", + "ncp": "1.0.1", + "rimraf": "2.6.2" + } + }, + "winston": { + "version": "2.1.1", + "resolved": "http://registry.npmjs.org/winston/-/winston-2.1.1.tgz", + "integrity": "sha1-PJNJ0ZYgf9G9/51LxD73JRDjoS4=", + "dev": true, + "requires": { + "async": "1.0.0", + "colors": "1.0.3", + "cycle": "1.0.3", + "eyes": "0.1.8", + "isstream": "0.1.2", + "pkginfo": "0.3.1", + "stack-trace": "0.0.10" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + }, + "pkginfo": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz", + "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=", + "dev": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/src/package.json b/src/package.json new file mode 100644 index 0000000..9b40956 --- /dev/null +++ b/src/package.json @@ -0,0 +1,64 @@ +{ + "name": "nativescript-social-share", + "version": "1.5.0", + "description": "A NativeScript module to use the native social sharing widget", + "main": "social-share", + "typings": "index.d.ts", + "nativescript": { + "platforms": { + "android": "4.0.0", + "ios": "4.0.0" + } + }, + "scripts": { + "tsc": "tsc", + "build": "npm run tsc && npm run build.native", + "build.native": "node scripts/build-native.js", + "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src", + "test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch", + "test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch", + "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"", + "plugin.tscwatch": "npm run tsc -- -w", + "demo.ios": "npm run tsc && cd ../demo && tns run ios --syncAllFiles --emulator", + "demo.android": "npm run tsc && cd ../demo && tns run android --syncAllFiles --emulator", + "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json", + "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-social-share && tns plugin add ../src", + "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i", + "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'", + "prepack": "npm run build.native" + }, + "keywords": [ + "NativeScript", + "JavaScript", + "Android", + "iOS" + ], + "author": { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com" + }, + "contributors": [ + { + "name": "Eddy Verbruggen", + "email": "eddyverbruggen@gmail.com", + "url": "https://github.com/EddyVerbruggen" + } + ], + "bugs": { + "url": "https://github.com/tjvantoll/nativescript-social-share/issues" + }, + "license": "MIT", + "homepage": "https://github.com/tjvantoll/nativescript-social-share", + "readmeFilename": "README.md", + "devDependencies": { + "tns-core-modules": "^4.2.0", + "tns-platform-declarations": "^4.2.0", + "typescript": "~2.8.2", + "prompt": "^1.0.0", + "rimraf": "^2.6.2", + "tslint": "^5.11.0", + "semver": "^5.5.0" + }, + "dependencies": {}, + "bootstrapper": "nativescript-plugin-seed" +} diff --git a/platforms/android/AndroidManifest.xml b/src/platforms/android/AndroidManifest.xml similarity index 100% rename from platforms/android/AndroidManifest.xml rename to src/platforms/android/AndroidManifest.xml diff --git a/src/platforms/android/nativescript_social_share.aar b/src/platforms/android/nativescript_social_share.aar new file mode 100644 index 0000000..b252a77 Binary files /dev/null and b/src/platforms/android/nativescript_social_share.aar differ diff --git a/platforms/android/res/xml/provider_paths.xml b/src/platforms/android/res/xml/provider_paths.xml similarity index 100% rename from platforms/android/res/xml/provider_paths.xml rename to src/platforms/android/res/xml/provider_paths.xml diff --git a/src/references.d.ts b/src/references.d.ts new file mode 100644 index 0000000..1e5e961 --- /dev/null +++ b/src/references.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/src/scripts/build-native.js b/src/scripts/build-native.js new file mode 100644 index 0000000..8a25a4d --- /dev/null +++ b/src/scripts/build-native.js @@ -0,0 +1,24 @@ +const { exec } = require('child_process'); +const semver = require('semver'); + +exec('tns --version', (err, stdout, stderr) => { + if (err) { + // node couldn't execute the command + console.log(`tns --version err: ${err}`); + return; + } + + const tnsVersion = semver.major(stdout); + + // execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder. + if (tnsVersion >= 4) { + console.log(`executing 'tns plugin build'`); + exec('tns plugin build', (err, stdout, stderr) => { + if (err) { + // node couldn't execute the command + console.log(`${err}`); + return; + } + }); + } +}); diff --git a/src/social-share.android.ts b/src/social-share.android.ts new file mode 100644 index 0000000..ae062c4 --- /dev/null +++ b/src/social-share.android.ts @@ -0,0 +1,66 @@ +import * as application from "tns-core-modules/application"; +import * as platform from "tns-core-modules/platform"; + +var context; +var numberOfImagesCreated = 0; + +function getIntent(type) { + var intent = new android.content.Intent(android.content.Intent.ACTION_SEND); + intent.setType(type); + return intent; +} +function share(intent, subject) { + context = application.android.context; + subject = subject || "How would you like to share this?"; + + var shareIntent = android.content.Intent.createChooser(intent, subject); + shareIntent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(shareIntent); +} + +export function shareImage(image, subject) { + numberOfImagesCreated ++; + + context = application.android.context; + + var intent = getIntent("image/jpeg"); + + var stream = new java.io.ByteArrayOutputStream(); + image.android.compress(android.graphics.Bitmap.CompressFormat.JPEG, 100, stream); + + var imageFileName = "socialsharing" + numberOfImagesCreated + ".jpg"; + var newFile = new java.io.File(context.getExternalFilesDir(null), imageFileName); + + var fos = new java.io.FileOutputStream(newFile); + fos.write(stream.toByteArray()); + + fos.flush(); + fos.close(); + + var shareableFileUri; + var sdkVersionInt = parseInt(platform.device.sdkVersion); + if (sdkVersionInt >= 21) { + shareableFileUri = android.support.v4.content.FileProvider.getUriForFile(context, application.android.nativeApp.getPackageName() + ".provider", newFile); + } else { + shareableFileUri = android.net.Uri.fromFile(newFile); + } + intent.putExtra(android.content.Intent.EXTRA_STREAM, shareableFileUri); + + share(intent, subject); +} + +export function shareText(text, subject) { + var intent = getIntent("text/plain"); + + intent.putExtra(android.content.Intent.EXTRA_TEXT, text); + share(intent, subject); +} + +export function shareUrl(url, text, subject) { + var intent = getIntent("text/plain"); + + intent.putExtra(android.content.Intent.EXTRA_TEXT, url); + intent.putExtra(android.content.Intent.EXTRA_SUBJECT, text); + + share(intent, subject); +} diff --git a/src/social-share.ios.ts b/src/social-share.ios.ts new file mode 100644 index 0000000..6768682 --- /dev/null +++ b/src/social-share.ios.ts @@ -0,0 +1,32 @@ +import { topmost } from "tns-core-modules/ui/frame"; + +function share(thingsToShare) { + var activityController = UIActivityViewController.alloc() + .initWithActivityItemsApplicationActivities(thingsToShare, null); + + var presentViewController = activityController.popoverPresentationController; + if (presentViewController) { + var page = topmost().currentPage; + if (page && page.ios.navigationItem.rightBarButtonItems && + page.ios.navigationItem.rightBarButtonItems.count > 0) { + presentViewController.barButtonItem = page.ios.navigationItem.rightBarButtonItems[0]; + } else { + presentViewController.sourceView = page.ios.view; + } + } + + topmost().ios.controller + .presentViewControllerAnimatedCompletion(activityController, true, null); +} + +export function shareImage(image) { + share([image]); +} + +export function shareText(text) { + share([text]); +} + +export function shareUrl(url, text) { + share([NSURL.URLWithString(url), text]); +} diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..5e33b3f --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "declaration": true, + "removeComments": true, + "noLib": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "skipLibCheck": true, + "lib": ["es6", "dom"], + "sourceMap": true, + "pretty": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noEmitHelpers": true, + "noEmitOnError": false, + "noImplicitAny": false, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true + }, + "exclude": [ + "node_modules" + ], + "compileOnSave": false +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..4d35c69 --- /dev/null +++ b/tslint.json @@ -0,0 +1,57 @@ +{ + "rules": { + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "indent": [ + true, + "spaces" + ], + "no-duplicate-variable": true, + "no-eval": true, + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-var-keyword": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace" + ], + "quotemark": [ + false, + "double" + ], + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "variable-name": [ + true, + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } +} \ No newline at end of file