nativescript-vue 3.0.3 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +37 -2
  2. package/devtools.js +100 -24
  3. package/dist/components/ActionBar.js +1 -1
  4. package/dist/components/ActionBar.js.map +1 -1
  5. package/dist/components/ListView.d.ts +9 -3
  6. package/dist/components/ListView.js +46 -14
  7. package/dist/components/ListView.js.map +1 -1
  8. package/dist/components/Platform.d.ts +8 -0
  9. package/dist/components/Platform.js +15 -0
  10. package/dist/components/Platform.js.map +1 -0
  11. package/dist/components/index.d.ts +16 -5
  12. package/dist/components/index.js +4 -1
  13. package/dist/components/index.js.map +1 -1
  14. package/dist/directives/vShow.js.map +1 -1
  15. package/dist/dom/index.d.ts +14 -1
  16. package/dist/dom/index.js +58 -19
  17. package/dist/dom/index.js.map +1 -1
  18. package/dist/index.d.ts +6 -2
  19. package/dist/index.js +52 -6
  20. package/dist/index.js.map +1 -1
  21. package/dist/nativescript/elements.js +61 -43
  22. package/dist/nativescript/elements.js.map +1 -1
  23. package/dist/nativescript/index.js.map +1 -1
  24. package/dist/plugins/modals.d.ts +4 -1
  25. package/dist/plugins/modals.js +85 -15
  26. package/dist/plugins/modals.js.map +1 -1
  27. package/dist/plugins/navigation.d.ts +7 -2
  28. package/dist/plugins/navigation.js +45 -7
  29. package/dist/plugins/navigation.js.map +1 -1
  30. package/dist/registry/index.js.map +1 -1
  31. package/dist/renderer/index.js.map +1 -1
  32. package/dist/renderer/modules/attrs.js +27 -8
  33. package/dist/renderer/modules/attrs.js.map +1 -1
  34. package/dist/renderer/modules/class.js.map +1 -1
  35. package/dist/renderer/modules/events.js +0 -1
  36. package/dist/renderer/modules/events.js.map +1 -1
  37. package/dist/renderer/modules/style.js +13 -16
  38. package/dist/renderer/modules/style.js.map +1 -1
  39. package/dist/renderer/nodeOps.js.map +1 -1
  40. package/dist/renderer/patchProp.js +38 -16
  41. package/dist/renderer/patchProp.js.map +1 -1
  42. package/dist/renderer/runtimeDomOverrides.d.ts +11 -0
  43. package/dist/renderer/runtimeDomOverrides.js +23 -0
  44. package/dist/renderer/runtimeDomOverrides.js.map +1 -1
  45. package/dist/runtimeHelpers.d.ts +12 -1
  46. package/dist/runtimeHelpers.js +27 -3
  47. package/dist/runtimeHelpers.js.map +1 -1
  48. package/dist/util/logger.js.map +1 -1
  49. package/nativescript.webpack.js +199 -54
  50. package/package.json +49 -19
  51. package/dist/compiler-sfc/index.d.ts +0 -1
  52. package/dist/compiler-sfc/index.js +0 -2
  53. package/dist/compiler-sfc/index.js.map +0 -1
  54. package/dist/compiler.d.ts +0 -4
  55. package/dist/compiler.js +0 -32
  56. package/dist/compiler.js.map +0 -1
  57. package/dist/directives/vModel.d.ts +0 -8
  58. package/dist/directives/vModel.js +0 -38
  59. package/dist/directives/vModel.js.map +0 -1
  60. package/dist/plugins/templates.d.ts +0 -10
  61. package/dist/plugins/templates.js +0 -12
  62. package/dist/plugins/templates.js.map +0 -1
  63. package/dist/types.d.ts +0 -15
  64. package/dist/types.js +0 -2
  65. package/dist/types.js.map +0 -1
  66. package/dist/withCompiler.d.ts +0 -3
  67. package/dist/withCompiler.js +0 -6
  68. package/dist/withCompiler.js.map +0 -1
package/package.json CHANGED
@@ -1,40 +1,65 @@
1
1
  {
2
2
  "name": "nativescript-vue",
3
- "version": "3.0.3",
3
+ "version": "3.1.0",
4
+ "description": "Vue 3 renderer for NativeScript",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/nativescript-vue/nativescript-vue.git"
9
+ },
10
+ "homepage": "https://nativescript-vue.org",
11
+ "bugs": "https://github.com/nativescript-vue/nativescript-vue/issues",
12
+ "keywords": [
13
+ "nativescript",
14
+ "vue",
15
+ "vue3",
16
+ "renderer",
17
+ "ios",
18
+ "android"
19
+ ],
4
20
  "main": "dist/index.js",
