diff --git a/.eslintrc.js b/.eslintrc.js
index 02ee264..4ac39db 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,181 +1,3 @@
module.exports = {
- extends: ['plugin:prettier/recommended'],
- plugins: ['prettier', '@typescript-eslint'],
- parser: '@typescript-eslint/parser',
- parserOptions: {
- ecmaVersion: 2018,
- sourceType: 'module',
- parser: '@typescript-eslint/parser',
- project: 'tsconfig.eslint.json',
- warnOnUnsupportedTypeScriptVersion: false,
- tsconfigRootDir: __dirname,
- },
- rules: {
- 'prettier/prettier': 'warn',
- '@typescript-eslint/adjacent-overload-signatures': 'error',
- '@typescript-eslint/array-type': 'error',
- '@typescript-eslint/await-thenable': 'error',
- '@typescript-eslint/ban-types': 'off',
- '@typescript-eslint/class-name-casing': 'off',
- '@typescript-eslint/consistent-type-assertions': 'error',
- '@typescript-eslint/consistent-type-definitions': 'error',
- '@typescript-eslint/explicit-member-accessibility': [
- 'off',
- {
- accessibility: 'explicit',
- },
- ],
- '@typescript-eslint/indent': [
- 'error',
- 4,
- {
- FunctionDeclaration: {
- parameters: 'first',
- },
- FunctionExpression: {
- parameters: 'first',
- },
- SwitchCase: 1,
- },
- ],
- '@typescript-eslint/interface-name-prefix': 'off',
- '@typescript-eslint/member-delimiter-style': 'error',
- '@typescript-eslint/member-ordering': 'off',
- '@typescript-eslint/no-empty-function': 'off',
- '@typescript-eslint/no-empty-interface': 'off',
- '@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-floating-promises': 'off',
- '@typescript-eslint/no-inferrable-types': 'off',
- '@typescript-eslint/no-misused-new': 'off',
- '@typescript-eslint/no-namespace': 'off',
- '@typescript-eslint/no-parameter-properties': 'off',
- '@typescript-eslint/no-require-imports': 'off',
- '@typescript-eslint/no-unnecessary-qualifier': 'error',
- '@typescript-eslint/no-unnecessary-type-assertion': 'error',
- '@typescript-eslint/no-use-before-declare': 'off',
- '@typescript-eslint/no-var-requires': 'off',
- '@typescript-eslint/prefer-for-of': 'off',
- '@typescript-eslint/prefer-function-type': 'error',
- '@typescript-eslint/prefer-namespace-keyword': 'error',
- '@typescript-eslint/quotes': [
- 'error',
- 'single',
- {
- avoidEscape: true,
- },
- ],
- '@typescript-eslint/semi': ['error'],
- '@typescript-eslint/space-within-parens': ['off', 'never'],
- '@typescript-eslint/triple-slash-reference': 'off',
- '@typescript-eslint/type-annotation-spacing': 'error',
- '@typescript-eslint/unified-signatures': 'error',
- 'arrow-body-style': 'error',
- 'arrow-parens': ['off', 'as-needed'],
- camelcase: 'off',
- 'capitalized-comments': 'off',
- complexity: 'off',
- 'constructor-super': 'error',
- curly: ['error', 'multi-line'],
- 'dot-notation': 'off',
- 'eol-last': 'error',
- eqeqeq: ['error', 'smart'],
- 'guard-for-in': 'off',
- 'id-blacklist': ['error', 'any', 'string', 'boolean', 'Undefined'],
- 'id-match': 'error',
- 'sort-imports': [
- 'error',
- {
- ignoreCase: false,
- ignoreDeclarationSort: true,
- ignoreMemberSort: false,
- memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
- },
- ],
- 'linebreak-style': 'off',
- 'max-classes-per-file': 'off',
- 'max-len': [
- 'off',
- {
- ignorePattern: '^import |^export {(.*?)}',
- code: 200,
- },
- ],
- 'new-parens': 'off',
- 'newline-per-chained-call': 'off',
- 'no-bitwise': 'off',
- 'no-caller': 'error',
- 'no-cond-assign': 'off',
- 'no-console': [
- 'off',
- {
- allow: [
- 'log',
- 'warn',
- 'dir',
- 'timeLog',
- 'assert',
- 'clear',
- 'count',
- 'countReset',
- 'group',
- 'groupEnd',
- 'table',
- 'debug',
- 'dirxml',
- 'error',
- 'groupCollapsed',
- 'Console',
- 'profile',
- 'profileEnd',
- 'timeStamp',
- 'context',
- ],
- },
- ],
- 'no-constant-condition': 'error',
- 'no-control-regex': 'off',
- 'no-debugger': 'error',
- 'no-duplicate-imports': 'error',
- 'no-empty': 'off',
- 'no-eval': 'off',
- 'no-extra-semi': 'off',
- 'no-fallthrough': 'error',
- 'no-invalid-regexp': 'error',
- 'no-invalid-this': 'off',
- 'no-irregular-whitespace': 'off',
- 'no-multiple-empty-lines': 'off',
- 'no-new-wrappers': 'error',
- 'no-redeclare': ['error', { builtinGlobals: false }],
- 'no-regex-spaces': 'error',
- 'no-return-await': 'error',
- 'no-shadow': [
- 'off',
- {
- hoist: 'all',
- },
- ],
- 'no-throw-literal': 'error',
- 'no-trailing-spaces': 'error',
- 'no-undef-init': 'error',
- 'no-underscore-dangle': 'off',
- 'no-unsafe-finally': 'error',
- 'no-unused-expressions': [
- 'error',
- {
- allowTaggedTemplates: true,
- allowShortCircuit: true,
- },
- ],
- 'no-unused-labels': 'error',
- 'no-var': 'error',
- 'object-shorthand': 'error',
- 'one-var': ['off', 'never'],
- 'prefer-arrow/prefer-arrow-functions': 'off',
- 'prefer-const': 'error',
- 'quote-props': 'off',
- radix: 'error',
- 'space-before-function-paren': 'off',
- 'use-isnan': 'error',
- 'valid-typeof': 'off',
- },
+ extends: './tools/.eslintrc.js'
};
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index bdb0cab..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,17 +0,0 @@
-# Auto detect text files and perform LF normalization
-* text=auto
-
-# Custom for Visual Studio
-*.cs diff=csharp
-
-# Standard to msysgit
-*.doc diff=astextplain
-*.DOC diff=astextplain
-*.docx diff=astextplain
-*.DOCX diff=astextplain
-*.dot diff=astextplain
-*.DOT diff=astextplain
-*.pdf diff=astextplain
-*.PDF diff=astextplain
-*.rtf diff=astextplain
-*.RTF diff=astextplain
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 961364a..04d38ab 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,3 +1 @@
github: [farfromrefug]
-liberapay: farfromrefuge
-patreon: farfromrefuge
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..cbe2ab9
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,112 @@
+name: 'release'
+
+on:
+ workflow_dispatch:
+ inputs:
+ release_type:
+ type: choice
+ default: auto
+ description: What kind of version upgrade
+ options:
+ - auto
+ - patch
+ - minor
+ - major
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: "0"
+ submodules: true
+
+ - name: setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ registry-url: 'https://registry.npmjs.org'
+
+
+ - uses: oNaiPs/secrets-to-env-action@v1
+ with:
+ secrets: ${{ toJSON(secrets) }}
+
+
+ - uses: oleksiyrudenko/gha-git-credentials@v2-latest
+ with:
+ token: '${{ secrets.GITHUB_TOKEN }}'
+ name: Martin Guillon
+ email: dev@akylas.fr
+
+ - name: install jq
+ run: sudo apt install jq
+
+ - name: Enable CorePack
+ run: |
+ corepack enable
+ yarn config get globalFolder # the yarn command will ensure the correct yarn version is downloaded and installed
+
+ - name: Get yarn cache directory path
+ id: yarn-cache-dir-path
+ run: echo "::set-output name=dir::$(yarn config get globalFolder)"
+
+ - name: Remove package.json resolutions
+ run: echo "`jq 'delpaths([["resolutions"]])' package.json`" > package.json
+
+ - uses: actions/cache@v4
+ name: Handle node_modules Cache
+ id: yarn-node_modules # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
+ with:
+ path: node_modules
+ key: ${{ runner.os }}-yarn-node_modules-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-node_modules-
+
+ - uses: actions/cache@v4
+ if: steps.yarn-node_modules.outputs.cache-hit != 'true'
+ name: Handle Yarn cache
+ id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
+ with:
+ path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+ key: ${{ runner.os }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-yarn-
+
+ - name: Install deps
+ if: steps.yarn-node_modules.outputs.cache-hit != 'true'
+ uses: bahmutov/npm-install@v1
+ with:
+ install-command: yarn install --silent
+ env:
+ YARN_ENABLE_IMMUTABLE_INSTALLS: false
+
+ - name: run setup
+ run: |
+ npm run setup
+
+ - name: "NPM Identity"
+ env:
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ run: |
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
+
+ - name: publish auto
+ if: github.event.inputs.release_type == 'auto'
+ run: |
+ npm run publish -- --force-publish --no-verify-access --no-private --no-commit-hooks --yes
+ env:
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: publish
+ if: github.event.inputs.release_type != 'auto'
+ run: |
+ npm run publish -- --force-publish --no-verify-access --no-private --no-commit-hooks --yes --bump ${{ github.event.inputs.release_type }}
+ env:
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 31f2e74..ca1cd70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,27 +1,63 @@
+# NativeScript
+hooks/
+node_modules/
+platforms
+
+# NativeScript Template
+*.js.map
+!ngcc.config.js
+!webpack.config.js
+
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
.idea
+.cloud
+.gradle
+.project
.yarn
-.vscode
-node_modules
-demo-vue/platforms
-hooks
-package-lock.json
-.DS_Store
-npm-debug.log.*
-demo*/app/**/*.js
-demo*/typings
+.cxx
+tmp/
+
+!.eslintrc.js
+!.prettierrc.js
+
+!e2e/*.js
+!detox.config.js
+devices.js
+
*.framework
+*.xcframework
**/*.js.map
src/**/*.js
-plugin/**/*.js
-plugin/**/*.d.ts
+packages/**/*.js
+packages/**/*.d.ts
bin
build
Pods
-!/plugin/platforms
-/plugin/platforms/android/nativescript_*.aar
+!packages/*/platforms
+/packages/**/*.aar
+/packages/**/*.framework
+/packages/**/*.xcframework
+/demo-snippets/**/*.aar
*.xcuserdatad
-/plugin/README.md
-plugin/**/*js.map
-*.aar
-pnpm-lock.yaml
-yarn.lock
+/packages/README.md
+packages/**/*js.map
+packages/**/*js
+packages/angular
+packages/typings
+packages/**/angular/*.json
+packages/**/*.ngsummary.json
+packages/**/*.metadata.json
+
+.vscode/settings.json
+
+/blueprint.md
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..9c65367
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "demo-vue"]
+ path = demo-vue
+ url = https://github.com/nativescript-community/plugin-seed-demo-vue.git
+[submodule "tools"]
+ path = tools
+ url = https://github.com/nativescript-community/plugin-seed-tools.git
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..bf96d31
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,11 @@
+shamefully-hoist=true
+public-hoist-pattern[]=*eslint*
+public-hoist-pattern[]=source-map-support
+public-hoist-pattern[]=ts-patch
+public-hoist-pattern[]=typescript
+public-hoist-pattern[]=cpy-cli
+strict-peer-dependencies=false
+shell-emulator=true
+auto-install-peers=false
+loglevel=error
+engine-strict=true
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..96d64cd
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,4 @@
+package-lock.json
+node_modules/
+plugin/
+docs/
diff --git a/.prettierrc b/.prettierrc
deleted file mode 100644
index 0d8e914..0000000
--- a/.prettierrc
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "printWidth": 130,
- "semi": true,
- "tabWidth": 4,
- "singleQuote": true,
- "trailingComma": "none"
-}
\ No newline at end of file
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 0000000..258971a
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,7 @@
+module.exports = {
+ printWidth: 200,
+ semi: true,
+ tabWidth: 4,
+ trailingComma: 'none',
+ singleQuote: true
+};
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c44ac91..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,92 +0,0 @@
-sudo: false
-
-android:
- components:
- - tools
- - platform-tools
- - build-tools-25.0.2
- - android-23
- - android-25
- - extra-android-m2repository
-
-before_cache:
- - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
-
-cache:
- directories:
- - .nvm
- - $HOME/.gradle/caches/
- - $HOME/.gradle/wrapper/
-
-install:
- - echo no | npm install -g nativescript
- - tns usage-reporting disable
- - tns error-reporting disable
- - echo no | npm install -g grunt-cli
- - npm install
- - grunt compile
-
-matrix:
- include:
- - stage: lint
- language: node_js
- os: linux
- node_js: "6"
- script: grunt lint
-
- - stage: build
- language: android
- os: linux
- env:
- - Android="25"
- jdk: oraclejdk8
- before_install: nvm install 6.10.3
- script: "grunt ci:build:android"
-
- - stage: build
- os: osx
- env:
- - iOS="10.3"
- - Xcode="8.3"
- osx_image: xcode8.3
- language: node_js
- node_js: "6"
- jdk: oraclejdk8
- script: "grunt ci:build:ios"
-
- - stage: webpack
- language: android
- os: linux
- env:
- - Android="25"
- - Platform="Android"
- jdk: oraclejdk8
- before_install: nvm install 6.10.3
- script: "grunt ci:webpack:android"
-
- - stage: webpack
- os: osx
- env:
- - iOS="10.3"
- - Xcode="8.3"
- - Platform="iOS"
- osx_image: xcode8.3
- language: node_js
- node_js: "6"
- jdk: oraclejdk8
- script: "grunt ci:webpack:ios"
-
- - stage: deploy
- if: branch = release
- language: node_js
- node_js: "6"
- before_deploy:
- - cd bin/dist
- deploy:
- provider: npm
- email: "peter@tangrasoft.com"
- api_key:
- secure: "aJaRODpz7b7k77WmdOG1tlFp3HZopZq6bzKjMwNtWIGlJbmxBGwv/0c63cHRy2JPxPHFHDQVQ4lcrRzXjyz5lB3dq/VSgFq7ydcBkQnNjwgaBBLfyluYAcyt4/qEHRJqJ5oDuV3ReAE5Vb78OoVOUCevbrgPwm8IoDawXHXwUskqvow/hiooaelvpcntAfA/efLYRJqIzrdaNehfIibESrLPD50PWzLlFk4ctkvtmriCe1WLw7pw9bW/86/tjm3MAf39/HhBx/lYh9SAg1KZRtnga7xfphzybx5ZcI6152Bxt+9ICgXimn2r5IjBp8eW09RkksMars3ZwKf1dZSDcUVLKAwYM3tW1Yn/UdWWWGyoRtq/wMnnVW5TvfuNDEOFOVFP2t0SuOjjwgmQuSc5l1GD65PTDEwLHz01kaCXDEF+ErShZt/VgvkcxwqEozxeCmBfhp2Rlaszh31MSCO9bheM17N5z+v0beujQ5yBYKC+oxIrM2b8cpbbmgfYnXVuTuYnRefNmiODnIhYDK5THBEjbjowpJiy/2Ib4wT6gND8b5foyi6vAD143XXtzFfbDx03iOu/2Ye38741tIZHJfW9k4uUdNS4WGHv86+oY3uQ1GZ2WkaVa/M4V7sdimgqPJnnpG3cOtsFz0zFXEpKJ/gVC6zmtQ5Xwyvl6rSzOyc="
- skip_cleanup: true
- on:
- branch: release
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 002dffb..0000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,11 +0,0 @@
-// Place your settings in this file to overwrite default and user settings.
-{
- "files.exclude": {
- "**/.git": true,
- "**/.DS_Store": true,
- "bin/**": true
- }
-,
-"typescript.tsdk": "./node_modules/typescript/lib",
-"java.configuration.updateBuildConfiguration": "disabled"
-}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index dc515f5..0000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- // See http://go.microsoft.com/fwlink/?LinkId=733558
- // for the documentation about the tasks.json format
- "version": "2.0.0",
- "command": "grunt",
- "args": [
- "--no-color"
- ],
-
- "tasks": [
- {
- "label": "build",
- "type": "grunt",
- "task": "--no-color",
- "problemMatcher": [
- "$tsc",
- "$tslint4"
- ],
- "group": "build"
- }
- ]
-}
\ No newline at end of file
diff --git a/.yarnrc.yml b/.yarnrc.yml
new file mode 100644
index 0000000..b877749
--- /dev/null
+++ b/.yarnrc.yml
@@ -0,0 +1,7 @@
+compressionLevel: mixed
+
+nmHoistingLimits: workspaces
+
+nodeLinker: node-modules
+
+yarnPath: tools/.yarn/releases/yarn-4.0.1.cjs
diff --git a/config.json b/config.json
new file mode 100644
index 0000000..20f344a
--- /dev/null
+++ b/config.json
@@ -0,0 +1,7 @@
+{
+ "readme": true,
+ "angular": false,
+ "demos": [
+ "vue"
+ ]
+}
\ No newline at end of file
diff --git a/demo-snippets/assets/fonts/Bahianita-Regular.ttf b/demo-snippets/assets/fonts/Bahianita-Regular.ttf
new file mode 100755
index 0000000..0fb3718
Binary files /dev/null and b/demo-snippets/assets/fonts/Bahianita-Regular.ttf differ
diff --git a/demo-snippets/assets/fonts/CabinSketch-Bold.ttf b/demo-snippets/assets/fonts/CabinSketch-Bold.ttf
new file mode 100755
index 0000000..473e1f1
Binary files /dev/null and b/demo-snippets/assets/fonts/CabinSketch-Bold.ttf differ
diff --git a/demo-snippets/assets/fonts/CabinSketch-Regular.ttf b/demo-snippets/assets/fonts/CabinSketch-Regular.ttf
new file mode 100755
index 0000000..890e490
Binary files /dev/null and b/demo-snippets/assets/fonts/CabinSketch-Regular.ttf differ
diff --git a/demo-snippets/assets/fonts/montserrat-bold.ttf b/demo-snippets/assets/fonts/montserrat-bold.ttf
new file mode 100755
index 0000000..221819b
Binary files /dev/null and b/demo-snippets/assets/fonts/montserrat-bold.ttf differ
diff --git a/demo-snippets/assets/fonts/montserrat-regular.ttf b/demo-snippets/assets/fonts/montserrat-regular.ttf
new file mode 100755
index 0000000..8d443d5
Binary files /dev/null and b/demo-snippets/assets/fonts/montserrat-regular.ttf differ
diff --git a/demo-snippets/package.json b/demo-snippets/package.json
new file mode 100644
index 0000000..e95b7ff
--- /dev/null
+++ b/demo-snippets/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "@nativescript-community/template-snippet",
+ "private": true,
+ "version": "0.0.1",
+ "dependencies": {
+ "@nativescript-community/systemui": "*",
+ "vue-class-component": "^7.2.6",
+ "vue-property-decorator": "^8.5.1"
+ },
+ "nativescript": {
+ "platforms": {
+ "android": "2.3.0",
+ "ios": "2.3.0"
+ }
+ }
+}
diff --git a/demo-snippets/vue/AutoSize.vue b/demo-snippets/vue/AutoSize.vue
new file mode 100644
index 0000000..da23472
--- /dev/null
+++ b/demo-snippets/vue/AutoSize.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo-snippets/vue/Base.vue b/demo-snippets/vue/Base.vue
new file mode 100644
index 0000000..2a1db9b
--- /dev/null
+++ b/demo-snippets/vue/Base.vue
@@ -0,0 +1,332 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo-snippets/vue/LinkTap.vue b/demo-snippets/vue/LinkTap.vue
new file mode 100644
index 0000000..60ad47e
--- /dev/null
+++ b/demo-snippets/vue/LinkTap.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo-snippets/vue/PerfsTest.vue b/demo-snippets/vue/PerfsTest.vue
new file mode 100644
index 0000000..130eff2
--- /dev/null
+++ b/demo-snippets/vue/PerfsTest.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demo-snippets/vue/Tests.vue b/demo-snippets/vue/Tests.vue
new file mode 100644
index 0000000..0cb94c7
--- /dev/null
+++ b/demo-snippets/vue/Tests.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo-snippets/vue/VerticalAlignment.vue b/demo-snippets/vue/VerticalAlignment.vue
new file mode 100644
index 0000000..81e00be
--- /dev/null
+++ b/demo-snippets/vue/VerticalAlignment.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo-snippets/vue/install.ts b/demo-snippets/vue/install.ts
new file mode 100644
index 0000000..6a72e72
--- /dev/null
+++ b/demo-snippets/vue/install.ts
@@ -0,0 +1,6 @@
+import Vue from 'nativescript-vue';
+import Basic from './Basic.vue';
+
+export function installPlugin() {}
+
+export const demos = [{ name: 'Basic', path: 'basic', component: Basic }];
diff --git a/gruntfile.js b/gruntfile.js
deleted file mode 100644
index a8ac566..0000000
--- a/gruntfile.js
+++ /dev/null
@@ -1,132 +0,0 @@
-module.exports = function (grunt) {
- var localConfig = {
- typeScriptDeclarations:[
- "**/*.d.ts",
- "!references.d.ts",
- "!node_modules/**/*.*",
- "!demo/**/*.*",
- "!demo-ng/**/*.*",
- "!bin/**/*.*"
- ],
- outDir: "bin/dist/"
- }
-
- grunt.initConfig({
- clean:{
- build:{
- src:[localConfig.outDir]
- }
- },
- copy: {
- declarations: {
- src: localConfig.typeScriptDeclarations,
- dest: localConfig.outDir
- },
- platforms: {
- files: [{ expand: true, src: ["platforms/**"], dest: localConfig.outDir }]
- },
- packageConfig: {
- src: "package.json",
- dest: localConfig.outDir,
- options: {
- process: function (content, srcPath) {
- var contentAsObject = JSON.parse(content);
- contentAsObject.devDependencies = undefined;
- contentAsObject.scripts = undefined;
- return JSON.stringify(contentAsObject, null, "\t");
- }
- }
- },
- readme: {
- src: "README.md",
- dest: localConfig.outDir,
- options: {
- process: function (content, srcPath) {
- return content.substring(content.indexOf("\n") + 1)
- }
- }
- }
- },
- exec: {
- tsCompile: "npm run tsc -- --outDir " + localConfig.outDir,
- ngCompile: "npm run ngc -- --outDir " + localConfig.outDir,
- tslint: "npm run tslint",
- checkRequiredReadmeSection: {
- cwd: "bin/dist",
- cmd: function (section) {
- return "cat README.md | grep -q \"# " + section + "\"";
- }
- },
- checkRequiredPackageJsonSection: {
- cwd: "bin/dist",
- cmd: function (section) {
- return "cat package.json | grep -q \"\\\"" + section + "\\\"\"";
- }
- },
- "ci-build-demo": {
- cmd: function (platform, demoSuffix) {
- return "cd demo" + (demoSuffix != "" ? "-" + demoSuffix : "") + " && npm install && tns build " + platform;
- }
- },
- "ci-webpack-demo": {
- cmd: function (platform, demoSuffix) {
- return "cd demo" + (demoSuffix != "" ? "-" + demoSuffix : "") + " && npm install && tns build " + platform
- + " --bundle --env.uglify --env.snapshot"
- + (demoSuffix === "ng" ? " --env.aot" : "");
- }
- },
- npm_publish: {
- cmd: "npm publish",
- cwd: localConfig.outDir
- }
- }
- });
-
- grunt.loadNpmTasks("grunt-contrib-copy");
- grunt.loadNpmTasks("grunt-contrib-clean");
- grunt.loadNpmTasks("grunt-exec");
-
- grunt.registerTask("compile", [
- "clean:build",
- "exec:tsCompile",
- "exec:ngCompile",
- "copy"
- ]);
-
- grunt.registerTask("build", [
- "exec:tslint",
- "compile",
- "copy"
- ]);
-
- grunt.registerTask("ci", "Performs CI builds for the demo projects", function (action, platform) {
- if (!platform || platform === "") {
- grunt.warn("You must specify a platform (ios or android)!");
- }
- if (!action || action === "") {
- grunt.warn("You must specify an action (build or webpack)!");
- }
-
- var baseTask = "exec:ci-" + action.toLowerCase() + "-demo:" + platform.toLowerCase();
- grunt.task.run(
- baseTask + ":",
- baseTask + ":ng"
- );
- });
-
- grunt.registerTask("lint", [
- "exec:checkRequiredReadmeSection:Installation",
- "exec:checkRequiredReadmeSection:Configuration",
- "exec:checkRequiredReadmeSection:API",
- "exec:checkRequiredReadmeSection:Usage",
- "exec:checkRequiredPackageJsonSection:license",
- "exec:checkRequiredPackageJsonSection:nativescript",
- "exec:tslint",
- ]);
-
- grunt.registerTask("publish", [
- "build",
- "lint",
- "exec:npm_publish"
- ]);
-};
diff --git a/lerna.json b/lerna.json
index 203a375..a123fc3 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,9 +1,28 @@
{
- "packages": ["plugin"],
"version": "1.3.32",
+ "$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
+ "packages": [
+ "packages/*"
+ ],
+ "npmClient": "yarn",
+ "useWorkspaces": true,
"command": {
"publish": {
- "conventionalCommits": true
+ "cleanupTempFiles": true
}
- }
+ },
+ "npmClientArgs": [
+ "--no-package-lock"
+ ],
+ "commitHooks": false,
+ "createRelease": "github",
+ "conventionalCommits": true,
+ "private": false,
+ "message": "chore(release): publish new version %v",
+ "changelogPreset": "conventional-changelog-conventionalcommits",
+ "ignoreChanges": [
+ "**/__fixtures__/**",
+ "**/__tests__/**",
+ "**/*.md"
+ ]
}
diff --git a/package.json b/package.json
index 4f1e194..94e1bdf 100644
--- a/package.json
+++ b/package.json
@@ -1,26 +1,15 @@
{
- "name": "@nativescript-community/ui-label",
- "version": "1.0.0",
- "description": "Your awesome NativeScript plugin.",
- "main": "./label",
- "typings": "./label.d.ts",
- "nativescript": {
- "platforms": {
- "android": "3.0.0",
- "ios": "3.0.0"
- }
- },
"scripts": {
- "setup": "ts-patch install",
+ "setup": "npm run submodules && ts-patch install",
"prepare": "npm run setup",
"tsc": "cp src/label.d.ts plugin && tsc -skipLibCheck -d",
- "clean": "rimraf ./plugin/**/*.d.ts ./plugin/**/*.js ./plugin/**/*.js.map plugin/node_modules plugin/package-lock.json",
+ "clean": "rimraf 'packages/**/*.d.ts' 'packages/**/*.js' 'packages/**/*.js.map' 'packages/**/*.metada' 'packages/**/angular/ng-package.json'",
"build.plugin": " cp README.md plugin/ && rm -f .tsbuildinfo && npm run tsc",
"build.android": "bash src-native/android/build.sh",
"build.ios": "bash src-native/ios/build.sh",
"build.native": "npm run build.android && npm run build.ios",
- "build": "npm run build.plugin",
- "publish": "npm run setup; npm run build ; lerna publish --create-release=github --force-publish",
+ "build": "lerna run build",
+ "publish": "npm run setup && npm run clean && npm run build.all && npm run readme && npm run doc && npm run commit_readme_doc_changes && lerna publish",
"demo.ios": "npm i && npm run tsc && cd demo && tns run ios",
"demo.android": "npm i && npm run tsc && cd demo && tns run android",
"clean.demo": "rimraf demo/hooks demo/node_modules demo/platforms",
@@ -28,7 +17,20 @@
"plugin.watch.android": "npm i && npm-watch build.android",
"plugin.watch.ios": "npm i && npm-watch build.ios",
"plugin.watch": "npm run plugin.watch.tsc & npm run plugin.watch.android & npm run plugin.watch.ios",
- "commitmsg": "commitlint -e $GIT_PARAMS"
+ "commitmsg": "commitlint -e $GIT_PARAMS",
+ "sync": "node ./tools/sync.js",
+ "update": "node ./tools/update.js",
+ "build.all": "npm run build",
+ "fullclean": "npm run clean && rimraf 'packages/**/node_modules' 'demo-*/hooks' 'demo-*/node_modules' 'package-lock.json' 'pnpm-lock.yaml' 'node_modules'",
+ "demo.vue.android": "cd ./demo-vue && ns run android --no-hmr --env.watchNodeModules",
+ "demo.vue.clean": "cd ./demo-vue && ns clean",
+ "demo.vue.ios": "cd ./demo-vue && ns run ios --no-hmr --env.watchNodeModules",
+ "doc": "node tools/builddoc.js",
+ "commit_readme_doc_changes": "git add docs/** *.md ; git commit -m \"readme/doc\" ; echo \"commit readme doc done\"",
+ "postinstall": "npm run setup",
+ "readme": "lerna run readme && node ./tools/readme.js",
+ "start": "./node_modules/.bin/ntl -A -s 15 -o",
+ "submodules": "git submodule update --init"
},
"keywords": [
"NativeScript",
@@ -46,34 +48,36 @@
"license": "Apache-2.0",
"homepage": "https://github.com/nativescript-community/ui-label",
"readmeFilename": "README.md",
- "devDependencies": {
- "@commitlint/cli": "^17.4.4",
- "@commitlint/config-conventional": "^17.4.4",
- "@nativescript-community/text": "^1.6.3",
- "@nativescript/core": "8.4.7",
- "@nativescript/types-android": "8.4.0",
- "@nativescript/types-ios": "8.4.0",
- "@nativescript/webpack": "5.0.13",
- "@types/node": "^20.1.2",
- "@typescript-eslint/eslint-plugin": "5.52.0",
- "@typescript-eslint/parser": "5.52.0",
- "eslint": "8.34.0",
- "eslint-config-prettier": "^8.6.0",
- "eslint-plugin-prettier": "^4.2.1",
- "husky": "^8.0.3",
- "lerna": "^6.5.1",
- "prettier": "^2.8.4",
- "rimraf": "^4.1.2",
- "ts-patch": "^2.1.0",
- "typescript": "~4.8.4"
- },
"dependencies": {
- "ts-node": "^10.9.1"
+ "@nativescript-community/plugin-seed-tools": "file:tools"
+ },
+ "devDependencies": {
+ "@nativescript-community/text": "^1.6.6"
},
"bootstrapper": "nativescript-plugin-seed",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
+ },
+ "ntl": {
+ "descriptions": {
+ "build": "Build the plugin",
+ "build.all": "Build the plugin for all platforms",
+ "clean": "Clean the local environment.",
+ "demo.vue.android": "Runs the Vue demo on Android.",
+ "demo.vue.ios": "Runs the Vue demo on iOS.",
+ "watch": "Watch for changes in the plugin source and re-build."
+ }
+ },
+ "workspaces": [
+ "packages/*",
+ "demo*"
+ ],
+ "engines": {
+ "npm": "please use yarn or pnpm",
+ "yarn": ">=1.19.1",
+ "pnpm": ">=7.0.0",
+ "node": "^14.20.0 || ^16.13.0 || >=18.10.0"
}
}
diff --git a/plugin/.npmignore b/packages/label/.npmignore
similarity index 100%
rename from plugin/.npmignore
rename to packages/label/.npmignore
diff --git a/plugin/CHANGELOG.md b/packages/label/CHANGELOG.md
similarity index 100%
rename from plugin/CHANGELOG.md
rename to packages/label/CHANGELOG.md
diff --git a/packages/label/README.md b/packages/label/README.md
new file mode 100644
index 0000000..91964c0
--- /dev/null
+++ b/packages/label/README.md
@@ -0,0 +1,148 @@
+# NativeScript Label widget
+
+[](https://www.npmjs.com/package/@nativescript-community/ui-label)
+[](https://www.npmjs.com/package/@nativescript-community/ui-label)
+[](https://www.npmjs.com/package/@nativescript-community/ui-label)
+
+A NativeScript Label widget. It is a direct replacement for the {N} Label widget.
+
+## Installation
+
+Run the following command from the root of your project:
+
+`tns plugin add @nativescript-community/ui-label`
+
+This command automatically installs the necessary files, as well as stores nativescript-community/ui-label as a dependency in your project's package.json file.
+
+### Production build
+
+If you are using proguard on Android build you need ensure some resource from this plugin are not minified. You need to add ` tools:keep="@layout/ns_*"` as explained [here](https://developer.android.com/build/shrink-code#keep-resources)
+
+## Configuration
+
+It works exactly the same way as the {N} plugin. However it adds a few improvements
+
+### Angular
+
+```typescript
+import { registerElement } from '@nativescript/angular';
+
+registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
+```
+
+```html
+
+
+
+
+
+```
+
+```typescript
+import { Utils } from '@nativescript/core';
+
+export someComponentClass() {
+ someBindedUrl = 'Open Youtube.com'
+
+ // Event binded to the linkTap function on the HTMLLabel
+ onLinkTap(args) {
+ const link = args.link;
+ // expected to be https://youtube.com from the binded `` tag href value
+ // be sure to encodeURIComponent of any query string parameters if needed.
+ Utils.openUrl(link);
+ }
+}
+
+
+```
+
+### Vue
+
+```typescript
+import Vue from 'nativescript-vue';
+
+Vue.registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
+```
+
+```html
+
+
+
+
+
+```
+
+```typescript
+
+```
+
+### Properties
+
+- **html**
+ Html text that will be used to render text. HTML supported tags are a bit different on iOS and Android. To make sure it works as expected, for now only used Android [supported ones](https://stackoverflow.com/questions/9754076/which-html-tags-are-supported-by-android-textview).
+
+ If using a `url` with parameters, be sure to encode the query string so Android can open the link accordingly.
+
+- **verticalTextAlignment**
+ You can also set it through css with `vertical-text-alignment`
+
+- **textShadow**
+ You can also set it through css with `text-shadow`. The format is `offsetx offsety blurradius color`
+
+- **linkColor**
+ Color for any `` tags inside the `HTMLLabel`.
+
+- **linkUnderline**
+ Boolean to enable underline for any `` tags inside the `HTMLLabel`.
+- **linkTap**
+ Event to handle taps of any `` tags inside the `HTMLLabel`. Access the `link` property of the event data from the `linkTap` event. See Samples above for example.
+
+## Improvements
+
+- Override the {N} font loading system to make it much faster
+- faster creation of `FormattedString`
+- faster label creation and drawing, especially on android
diff --git a/packages/label/blueprint.md b/packages/label/blueprint.md
new file mode 100644
index 0000000..e74ffe7
--- /dev/null
+++ b/packages/label/blueprint.md
@@ -0,0 +1,159 @@
+{{ load:../../tools/readme/edit-warning.md }}
+{{ template:title }}
+{{ template:badges }}
+{{ template:description }}
+
+|
|
|
+| --- | ----------- |
+| iOS Demo | Android Demo |
+
+{{ template:toc }}
+
+## Installation
+Run the following command from the root of your project:
+
+`ns plugin add {{ pkg.name }}`
+
+### Production build
+
+If you are using proguard on Android build you need ensure some resource from this plugin are not minified. You need to add ` tools:keep="@layout/ns_*"` as explained [here](https://developer.android.com/build/shrink-code#keep-resources)
+
+## Configuration
+
+It works exactly the same way as the {N} plugin. However it adds a few improvements
+
+### Angular
+
+```typescript
+import { registerElement } from '@nativescript/angular';
+
+registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
+```
+
+```html
+
+
+
+
+
+```
+
+```typescript
+import { Utils } from '@nativescript/core';
+
+export someComponentClass() {
+ someBindedUrl = 'Open Youtube.com'
+
+ // Event binded to the linkTap function on the HTMLLabel
+ onLinkTap(args) {
+ const link = args.link;
+ // expected to be https://youtube.com from the binded `` tag href value
+ // be sure to encodeURIComponent of any query string parameters if needed.
+ Utils.openUrl(link);
+ }
+}
+
+
+```
+
+### Vue
+
+```typescript
+import Vue from 'nativescript-vue';
+
+Vue.registerElement('HTMLLabel', () => require('@nativescript-community/ui-label').Label);
+```
+
+```html
+
+
+
+
+
+```
+
+```typescript
+
+```
+
+### Properties
+
+- **html**
+ Html text that will be used to render text. HTML supported tags are a bit different on iOS and Android. To make sure it works as expected, for now only used Android [supported ones](https://stackoverflow.com/questions/9754076/which-html-tags-are-supported-by-android-textview).
+
+ If using a `url` with parameters, be sure to encode the query string so Android can open the link accordingly.
+
+- **verticalTextAlignment**
+ You can also set it through css with `vertical-text-alignment`
+
+- **textShadow**
+ You can also set it through css with `text-shadow`. The format is `offsetx offsety blurradius color`
+
+- **linkColor**
+ Color for any `` tags inside the `HTMLLabel`.
+
+- **linkUnderline**
+ Boolean to enable underline for any `` tags inside the `HTMLLabel`.
+- **linkTap**
+ Event to handle taps of any `` tags inside the `HTMLLabel`. Access the `link` property of the event data from the `linkTap` event. See Samples above for example.
+
+## Improvements
+
+- Override the {N} font loading system to make it much faster
+- faster creation of `FormattedString`
+- faster label creation and drawing, especially on android
+
+
+### Examples:
+
+- [Basic Drawer](demo-snippets/vue3/BasicDrawer.vue)
+ - A basic sliding drawer.
+- [All Sides](demo-snippets/vue3/AllSides.vue)
+ - An example of drawers on all sides: left, right, top, bottom.
+
+{{ load:../../tools/readme/demos-and-development.md }}
+{{ load:../../tools/readme/questions.md }}
diff --git a/plugin/package.json b/packages/label/package.json
similarity index 63%
rename from plugin/package.json
rename to packages/label/package.json
index 95d5866..8474f3f 100644
--- a/plugin/package.json
+++ b/packages/label/package.json
@@ -2,15 +2,24 @@
"name": "@nativescript-community/ui-label",
"version": "1.3.32",
"description": "Alternative to the built-in NativeScript Label but with better performance and additional features such as HTML rendering and more.",
- "main": "./label",
+ "main": "./index",
"sideEffects": false,
- "typings": "./label.d.ts",
+ "typings": "./laindexbel.d.ts",
"nativescript": {
"platforms": {
"android": "3.0.0",
"ios": "3.0.0"
}
},
+ "scripts": {
+ "tsc": "cpy ../../src/label/index.d.ts ./ && tsc -d",
+ "build": "npm run tsc",
+ "build.watch": "npm run tsc -- -w",
+ "build.win": "npm run tsc-win",
+ "build.all": "npm run build",
+ "build.angular": "ng-packagr -p ../../src/label/angular/ng-package.json -c ../../src/label/angular/tsconfig.json && rm angular/.npmignore",
+ "clean": "rimraf ./*.d.ts ./*.js ./*.js.map"
+ },
"keywords": [
"NativeScript",
"JavaScript",
@@ -32,7 +41,7 @@
"license": "Apache-2.0",
"readmeFilename": "README.md",
"dependencies": {
- "@nativescript-community/text": "^1.6.3"
+ "@nativescript-community/text": "^1.6.6"
},
"gitHead": "a08eb50756c9a5d16fc8aa6ff7fba0051c71d1e0"
}
diff --git a/plugin/platforms/android/AndroidManifest.xml b/packages/label/platforms/android/AndroidManifest.xml
similarity index 100%
rename from plugin/platforms/android/AndroidManifest.xml
rename to packages/label/platforms/android/AndroidManifest.xml
diff --git a/plugin/platforms/android/include.gradle b/packages/label/platforms/android/include.gradle
similarity index 100%
rename from plugin/platforms/android/include.gradle
rename to packages/label/platforms/android/include.gradle
diff --git a/plugin/platforms/android/java/com/nativescript/label/NSLabel.java b/packages/label/platforms/android/java/com/nativescript/label/NSLabel.java
similarity index 100%
rename from plugin/platforms/android/java/com/nativescript/label/NSLabel.java
rename to packages/label/platforms/android/java/com/nativescript/label/NSLabel.java
diff --git a/plugin/platforms/android/native-api-usage.json b/packages/label/platforms/android/native-api-usage.json
similarity index 100%
rename from plugin/platforms/android/native-api-usage.json
rename to packages/label/platforms/android/native-api-usage.json
diff --git a/plugin/platforms/android/res/layout/ns_label.xml b/packages/label/platforms/android/res/layout/ns_label.xml
similarity index 100%
rename from plugin/platforms/android/res/layout/ns_label.xml
rename to packages/label/platforms/android/res/layout/ns_label.xml
diff --git a/plugin/platforms/ios/Podfile b/packages/label/platforms/ios/Podfile
similarity index 100%
rename from plugin/platforms/ios/Podfile
rename to packages/label/platforms/ios/Podfile
diff --git a/plugin/platforms/ios/src/NSLabel.swift b/packages/label/platforms/ios/src/NSLabel.swift
similarity index 100%
rename from plugin/platforms/ios/src/NSLabel.swift
rename to packages/label/platforms/ios/src/NSLabel.swift
diff --git a/plugin/platforms/ios/src/NSLabelUtils.swift b/packages/label/platforms/ios/src/NSLabelUtils.swift
similarity index 100%
rename from plugin/platforms/ios/src/NSLabelUtils.swift
rename to packages/label/platforms/ios/src/NSLabelUtils.swift
diff --git a/plugin/platforms/ios/src/NSTextView.swift b/packages/label/platforms/ios/src/NSTextView.swift
similarity index 100%
rename from plugin/platforms/ios/src/NSTextView.swift
rename to packages/label/platforms/ios/src/NSTextView.swift
diff --git a/plugin/platforms/ios/src/UILabelLinkHandler.swift b/packages/label/platforms/ios/src/UILabelLinkHandler.swift
similarity index 100%
rename from plugin/platforms/ios/src/UILabelLinkHandler.swift
rename to packages/label/platforms/ios/src/UILabelLinkHandler.swift
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
new file mode 100644
index 0000000..372bbfc
--- /dev/null
+++ b/pnpm-workspace.yaml
@@ -0,0 +1,3 @@
+packages:
+ - packages/*
+ - demo-*
\ No newline at end of file
diff --git a/references.d.ts b/references.d.ts
index 5918c48..e69de29 100644
--- a/references.d.ts
+++ b/references.d.ts
@@ -1,5 +0,0 @@
-///
-///
-///
-
-declare let __UI_LABEL_USE_LIGHT_FORMATTEDSTRING__: boolean;
diff --git a/src/label-common.ts b/src/label/index-common.ts
similarity index 88%
rename from src/label-common.ts
rename to src/label/index-common.ts
index 405f6cc..112f012 100644
--- a/src/label-common.ts
+++ b/src/label/index-common.ts
@@ -18,7 +18,7 @@ import {
booleanConverter,
fontInternalProperty
} from '@nativescript/core';
-import type { Label as LabelViewDefinition, LineBreak, TextShadow } from './label';
+import type { Label as LabelViewDefinition, LineBreak } from '.';
// declare module '@nativescript/core/ui/text-base/formatted-string' {
// interface FormattedString {
@@ -145,19 +145,3 @@ function parseDIPs(value: string): CoreTypes.dip {
return parseFloat(value.replace('dip', '').trim());
}
}
-
-export const textShadowProperty = new CssProperty