ember-native 2.2.0 → 2.2.1

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.
@@ -9,7 +9,7 @@ export declare function getViewMeta(elementName: string): {
9
9
  isUnaryTag: boolean;
10
10
  tagNamespace: string;
11
11
  canBeLeftOpenTag: boolean;
12
- component: null;
12
+ component: any;
13
13
  };
14
14
  export declare function isKnownView(elementName: string): any;
15
15
  export declare function createElement<T extends keyof NativeElementsTagNameMap>(elementName: T): NativeElementsTagNameMap[T];
@@ -12,8 +12,8 @@ export default class NativeElementNode<T extends ViewBase | null = ViewBase> ext
12
12
  _meta: ComponentMeta;
13
13
  constructor(tagName: string, viewClass: typeof View | null, meta?: ComponentMeta | null);
14
14
  setStyle(property: string, value: string | number | null): void;
15
- get style(): import("@nativescript/core").Style | undefined;
16
- set style(v: import("@nativescript/core").Style | undefined);
15
+ get style(): import("@nativescript/core").Style;
16
+ set style(v: import("@nativescript/core").Style);
17
17
  updateText(): void;
18
18
  get nativeView(): T;
19
19
  set nativeView(view: T);
@@ -44,5 +44,5 @@ export default class NativeElementNode<T extends ViewBase | null = ViewBase> ext
44
44
  width: number;
45
45
  height: number;
46
46
  right?: undefined;
47
- } | null;
47
+ };
48
48
  }
@@ -42,9 +42,9 @@ export default class DocumentNode extends ViewNode {
42
42
  bottom: any;
43
43
  width: any;
44
44
  height: any;
45
- } | null;
45
+ };
46
46
  };
47
47
  querySelectorAll(selector: string): {
48
48
  getAttribute(): string;
49
- } | undefined;
49
+ };
50
50
  }
@@ -6,4 +6,6 @@ export default class TextNode extends ViewNode {
6
6
  set parentNode(node: ViewNode | null);
7
7
  get parentNode(): ViewNode | null;
8
8
  setText(text: string): void;
9
+ get nodeValue(): string;
10
+ set nodeValue(value: string);
9
11
  }