21
+ "types": "dist/index.d.ts",
5
22
  "files": [
6
23
  "dist/",
7
24
  "devtools.js",
8
25
  "nativescript.webpack.js"
9
26
  ],
10
- "license": "MIT",
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
11
30
  "scripts": {
12
- "build": "tsc",
31
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
32
+ "build": "npm run clean && tsc",
33
+ "typecheck": "tsc --noEmit",
13
34
  "format": "prettier --write .",
14
35
  "format:check": "prettier --check .",
15
36
  "prepare": "simple-git-hooks",
16
- "pack:template": "npm pack ./packages/template-blank",
17
- "prepack": "npm run build && npm run pack:template"
37
+ "prepack": "npm run build",
38
+ "test": "vitest run",
39
+ "test:watch": "vitest",
40
+ "release": "node scripts/release.mjs"
18
41
  },
19
42
  "dependencies": {
20
- "@vue/compiler-sfc": "^3.5.41",
21
- "@vue/devtools": "^6.5.1",
22
- "@vue/runtime-core": "^3.5.41",
23
- "@vue/shared": "^3.5.41",
24
- "cross-spawn": "^7.0.6",
43
+ "@vue/compiler-sfc": "^3.5.42",
44
+ "@vue/runtime-core": "^3.5.42",
45
+ "@vue/shared": "^3.5.42",
25
46
  "set-value": "^4.1.0",
26
47
  "vue-loader": "^17.4.2"
27
48
  },
49
+ "peerDependencies": {
50
+ "@nativescript/core": ">=8.9.0",
51
+ "@vue/devtools": "^8.0.0"
52
+ },
28
53
  "devDependencies": {
29
- "@commitlint/cli": "^20.1.0",
30
- "@commitlint/config-conventional": "^20.0.0",
31
- "@nativescript/core": "~8.9.2",
32
- "@nativescript/webpack": "~5.0.24",
33
- "esbuild": "^0.25.5",
34
- "lint-staged": "^16.1.0",
35
- "prettier": "^3.5.3",
36
- "simple-git-hooks": "^2.11.1",
37
- "typescript": "^5.8.3"
54
+ "@commitlint/cli": "^21.2.2",
55
+ "@commitlint/config-conventional": "^21.2.2",
56
+ "@nativescript/core": "~9.1.1",
57
+ "@nativescript/webpack": "~5.0.38",
58
+ "lint-staged": "^17.5.1",
59
+ "prettier": "^3.9.6",
60
+ "simple-git-hooks": "^2.14.0",
61
+ "typescript": "^7.0.2",
62
+ "vitest": "^5.0.0"
38
63
  },
39
64
  "simple-git-hooks": {
40
65
  "pre-commit": "npx --no-install lint-staged --config=package.json",
@@ -48,5 +73,10 @@
48
73
  "prettier": {
49
74
  "useTabs": false,
50
75
  "singleQuote": true
76
+ },
77
+ "peerDependenciesMeta": {
78
+ "@vue/devtools": {
79
+ "optional": true
80
+ }
51
81
  }
52
82
  }
@@ -1 +0,0 @@
1
- export * from "@vue/compiler-sfc";
@@ -1,2 +0,0 @@
1
- export * from "@vue/compiler-sfc";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compiler-sfc/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -1,4 +0,0 @@
1
- import { CompilerOptions } from "@vue/compiler-dom";
2
- import { RenderFunction } from "@vue/runtime-core";
3
- export declare function compileToFunction(template: string, options?: CompilerOptions): RenderFunction;
4
- export { compileToFunction as compile };
package/dist/compiler.js DELETED
@@ -1,32 +0,0 @@
1
- import { compile } from "@vue/compiler-dom";
2
- import { warn } from "@vue/runtime-core";
3
- import * as runtime from "./index";
4
- const NOOP = () => { };
5
- const compileCache = Object.create(null);
6
- export function compileToFunction(template, options) {
7
- if (typeof template !== "string") {
8
- warn("invalid template option: ", template);
9
- return NOOP;
10
- }
11
- const key = template;
12
- const cached = compileCache[key];
13
- if (cached) {
14
- return cached;
15
- }
16
- const { code } = compile(template, {
17
- isNativeTag: (tag) => true,
18
- hoistStatic: true,
19
- prefixIdentifiers: true,
20
- onWarn(warn) {
21
- console.warn("Template Compile Warning", warn);
22
- },
23
- onError(err) {
24
- console.error("Template Compile Error", err);
25
- },
26
- ...options,
27
- });
28
- const render = new Function("Vue", code)(runtime);
29
- return (compileCache[key] = render);
30
- }
31
- export { compileToFunction as compile };
32
- //# sourceMappingURL=compiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiler.js","sourceRo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,OAAO,EAC7B,CAAA"}
@@ -1,8 +0,0 @@
1
- import { ObjectDirective } from "@vue/runtime-core";
2
- import { NSVElement } from "../dom";
3
- type AssignerFn = (value: any) => void;
4
- type ModelDirective<T> = ObjectDirective<T & {
5
- _assign: AssignerFn;
6
- }>;
7
- export declare const vModel: ModelDirective<NSVElement>;
8
- export {};
@@ -1,38 +0,0 @@
1
- import { invokeArrayFns, isArray } from "@vue/shared";
2
- import { getViewMeta } from "../registry";
3
- const getModelAssigner = (vnode) => {
4
- const fn = vnode.props["onUpdate:modelValue"];
5
- return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
6
- };
7
- function toNumber(val) {
8
- const n = parseFloat(val);
9
- return isNaN(n) ? val : n;
10
- }
11
- export const vModel = {
12
- beforeMount(el, { value, modifiers: { trim, number } }, vnode) {
13
- el._assign = getModelAssigner(vnode);
14
- const castToNumber = number;
15
- const { prop, event } = getViewMeta(el.tagName).model;
16
- el._assign(value);
17
- el.setAttribute(prop, value);
18
- el.addEventListener(event, () => {
19
- let propValue = el.getAttribute(prop);
20
- if (trim && typeof propValue === "string") {
21
- propValue = propValue.trim();
22
- }
23
- else if (castToNumber && typeof propValue === "string") {
24
- propValue = toNumber(propValue);
25
- }
26
- el._assign(propValue);
27
- });
28
- },
29
- beforeUpdate(el, { value, oldValue }, vnode) {
30
- const { prop } = getViewMeta(el.tagName).model;
31
- el._assign = getModelAssigner(vnode);
32
- if (value === oldValue) {
33
- return;
34
- }
35
- el.setAttribute(prop, value);
36
- },
37
- };
38
- //# sourceMappingURL=vModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vModel.js","sourceRoot":"","sources":["../../src/directives/vModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAI9D,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAc,EAAE;IACpD,MAAM,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EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,KAA2B,CAAC;QACrE,EAAE,CAAC,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,KAAK,KAAK,QAAQ,EAAE;YACtB,OAAO;SACR;QACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC"}
@@ -1,10 +0,0 @@
1
- import { App } from '@vue/runtime-core';
2
- declare module '@vue/runtime-core' {
3
- interface ComponentCustomProperties {
4
- $templates: any;
5
- }
6
- }
7
- /**
8
- * @internal
9
- */
10
- export declare function install(app: App): void;
@@ -1,12 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- export function install(app) {
5
- app.config.globalProperties.$templates = {
6
- getKeyedTemplates() { },
7
- selectorFn() { },
8
- patchTemplate(name, context, oldVnode) { },
9
- registerTemplate() { }
10
- };
11
- }
12
- //# sourceMappingURL=templates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/plugins/templates.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,GAAQ;IAC9B,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,GAAG;QACvC,iBAAiB,KAAI,CAAC;QACtB,UAAU,KAAI,CAAC;QACf,aAAa,CAAC,IAAY,EAAE,OAAY,EAAE,QAAe,IAAG,CAAC;QAC7D,gBAAgB,KAAI,CAAC;KACtB,CAAC;AACJ,CAAC"}
package/dist/types.d.ts DELETED
@@ -1,15 +0,0 @@
1
- declare module '@vue/runtime-core' {
2
- interface GlobalComponents {
3
- Frame: DefineComponent<{}>;
4
- Page: DefineComponent;
5
- StackLayout: DefineComponent;
6
- GridLayout: DefineComponent;
7
- Label: DefineComponent<{
8
- text?: unknown;
9
- }>;
10
- Button: DefineComponent<{
11
- text?: unknown;
12
- }>;
13
- }
14
- }
15
- export {};
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { compileToFunction } from "./compiler";
2
- export { compileToFunction as compile };
3
- export * from "./index";
@@ -1,6 +0,0 @@
1
- import { registerRuntimeCompiler } from "@vue/runtime-core";
2
- import { compileToFunction } from "./compiler";
3
- registerRuntimeCompiler(compileToFunction);
4
- export { compileToFunction as compile };
5
- export * from "./index";
6
- //# sourceMappingURL=withCompiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withCompiler.js","sourceRoot":"","sources":["../src/withCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AAE3C,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,CAAC;AACxC,cAAc,SAAS,CAAC"}