@@ -38,7 +38,7 @@ export default class ViewNode {
38
38
  removeChild(childNode: ViewNode): void;
39
39
  clear(node: any): void;
40
40
  removeChildren(): void;
41
- firstElement(): ViewNode | null;
41
+ firstElement(): ViewNode;
42
42
  getBoundingClientRect(): {
43
43
  left: number;
44
44
  top: number;
@@ -1,7 +1,7 @@
1
1
  import ApplicationInstance from '@ember/application/instance';
2
2
  declare const Initializer: {
3
3
  name: string;
4
- after: never[];
4
+ after: any[];
5
5
  initialize(application: ApplicationInstance): void;
6
6
  };
7
7
  export default Initializer;
@@ -14,7 +14,7 @@ class InspectorSupport extends Component {
14
14
  constructor(...args) {
15
15
  super(...args);
16
16
  _defineProperty(this, "setupInspector", () => {
17
- let i = setInterval(() => {
17
+ const i = setInterval(() => {
18
18
  const viewInspection = globalThis.EmberInspector?.viewDebug?.viewInspection;
19
19
  if (viewInspection && this.tooltip) {
20
20
  this.tooltip.querySelector = () => {
@@ -30,6 +30,12 @@ class TextNode extends ViewNode {
30
30
  this.parentNode.updateText();
31
31
  }
32
32
  }
33
+ get nodeValue() {
34
+ return this.text;
35
+ }
36
+ set nodeValue(value) {
37
+ this.setText(value);
38
+ }
33
39
  }
34
40
 
35
41
  export { TextNode as default };
@@ -17,7 +17,7 @@ let HistoryService = (_dec = service('ember-native/native-router'), _class = cla
17
17
  });
18
18
  _defineProperty(this, "back", () => {
19
19
  const h = this.stack.pop();
20
- if (h && h.from) {
20
+ if (h?.from) {
21
21
  const from = h.from;
22
22
  this.stack = [...this.stack];
23
23
  const transition = this.nativeRouter.transitionTo(from.name, from.params?.['model'], {
package/dist/setup.js CHANGED
@@ -25,14 +25,14 @@ function setup() {
25
25
  };
26
26
  }
27
27
  handleBackburnerErrors();
28
- SimpleDynamicAttribute.prototype.set = function (dom, value, _env) {
28
+ SimpleDynamicAttribute.prototype.set = function (dom, value) {
29
29
  const {
30
30
  name,
31
31
  namespace
32
32
  } = this.attribute;
33
33
  dom.__setAttribute(name, value, namespace);
34
34
  };
35
- SimpleDynamicAttribute.prototype.update = function (value, _env) {
35
+ SimpleDynamicAttribute.prototype.update = function (value) {
36
36
  const normalizedValue = value;
37
37
  const {
38
38
  element: element,
@@ -1,7 +1,6 @@
1
1
  import { parse, type PluginObj } from '@babel/core';
2
- import type * as BabelTypesNamespace from '@babel/types';
3
- import type { Program, Statement } from '@babel/types';
4
2
  import type * as Babel from '@babel/core';
3
+ import type { types } from '@babel/core';
5
4
  import * as glimmer from '@glimmer/syntax';
6
5
  import { ASTv1, type NodeVisitor, WalkerPath } from '@glimmer/syntax';
7
6
  import { ImportUtil } from 'babel-import-util';
@@ -25,7 +24,7 @@ class HotAstProcessor {
25
24
  locals: Set<string>;
26
25
  importVar: any;
27
26
  importBindings: Set<string>;
28
- babelProgram?: Program;
27
+ babelProgram?: types.Program;
29
28
  };
30
29
  didCreateImportClass: boolean = false;
31
30
 
@@ -82,7 +81,7 @@ class HotAstProcessor {
82
81
  }: {
83
82
  importVar: string;
84
83
  importBindings: Set<string>;
85
- babelProgram: Program;
84
+ babelProgram: types.Program;
86
85
  }) {
87
86
  const findImport = function findImport(specifier: string) {
88
87
  return babelProgram.body.find(
@@ -127,7 +126,7 @@ class HotAstProcessor {
127
126
  ) {
128
127
  return;
129
128
  }
130
- const original = node.original.split('.')[0]!;
129
+ const original = node.original.split('.')[0];
131
130
  if (original === 'this') return;
132
131
  if (original.startsWith('@')) return;
133
132
  if (original === 'block') return;
@@ -171,7 +170,7 @@ class HotAstProcessor {
171
170
  element: ASTv1.ElementNode,
172
171
  p: WalkerPath<ASTv1.ElementNode>,
173
172
  ) => {
174
- const original = element.tag.split('.')[0]!;
173
+ const original = element.tag.split('.')[0];
175
174
  if (findBlockParams(original, p)) return;
176
175
  if (importVar) {
177
176
  if (findImport(original)) {
@@ -208,8 +207,8 @@ export default function hotReplaceAst(babel: typeof Babel) {
208
207
  if (state.filename?.includes('node_modules')) {
209
208
  return;
210
209
  }
211
- const util = new ImportUtil(babel, path);
212
- const tracked = util.import(path, '@glimmer/tracking', 'tracked');
210
+ const util = new ImportUtil(babel as any, path as any);
211
+ const tracked = util.import(path as any, '@glimmer/tracking', 'tracked');
213
212
  const klass = t.classExpression(
214
213
  path.scope.generateUidIdentifier('Imports'),
215
214
  null,
@@ -233,22 +232,22 @@ export default function hotReplaceAst(babel: typeof Babel) {
233
232
 
234
233
  const varDeclaration =
235
234
  path.node.body.findIndex(
236
- (e: BabelTypesNamespace.Statement) =>
235
+ (e) =>
237
236
  e.type === 'VariableDeclaration' &&
238
- (e.declarations[0]!.id as BabelTypesNamespace.Identifier).name ===
237
+ (e.declarations[0].id as any).name ===
239
238
  hotAstProcessor.meta.importVar,
240
239
  ) + 1;
241
240
 
242
241
  const lastImportIndex =
243
242
  [...path.node.body].findLastIndex(
244
- (e: BabelTypesNamespace.Statement) =>
243
+ (e) =>
245
244
  e.type === 'ImportDeclaration',
246
245
  ) + 1;
247
246
 
248
247
  path.node.body.splice(
249
248
  Math.max(varDeclaration, lastImportIndex),
250
249
  0,
251
- assign as unknown as Statement,
250
+ assign as any,
252
251
  );
253
252
 
254
253
  const findImport = function findImport(specifier: string) {
@@ -263,7 +262,7 @@ export default function hotReplaceAst(babel: typeof Babel) {
263
262
  for (const imp of bindings) {
264
263
  const importDeclaration = findImport(
265
264
  imp,
266
- ) as BabelTypesNamespace.ImportDeclaration;
265
+ ) as any;
267
266
  if (!importDeclaration) {
268
267
  console.log('could not find import for ', imp);
269
268
  continue;
@@ -281,7 +280,7 @@ export default function hotReplaceAst(babel: typeof Babel) {
281
280
  configFile: false,
282
281
  },
283
282
  );
284
- const accept = ast!.program.body;
283
+ const accept = ast.program.body;
285
284
  ifHotStatements.push(...accept);
286
285
  }
287
286
  const ifHot = t.ifStatement(
@@ -291,7 +290,7 @@ export default function hotReplaceAst(babel: typeof Babel) {
291
290
  ),
292
291
  t.blockStatement([...ifHotStatements]),
293
292
  );
294
- path.node.body.push(ifHot);
293
+ path.node.body.push(ifHot as any);
295
294
  path.scope.crawl();
296
295
  },
297
296
  },
@@ -1,3 +1,7 @@
1
- export const DEBUG = true;
2
- export const CI = false;
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLEtBQUssQ0FBQztBQUMzQixNQUFNLENBQUMsTUFBTSxFQUFFLEdBQUcsS0FBSyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IERFQlVHID0gZmFsc2U7XG5leHBvcnQgY29uc3QgQ0kgPSBmYWxzZTtcbiJdfQ==
1
+ const DEBUG = true;
2
+ const CI = false;
3
+
4
+ module.exports = {
5
+ DEBUG,
6
+ CI,
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-native",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "the Ember framework with Nativescript",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -29,18 +29,18 @@
29
29
  "loader.js": "*"
30
30
  },
31
31
  "dependencies": {
32
- "@babel/core": "^7.27.3",
32
+ "@babel/core": "^7.27.7",
33
33
  "@babel/plugin-syntax-decorators": "^7.22.5",
34
34
  "@ember/render-modifiers": "^3.0.0",
35
35
  "@ember/string": "^4.0.0",
36
- "@ember/test-waiters": "^4.0.0",
36
+ "@ember/test-waiters": "^4.1.1",
37
37
  "@embroider/addon-shim": "^1.10.0",
38
- "@eslint/js": "^9.26.0",
38
+ "@eslint/js": "^9.28.0",
39
39
  "@glimmer/component": "^2.0.0",
40
40
  "@glimmer/tracking": "^1.1.2",
41
41
  "@rollup/plugin-alias": "^5.1.0",
42
42
  "@rollup/plugin-node-resolve": "^16.0.1",
43
- "@types/node": "^22.9.1",
43
+ "@types/node": "^24.1.0",
44
44
  "astroturf": "^1.2.0",
45
45
  "ember-cli-babel": "^8.2.0",
46
46
  "ember-cli-htmlbars": "^6.2.0",
@@ -57,26 +57,26 @@
57
57
  "rollup-plugin-styles": "^4.0.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@babel/types": "^7.27.3",
60
+ "@babel/types": "^7.28.5",
61
61
  "@ember/optional-features": "^2.0.0",
62
- "@embroider/addon-dev": "^8.0.1",
62
+ "@embroider/addon-dev": "^8.1.0",
63
63
  "@embroider/compat": "^4.1.0",
64
- "@embroider/core": "^4.1.0",
65
- "@embroider/macros": "^1.16.9",
64
+ "@embroider/core": "^4.1.1",
65
+ "@embroider/macros": "^1.18.1",
66
66
  "@embroider/shared-internals": "^3.0.0",
67
- "@embroider/util": "^1.13.2",
68
- "@embroider/webpack": "^4.1.0",
67
+ "@embroider/util": "^1.13.3",
68
+ "@embroider/webpack": "^4.1.1",
69
69
  "@glimmer/interfaces": "^0.94.6",
70
70
  "@glimmer/reference": "^0.94.8",
71
71
  "@glimmer/runtime": "^0.94.10",
72
72
  "@glimmer/syntax": "^0.94.9",
73
- "@glimmer/validator": "^0.94.8",
73
+ "@glimmer/validator": "^0.95.0",
74
74
  "@glint/core": "^1.5.0",
75
75
  "@glint/environment-ember-loose": "^1.5.0",
76
76
  "@glint/environment-ember-template-imports": "^1.5.0",
77
77
  "@glint/template": "^1.5.0",
78
- "@nativescript/core": "^8.9.2",
79
- "@release-it-plugins/lerna-changelog": "^7.0.0",
78
+ "@nativescript/core": "^8.9.7",
79
+ "@release-it-plugins/lerna-changelog": "^8.0.1",
80
80
  "@rollup/plugin-babel": "^6.0.3",
81
81
  "@tsconfig/ember": "^3.0.8",
82
82
  "@types/babel__core": "^7.20.5",
@@ -84,44 +84,45 @@
84
84
  "@types/qunit": "^2.19.5",
85
85
  "@types/qunit-dom": "^0.7.0",
86
86
  "@typescript-eslint/eslint-plugin": "^8.13.0",
87
- "@typescript-eslint/parser": "^8.13.0",
87
+ "@typescript-eslint/parser": "^8.38.0",
88
88
  "babel-import-util": "^3.0.0",
89
89
  "babel-plugin-ember-template-compilation": "^3.0.0",
90
90
  "bower": "^1.8.8",
91
+ "globals": "^16.5.0",
91
92
  "broccoli": "^3.4.2",
92
93
  "broccoli-asset-rev": "^3.0.0",
93
- "concurrently": "^9.1.2",
94
+ "concurrently": "^9.2.0",
94
95
  "content-tag": "^4.0.0",
95
96
  "css-loader": "^7.1.2",
96
97
  "ember-eslint-parser": "^0.5.9",
97
98
  "ember-modifier": "^4.2.0",
98
- "ember-source": "^6.4.0",
99
- "ember-template-lint": "^7.7.0",
100
- "eslint": "^8.57.0",
99
+ "ember-source": "^6.6.0",
100
+ "ember-template-lint": "^7.9.1",
101
+ "eslint": "^9.27.0",
101
102
  "eslint-config-airbnb-base": "^15.0.0",
102
- "eslint-config-prettier": "^10.1.5",
103
+ "eslint-config-prettier": "^10.1.8",
103
104
  "eslint-plugin-ember": "^12.3.1",
104
105
  "eslint-plugin-ember-template-lint": "^0.21.0",
105
- "eslint-plugin-n": "^17.18.0",
106
+ "eslint-plugin-n": "^17.21.3",
106
107
  "eslint-plugin-node": "^11.1.0",
107
- "eslint-plugin-prettier": "^5.1.3",
108
+ "eslint-plugin-prettier": "^5.5.4",
108
109
  "eslint-plugin-qunit": "^8.1.1",
109
110
  "fix-bad-declaration-output": "^1.1.4",
110
111
  "loader.js": "^4.7.0",
111
112
  "nativescript-ui-listview": "^15.2.3",
112
- "prettier": "^3.3.2",
113
- "prettier-plugin-ember-template-tag": "^2.0.4",
113
+ "prettier": "^3.6.2",
114
+ "prettier-plugin-ember-template-tag": "^2.1.0",
114
115
  "qunit": "^2.19.4",
115
116
  "qunit-dom": "^3.4.0",
116
117
  "release-it": "^15.10.3",
117
- "rollup": "^4.41.1",
118
+ "rollup": "^4.46.3",
118
119
  "rollup-plugin-copy": "^3.4.0",
119
120
  "router_js": "^8.0.6",
120
- "sass": "^1.81.0",
121
- "sass-embedded": "^1.88.0",
121
+ "sass": "^1.89.2",
122
+ "sass-embedded": "^1.90.0",
122
123
  "sass-loader": "^16.0.4",
123
- "typescript": "^5.6.3",
124
- "typescript-plugin-css-modules": "^5.0.1",
124
+ "typescript": "^5.9.2",
125
+ "typescript-plugin-css-modules": "^5.2.0",
125
126
  "yui": "^3.18.1"
126
127
  },
127
128
  "publishConfig": {
@@ -0,0 +1,42 @@
1
+ declare module '*.scss';
2
+
3
+ type AnyFunction = (...args: any) => any;
4
+
5
+ // Add global functions
6
+ declare global {
7
+ const __inspectorSendEvent: AnyFunction;
8
+ const __decorate: AnyFunction;
9
+ const __metadata: AnyFunction;
10
+ }
11
+
12
+ declare namespace globalThis {
13
+ const __inspectorSendEvent: AnyFunction;
14
+ const __decorate: AnyFunction;
15
+ const __metadata: AnyFunction;
16
+ }
17
+
18
+ // Add properties to globalThis
19
+ interface Window {
20
+ define: AnyFunction;
21
+ requirejs: AnyFunction;
22
+ requireModule: AnyFunction;
23
+ Element: any;
24
+ Node: any;
25
+ __metadata: AnyFunction;
26
+ __decorate: AnyFunction;
27
+ __inspectorSendEvent: AnyFunction;
28
+ emberDebugInjected: boolean;
29
+ MessageChannel: MessageChannel;
30
+ postMessage: AnyFunction;
31
+ triggerEvent: AnyFunction;
32
+ EmberInspector: any;
33
+ }
34
+
35
+ interface Document {
36
+ nodeMap: any;
37
+ }
38
+
39
+ declare module 'loader.js' {
40
+ const require: AnyFunction;
41
+ const define: AnyFunction;
42
+ }
@@ -1,56 +0,0 @@
1
- declare module '*.scss';
2
- type AnyFunction = (...args: any) => any;
3
- declare namespace globalThis {
4
- var define: AnyFunction;
5
- var requirejs: AnyFunction;
6
- var requireModule: AnyFunction;
7
- var Element: import('../dom/nodes/ElementNode.ts').default;
8
- var Node: import('../dom/nodes/ElementNode.ts').default;
9
- var __metadata: AnyFunction;
10
- var __decorate: AnyFunction;
11
- var __inspectorSendEvent: AnyFunction;
12
- var emberDebugInjected: boolean;
13
- var MessageChannel: MessageChannel;
14
- var postMessage: AnyFunction;
15
- var triggerEvent: AnyFunction;
16
- var EmberInspector: any;
17
- }
18
- interface Document {
19
- nodeMap: any;
20
- }
21
- declare module 'loader.js' {
22
- const require: AnyFunction;
23
- const define: AnyFunction;
24
- }
25
- interface HTMLElementTagNameMap {
26
- 'rad-list-view': import('../dom/native/NativeElementNode').default<import('nativescript-ui-listview').RadListView>;
27
- 'list-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ListView>;
28
- 'html-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').HtmlView>;
29
- 'scroll-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ScrollView>;
30
- 'text-field': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TextField>;
31
- 'text-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TextView>;
32
- 'web-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').WebView>;
33
- 'content-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ContentView>;
34
- 'tab-view': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TabView>;
35
- 'tab-view-item': import('../dom/native/NativeElementNode').default<import('@nativescript/core').TabViewItem>;
36
- switch: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Switch>;
37
- 'formatted-string': import('../dom/native/NativeElementNode').default<import('@nativescript/core').FormattedString>;
38
- frame: import('../dom/native/FrameElement.ts').default;
39
- page: import('../dom/native/PageElement.ts').default;
40
- span: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Span>;
41
- 'action-bar': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ActionBar>;
42
- 'action-item': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ActionItem>;
43
- comment: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Placeholder>;
44
- button: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Button>;
45
- 'navigation-button': import('../dom/native/NativeElementNode').default<import('@nativescript/core').NavigationButton>;
46
- image: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Image>;
47
- label: import('../dom/native/NativeElementNode').default<import('@nativescript/core').Label>;
48
- 'list-picker': import('../dom/native/NativeElementNode').default<import('@nativescript/core').ListPicker>;
49
- 'date-picker': import('../dom/native/NativeElementNode').default<import('@nativescript/core').DatePicker>;
50
- 'dock-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').DockLayout>;
51
- 'wrap-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').WrapLayout>;
52
- 'stack-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').StackLayout>;
53
- 'grid-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').GridLayout>;
54
- 'flexbox-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').FlexboxLayout>;
55
- 'absolute-layout': import('../dom/native/NativeElementNode').default<import('@nativescript/core').AbsoluteLayout>;
56
- }
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=globals.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"globals.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}