ember-native 1.0.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 (116) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +16 -0
  3. package/addon-main.cjs +4 -0
  4. package/declarations/components/InspectorSupport.d.ts +32 -0
  5. package/declarations/components/InspectorSupport.d.ts.map +1 -0
  6. package/declarations/components/ListView.d.ts +31 -0
  7. package/declarations/components/ListView.d.ts.map +1 -0
  8. package/declarations/components/RadListView.d.ts +41 -0
  9. package/declarations/components/RadListView.d.ts.map +1 -0
  10. package/declarations/components/index.d.ts +4 -0
  11. package/declarations/components/index.d.ts.map +1 -0
  12. package/declarations/dom/element-registry.d.ts +16 -0
  13. package/declarations/dom/element-registry.d.ts.map +1 -0
  14. package/declarations/dom/native/FrameElement.d.ts +16 -0
  15. package/declarations/dom/native/FrameElement.d.ts.map +1 -0
  16. package/declarations/dom/native/NativeElementNode.d.ts +41 -0
  17. package/declarations/dom/native/NativeElementNode.d.ts.map +1 -0
  18. package/declarations/dom/native/PageElement.d.ts +6 -0
  19. package/declarations/dom/native/PageElement.d.ts.map +1 -0
  20. package/declarations/dom/native-elements-tag-name-map.d.ts +10 -0
  21. package/declarations/dom/native-elements-tag-name-map.d.ts.map +1 -0
  22. package/declarations/dom/nodes/CommentNode.d.ts +7 -0
  23. package/declarations/dom/nodes/CommentNode.d.ts.map +1 -0
  24. package/declarations/dom/nodes/DocumentNode.d.ts +47 -0
  25. package/declarations/dom/nodes/DocumentNode.d.ts.map +1 -0
  26. package/declarations/dom/nodes/ElementNode.d.ts +18 -0
  27. package/declarations/dom/nodes/ElementNode.d.ts.map +1 -0
  28. package/declarations/dom/nodes/PropertyNode.d.ts +13 -0
  29. package/declarations/dom/nodes/PropertyNode.d.ts.map +1 -0
  30. package/declarations/dom/nodes/TextNode.d.ts +10 -0
  31. package/declarations/dom/nodes/TextNode.d.ts.map +1 -0
  32. package/declarations/dom/nodes/ViewNode.d.ts +49 -0
  33. package/declarations/dom/nodes/ViewNode.d.ts.map +1 -0
  34. package/declarations/dom/setup-registry.d.ts +5 -0
  35. package/declarations/dom/setup-registry.d.ts.map +1 -0
  36. package/declarations/index.d.ts +4 -0
  37. package/declarations/index.d.ts.map +1 -0
  38. package/declarations/instance-initializers/history.d.ts +8 -0
  39. package/declarations/instance-initializers/history.d.ts.map +1 -0
  40. package/declarations/services/history.d.ts +9 -0
  41. package/declarations/services/history.d.ts.map +1 -0
  42. package/declarations/services/native-router.d.ts +12 -0
  43. package/declarations/services/native-router.d.ts.map +1 -0
  44. package/declarations/setup-inspector-support.d.ts +2 -0
  45. package/declarations/setup-inspector-support.d.ts.map +1 -0
  46. package/declarations/setup.d.ts +2 -0
  47. package/declarations/setup.d.ts.map +1 -0
  48. package/declarations/types/glint.d.ts +47 -0
  49. package/declarations/types/glint.d.ts.map +1 -0
  50. package/declarations/types/globals.d.ts +32 -0
  51. package/declarations/types/globals.d.ts.map +1 -0
  52. package/dist/_app_/components/ember-native/InspectorSupport.js +1 -0
  53. package/dist/_app_/components/ember-native/ListView.js +1 -0
  54. package/dist/_app_/components/ember-native/RadListView.js +1 -0
  55. package/dist/_app_/components/ember-native/index.js +1 -0
  56. package/dist/_app_/instance-initializers/ember-native/history.js +1 -0
  57. package/dist/_app_/services/ember-native/history.js +1 -0
  58. package/dist/_app_/services/ember-native/native-router.js +1 -0
  59. package/dist/_rollupPluginBabelHelpers-DZQzmiRH.js +41 -0
  60. package/dist/_rollupPluginBabelHelpers-DZQzmiRH.js.map +1 -0
  61. package/dist/components/InspectorSupport.js +75 -0
  62. package/dist/components/InspectorSupport.js.map +1 -0
  63. package/dist/components/ListView.js +69 -0
  64. package/dist/components/ListView.js.map +1 -0
  65. package/dist/components/RadListView.js +104 -0
  66. package/dist/components/RadListView.js.map +1 -0
  67. package/dist/components/index.js +4 -0
  68. package/dist/components/index.js.map +1 -0
  69. package/dist/dom/element-registry.js +65 -0
  70. package/dist/dom/element-registry.js.map +1 -0
  71. package/dist/dom/native/FrameElement.js +89 -0
  72. package/dist/dom/native/FrameElement.js.map +1 -0
  73. package/dist/dom/native/NativeElementNode.js +380 -0
  74. package/dist/dom/native/NativeElementNode.js.map +1 -0
  75. package/dist/dom/native/PageElement.js +11 -0
  76. package/dist/dom/native/PageElement.js.map +1 -0
  77. package/dist/dom/native-elements-tag-name-map.js +2 -0
  78. package/dist/dom/native-elements-tag-name-map.js.map +1 -0
  79. package/dist/dom/nodes/CommentNode.js +15 -0
  80. package/dist/dom/nodes/CommentNode.js.map +1 -0
  81. package/dist/dom/nodes/DocumentNode.js +198 -0
  82. package/dist/dom/nodes/DocumentNode.js.map +1 -0
  83. package/dist/dom/nodes/ElementNode.js +267 -0
  84. package/dist/dom/nodes/ElementNode.js.map +1 -0
  85. package/dist/dom/nodes/PropertyNode.js +39 -0
  86. package/dist/dom/nodes/PropertyNode.js.map +1 -0
  87. package/dist/dom/nodes/TextNode.js +35 -0
  88. package/dist/dom/nodes/TextNode.js.map +1 -0
  89. package/dist/dom/nodes/ViewNode.js +211 -0
  90. package/dist/dom/nodes/ViewNode.js.map +1 -0
  91. package/dist/dom/setup-registry.js +66 -0
  92. package/dist/dom/setup-registry.js.map +1 -0
  93. package/dist/index.js +6 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/instance-initializers/history.js +11 -0
  96. package/dist/instance-initializers/history.js.map +1 -0
  97. package/dist/services/history.js +58 -0
  98. package/dist/services/history.js.map +1 -0
  99. package/dist/services/native-router.js +34 -0
  100. package/dist/services/native-router.js.map +1 -0
  101. package/dist/setup-inspector-support.js +158 -0
  102. package/dist/setup-inspector-support.js.map +1 -0
  103. package/dist/setup.js +46 -0
  104. package/dist/setup.js.map +1 -0
  105. package/dist/types/glint.js +4 -0
  106. package/dist/types/glint.js.map +1 -0
  107. package/dist/types/globals.js +2 -0
  108. package/dist/types/globals.js.map +1 -0
  109. package/dist/utils/content-tag-loader.js +9 -0
  110. package/dist/utils/ember-native.js +9 -0
  111. package/dist/utils/eslint/ember-native.js +9 -0
  112. package/dist/utils/fix-glimmer-content-owner.js +13 -0
  113. package/dist/utils/glimmer-env.js +3 -0
  114. package/dist/utils/webpack.config.js +72 -0
  115. package/package.json +174 -0
  116. package/types/ember.d.ts +1 -0
@@ -0,0 +1,380 @@
1
+ import { _ as _defineProperty } from '../../_rollupPluginBabelHelpers-DZQzmiRH.js';
2
+ import { KeyframeAnimation } from '@nativescript/core/ui/animation/keyframe-animation';
3
+ import { LayoutBase } from '@nativescript/core/ui/layouts/layout-base';
4
+ import { ContentView, View, isAndroid, isIOS } from '@nativescript/core';
5
+ import { CssAnimationParser } from '@nativescript/core/ui/styling/css-animation-parser';
6
+ import { TextBase } from '@nativescript/core/ui/text-base';
7
+ import ElementNode from '../nodes/ElementNode.js';
8
+
9
+ function camelize(kebab) {
10
+ return kebab.replace(/-+(\w)/g, (_m, l) => l.toUpperCase());
11
+ }
12
+ const defaultViewMeta = {
13
+ skipAddToDom: false
14
+ };
15
+ class NativeElementNode extends ElementNode {
16
+ constructor(tagName, viewClass, meta = null) {
17
+ super(tagName);
18
+ _defineProperty(this, "_meta", void 0);
19
+ this.nodeType = 1;
20
+ this.tagName = tagName;
21
+ this._meta = Object.assign({}, defaultViewMeta, meta || {});
22
+ if (viewClass) {
23
+ this.nativeView = new viewClass();
24
+ this._nativeView.__GlimmerNativeElement__ = this;
25
+ }
26
+
27
+ // log.debug(`created ${this} ${this._nativeView}`);
28
+
29
+ //TODO these style shims mess up the code, extract to external modules
30
+
31
+ const setStyleAttribute = value => {
32
+ this.setAttribute('style', value);
33
+ };
34
+ const getStyleAttribute = () => {
35
+ return this.getAttribute('style');
36
+ };
37
+ const getParentPage = () => {
38
+ if (this.nativeView && this.nativeView.page) {
39
+ return this.nativeView.page.__GlimmerNativeElement__;
40
+ }
41
+ return null;
42
+ };
43
+ const animations = new Map();
44
+ const oldAnimations = [];
45
+ const addAnimation = animation => {
46
+ // log.debug(`Adding animation ${animation}`);
47
+ if (!this.nativeView) {
48
+ throw Error('Attempt to apply animation to tag without a native view' + this.tagName);
49
+ }
50
+ const page = getParentPage();
51
+ if (page == null) {
52
+ animations.set(animation, null);
53
+ return;
54
+ }
55
+
56
+ //quickly cancel any old ones
57
+ while (oldAnimations.length) {
58
+ const oldAnimation = oldAnimations.shift();
59
+ if (oldAnimation.isPlaying) {
60
+ oldAnimation.cancel();
61
+ }
62
+ }
63
+
64
+ //Parse our "animation" style property into an animation info instance (this won't include the keyframes from the css)
65
+ const animationInfos = CssAnimationParser.keyframeAnimationsFromCSSDeclarations([{
66
+ property: 'animation',
67
+ value: animation
68
+ }]);
69
+ if (!animationInfos) {
70
+ animations.set(animation, null);
71
+ return;
72
+ }
73
+ const animationInfo = animationInfos[0];
74
+
75
+ //Fetch an animationInfo instance that includes the keyframes from the css (this won't include the animation properties parsed above)
76
+ const animationWithKeyframes = page.nativeView.getKeyframeAnimationWithName(animationInfo.name);
77
+ if (!animationWithKeyframes) {
78
+ animations.set(animation, null);
79
+ return;
80
+ }
81
+ animationInfo.keyframes = animationWithKeyframes.keyframes;
82
+ //combine the keyframes from the css with the animation from the parsed attribute to get a complete animationInfo object
83
+ const animationInstance = KeyframeAnimation.keyframeAnimationFromInfo(animationInfo);
84
+
85
+ // save and launch the animation
86
+ animations.set(animation, animationInstance);
87
+ animationInstance.play(this.nativeView);
88
+ };
89
+ const removeAnimation = animation => {
90
+ // log.debug(`Removing animation ${animation}`);
91
+ if (animations.has(animation)) {
92
+ const animationInstance = animations.get(animation);
93
+ animations.delete(animation);
94
+ if (animationInstance) {
95
+ if (animationInstance.isPlaying) {
96
+ //we don't want to stop right away since svelte removes the animation before it is finished due to our lag time starting the animation.
97
+ oldAnimations.push(animationInstance);
98
+ }
99
+ }
100
+ }
101
+ };
102
+ this.style = {
103
+ setProperty: (propertyName, value) => {
104
+ this.setStyle(camelize(propertyName), value);
105
+ },
106
+ // @ts-expect-error does not exist
107
+ removeProperty: propertyName => {
108
+ this.setStyle(camelize(propertyName), null);
109
+ },
110
+ get animation() {
111
+ return [...animations.keys()].join(', ');
112
+ },
113
+ set animation(value) {
114
+ // log.debug(`setting animation ${value}`);
115
+ const new_animations = value.trim() == '' ? [] : value.split(',').map(a => a.trim());
116
+ //add new ones
117
+ for (const anim of new_animations) {
118
+ if (!animations.has(anim)) {
119
+ addAnimation(anim);
120
+ }
121
+ }
122
+ //remove old ones
123
+ for (const anim of animations.keys()) {
124
+ if (new_animations.indexOf(anim) < 0) {
125
+ removeAnimation(anim);
126
+ }
127
+ }
128
+ },
129
+ get cssText() {
130
+ // log.debug('got css text');
131
+ return getStyleAttribute();
132
+ },
133
+ set cssText(value) {
134
+ // log.debug('set css text');
135
+ setStyleAttribute(value);
136
+ }
137
+ };
138
+ }
139
+
140
+ /* istanbul ignore next */
141
+ setStyle(property, value) {
142
+ // log.debug(`setStyle ${this} ${property} ${value}`);
143
+
144
+ if (!value) return;
145
+ if (!(value = value.toString().trim()).length) {
146
+ return;
147
+ }
148
+ if (property.endsWith('Align')) {
149
+ // NativeScript uses Alignment instead of Align, this ensures that text-align works
150
+ property += 'ment';
151
+ }
152
+ this.nativeView.style[property] = value;
153
+ }
154
+ get style() {
155
+ return this.nativeView?.style;
156
+ }
157
+ set style(v) {
158
+ Object.assign(this.nativeView?.style || {}, v);
159
+ }
160
+ updateText() {
161
+ const hasTextAttr = this.nativeView instanceof TextBase;
162
+ if (hasTextAttr) {
163
+ const t = this.childNodes.map(c => c.text).filter(Boolean).join('');
164
+ this.setAttribute('text', t.trim());
165
+ }
166
+ }
167
+ get nativeView() {
168
+ return this._nativeView;
169
+ }
170
+ set nativeView(view) {
171
+ this._nativeView = view;
172
+ this.addEventListener('tap', () => globalThis.triggerEvent('click', this));
173
+ }
174
+ get meta() {
175
+ return this._meta;
176
+ }
177
+
178
+ /* istanbul ignore next */
179
+ addEventListener(event, handler) {
180
+ // log.debug('add event listener', this, event, handler);
181
+ this.nativeView.on(event, handler);
182
+ }
183
+
184
+ /* istanbul ignore next */
185
+ removeEventListener(event, handler) {
186
+ // log.debug(`remove event listener ${this} ${event}`);
187
+ this.nativeView.off(event, handler);
188
+ }
189
+ getAttribute(fullkey) {
190
+ let getTarget = this.nativeView;
191
+ const keypath = fullkey.split('.');
192
+ while (keypath.length > 0) {
193
+ if (!getTarget) return null;
194
+ let key = keypath.shift();
195
+
196
+ // try to fix case
197
+ const lowerkey = key.toLowerCase();
198
+ for (const realKey in getTarget) {
199
+ if (lowerkey == realKey.toLowerCase()) {
200
+ key = realKey;
201
+ break;
202
+ }
203
+ }
204
+ if (keypath.length > 0) {
205
+ getTarget = getTarget[key];
206
+ } else {
207
+ return getTarget[key];
208
+ }
209
+ }
210
+ return null;
211
+ }
212
+ onInsertedChild(childNode, atIndex) {
213
+ const parentNode = this;
214
+ if (!parentNode) {
215
+ return;
216
+ }
217
+ if (!(parentNode instanceof NativeElementNode) || !(childNode instanceof NativeElementNode) || !parentNode.nativeView || !childNode.nativeView) {
218
+ return;
219
+ }
220
+ if (parentNode.meta && typeof parentNode.meta.insertChild === 'function') {
221
+ //our dom includes "textNode" and "commentNode" which does not appear in the nativeview's children.
222
+ //we recalculate the index required for the insert operation buy only including native element nodes in the count
223
+ const nativeIndex = parentNode.childNodes.filter(e => e instanceof NativeElementNode).indexOf(childNode);
224
+ return parentNode.meta.insertChild(parentNode, childNode, nativeIndex);
225
+ }
226
+ const parentView = parentNode.nativeView;
227
+ const childView = childNode.nativeView;
228
+
229
+ //use the builder logic if we aren't being dynamic, to catch config items like <actionbar> that are not likely to be toggled
230
+ if (atIndex < 0 && parentView._addChildFromBuilder) {
231
+ parentView._addChildFromBuilder(childNode._nativeView.constructor.name, childView);
232
+ return;
233
+ }
234
+ if (parentView instanceof LayoutBase) {
235
+ if (atIndex >= 0) {
236
+ //our dom includes "textNode" and "commentNode" which does not appear in the nativeview's children.
237
+ //we recalculate the index required for the insert operation buy only including native element nodes in the count
238
+ const nativeIndex = parentNode.childNodes.filter(e => e instanceof NativeElementNode).indexOf(childNode);
239
+ parentView.insertChild(childView, nativeIndex);
240
+ } else {
241
+ parentView.addChild(childView);
242
+ }
243
+ return;
244
+ }
245
+ if (parentView._addChildFromBuilder) {
246
+ return parentView._addChildFromBuilder(childNode._nativeView.constructor.name, childView);
247
+ }
248
+ if (parentView instanceof ContentView) {
249
+ parentView.content = childView;
250
+ return;
251
+ }
252
+ throw new Error("Parent can't contain children: " + parentNode + ', ' + childNode);
253
+ }
254
+ onRemovedChild(childNode) {
255
+ const parentNode = this;
256
+ if (!parentNode) {
257
+ return;
258
+ }
259
+ if (!(parentNode instanceof NativeElementNode) || !(childNode instanceof NativeElementNode) || !parentNode.nativeView || !childNode.nativeView) {
260
+ return;
261
+ }
262
+ if (parentNode.meta && typeof parentNode.meta.removeChild === 'function') {
263
+ return parentNode.meta.removeChild(parentNode, childNode);
264
+ }
265
+ if (!childNode.nativeView || !childNode.nativeView) {
266
+ return;
267
+ }
268
+ const parentView = parentNode.nativeView;
269
+ const childView = childNode.nativeView;
270
+ if (parentView instanceof LayoutBase) {
271
+ parentView.removeChild(childView);
272
+ } else if (parentView instanceof ContentView) {
273
+ if (parentView.content === childView) {
274
+ parentView.content = null;
275
+ }
276
+ if (childNode.nodeType === 8) {
277
+ parentView._removeView(childView);
278
+ }
279
+ } else if (parentView instanceof View) {
280
+ parentView._removeView(childView);
281
+ } else ;
282
+ }
283
+
284
+ /* istanbul ignore next */
285
+ setAttribute(fullkey, value) {
286
+ const nv = this.nativeView;
287
+ let setTarget = nv;
288
+
289
+ // normalize key
290
+ if (isAndroid && fullkey.startsWith('android:')) {
291
+ fullkey = fullkey.substr(8);
292
+ }
293
+ if (isIOS && fullkey.startsWith('ios:')) {
294
+ fullkey = fullkey.substr(4);
295
+ }
296
+
297
+ //we might be getting an element from a propertyNode eg page.actionBar, unwrap
298
+ if (value instanceof NativeElementNode) {
299
+ value = value.nativeView;
300
+ }
301
+ const keypath = fullkey.split('.');
302
+ while (keypath.length > 0) {
303
+ if (!setTarget) return;
304
+ let key = keypath.shift();
305
+
306
+ // try to fix case
307
+ const lowerkey = key.toLowerCase();
308
+ for (const realKey in setTarget) {
309
+ if (lowerkey == realKey.toLowerCase()) {
310
+ key = realKey;
311
+ break;
312
+ }
313
+ }
314
+ if (keypath.length > 0) {
315
+ setTarget = setTarget[key];
316
+ } else {
317
+ try {
318
+ // log.debug(`setAttr ${this} ${resolvedKeys.join('.')} ${value}`);
319
+ setTarget[key] = value;
320
+ } catch (e) {
321
+ // ignore but log
322
+ console.error(`set attribute threw an error, attr:${key} on ${this._tagName}: ${e.message}`);
323
+ }
324
+ }
325
+ }
326
+ }
327
+ dispatchEvent(event) {
328
+ if (this.nativeView) {
329
+ //nativescript uses the EventName while dom uses Type
330
+ event.eventName = event.type;
331
+ this.nativeView.notify(event);
332
+ }
333
+ }
334
+ clear(node) {
335
+ while (node.childNodes.length) {
336
+ this.clear(node.firstChild);
337
+ }
338
+ node.parentNode.removeChild(node);
339
+ }
340
+ appendChild(childNode) {
341
+ super.appendChild(childNode);
342
+ if (childNode.nodeType === 3) {
343
+ this.updateText();
344
+ }
345
+ }
346
+ insertBefore(childNode, referenceNode) {
347
+ super.insertBefore(childNode, referenceNode);
348
+ if (childNode.nodeType === 3) {
349
+ this.updateText();
350
+ }
351
+ }
352
+ removeChild(childNode) {
353
+ super.removeChild(childNode);
354
+ if (childNode.nodeType === 3) {
355
+ this.updateText();
356
+ }
357
+ }
358
+ removeChildren() {
359
+ while (this.childNodes.length) {
360
+ this.clear(this.firstChild);
361
+ }
362
+ }
363
+ getBoundingClientRect() {
364
+ if (!this.nativeView) return null;
365
+ if (!this.nativeView.getLocationInWindow) return null;
366
+ const nw = this.nativeView;
367
+ const point = nw.getLocationInWindow();
368
+ const actualSize = nw.getActualSize();
369
+ return {
370
+ left: point.x,
371
+ top: point.y,
372
+ bottom: point.y + actualSize.height,
373
+ width: actualSize.width,
374
+ height: actualSize.height
375
+ };
376
+ }
377
+ }
378
+
379
+ export { NativeElementNode as default };
380
+ //# sourceMappingURL=NativeElementNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeElementNode.js","sources":["../../../src/dom/native/NativeElementNode.ts"],"sourcesContent":["import { KeyframeAnimation } from '@nativescript/core/ui/animation/keyframe-animation';\nimport { LayoutBase } from '@nativescript/core/ui/layouts/layout-base';\nimport {\n ContentView,\n type EventData,\n isAndroid,\n isIOS,\n Page,\n View,\n} from '@nativescript/core';\nimport { CssAnimationParser } from '@nativescript/core/ui/styling/css-animation-parser';\nimport { type ViewBase } from '@nativescript/core/ui/core/view-base';\nimport { TextBase } from '@nativescript/core/ui/text-base';\nimport ElementNode from '../nodes/ElementNode.ts';\nimport ViewNode, { type EventListener } from '../nodes/ViewNode.ts';\n\nfunction camelize(kebab: string): string {\n return kebab.replace(/-+(\\w)/g, (_m, l) => l.toUpperCase());\n}\n\nexport interface ComponentMeta {\n skipAddToDom?: boolean;\n insertChild?: (\n parent: NativeElementNode<any>,\n child: NativeElementNode<any>,\n index: number,\n ) => void;\n removeChild?: (parent: NativeElementNode, child: NativeElementNode) => void;\n}\n\nconst defaultViewMeta = {\n skipAddToDom: false,\n};\n\nexport default class NativeElementNode<\n T extends ViewBase | null = ViewBase,\n> extends ElementNode {\n declare _nativeView: T;\n _meta: ComponentMeta;\n\n constructor(\n tagName: string,\n viewClass: typeof View | null,\n meta: ComponentMeta | null = null,\n ) {\n super(tagName);\n\n this.nodeType = 1;\n this.tagName = tagName;\n\n this._meta = Object.assign({}, defaultViewMeta, meta || {});\n\n if (viewClass) {\n this.nativeView = new (viewClass as any)();\n (this._nativeView as any).__GlimmerNativeElement__ = this;\n }\n\n // log.debug(`created ${this} ${this._nativeView}`);\n\n //TODO these style shims mess up the code, extract to external modules\n\n const setStyleAttribute = (value: string): void => {\n this.setAttribute('style', value);\n };\n\n const getStyleAttribute = (): string => {\n return this.getAttribute('style');\n };\n\n const getParentPage = (): NativeElementNode | null => {\n if (this.nativeView && this.nativeView.page) {\n return (this.nativeView.page as any).__GlimmerNativeElement__;\n }\n return null;\n };\n\n const animations: Map<string, KeyframeAnimation | null> = new Map();\n const oldAnimations: KeyframeAnimation[] = [];\n\n const addAnimation = (animation: string) => {\n // log.debug(`Adding animation ${animation}`);\n if (!this.nativeView) {\n throw Error(\n 'Attempt to apply animation to tag without a native view' +\n this.tagName,\n );\n }\n\n const page = getParentPage();\n if (page == null) {\n animations.set(animation, null);\n return;\n }\n\n //quickly cancel any old ones\n while (oldAnimations.length) {\n const oldAnimation = oldAnimations.shift()!;\n if (oldAnimation.isPlaying) {\n oldAnimation.cancel();\n }\n }\n\n //Parse our \"animation\" style property into an animation info instance (this won't include the keyframes from the css)\n const animationInfos =\n CssAnimationParser.keyframeAnimationsFromCSSDeclarations([\n { property: 'animation', value: animation },\n ]);\n if (!animationInfos) {\n animations.set(animation, null);\n return;\n }\n const animationInfo = animationInfos[0]!;\n\n //Fetch an animationInfo instance that includes the keyframes from the css (this won't include the animation properties parsed above)\n const animationWithKeyframes = (\n page.nativeView as Page\n ).getKeyframeAnimationWithName(animationInfo.name!);\n if (!animationWithKeyframes) {\n animations.set(animation, null);\n return;\n }\n\n animationInfo.keyframes = animationWithKeyframes.keyframes;\n //combine the keyframes from the css with the animation from the parsed attribute to get a complete animationInfo object\n const animationInstance =\n KeyframeAnimation.keyframeAnimationFromInfo(animationInfo);\n\n // save and launch the animation\n animations.set(animation, animationInstance);\n animationInstance.play(this.nativeView as View);\n };\n\n const removeAnimation = (animation: string) => {\n // log.debug(`Removing animation ${animation}`);\n if (animations.has(animation)) {\n const animationInstance = animations.get(animation);\n animations.delete(animation);\n\n if (animationInstance) {\n if (animationInstance.isPlaying) {\n //we don't want to stop right away since svelte removes the animation before it is finished due to our lag time starting the animation.\n oldAnimations.push(animationInstance);\n }\n }\n }\n };\n\n this.style = {\n setProperty: (\n propertyName: string,\n value: string /*priority?: string*/,\n ) => {\n this.setStyle(camelize(propertyName), value);\n },\n\n // @ts-expect-error does not exist\n removeProperty: (propertyName: string) => {\n this.setStyle(camelize(propertyName), null);\n },\n\n get animation(): string {\n return [...animations.keys()].join(', ');\n },\n\n set animation(value: string) {\n // log.debug(`setting animation ${value}`);\n const new_animations =\n value.trim() == '' ? [] : value.split(',').map((a) => a.trim());\n //add new ones\n for (const anim of new_animations) {\n if (!animations.has(anim)) {\n addAnimation(anim);\n }\n }\n //remove old ones\n for (const anim of animations.keys()) {\n if (new_animations.indexOf(anim) < 0) {\n removeAnimation(anim);\n }\n }\n },\n\n get cssText(): string {\n // log.debug('got css text');\n return getStyleAttribute();\n },\n\n set cssText(value: string) {\n // log.debug('set css text');\n setStyleAttribute(value);\n },\n };\n }\n\n /* istanbul ignore next */\n setStyle(property: string, value: string | number | null) {\n // log.debug(`setStyle ${this} ${property} ${value}`);\n\n if (!value) return;\n\n if (!(value = value.toString().trim()).length) {\n return;\n }\n\n if (property.endsWith('Align')) {\n // NativeScript uses Alignment instead of Align, this ensures that text-align works\n property += 'ment';\n }\n (this.nativeView!.style as any)[property] = value;\n }\n\n get style() {\n return this.nativeView?.style;\n }\n\n set style(v) {\n Object.assign(this.nativeView?.style || {}, v);\n }\n\n updateText() {\n const hasTextAttr = this.nativeView instanceof TextBase;\n if (hasTextAttr) {\n const t = this.childNodes\n .map((c) => (c as any).text)\n .filter(Boolean)\n .join('');\n this.setAttribute('text', t.trim());\n }\n }\n\n get nativeView() {\n return this._nativeView;\n }\n\n set nativeView(view) {\n this._nativeView = view;\n this.addEventListener('tap', () => globalThis.triggerEvent('click', this));\n }\n\n get meta() {\n return this._meta;\n }\n\n /* istanbul ignore next */\n addEventListener(event: string, handler: EventListener) {\n // log.debug('add event listener', this, event, handler);\n this.nativeView!.on(event, handler);\n }\n\n /* istanbul ignore next */\n removeEventListener(event: string, handler?: EventListener) {\n // log.debug(`remove event listener ${this} ${event}`);\n this.nativeView!.off(event, handler);\n }\n\n getAttribute(fullkey: string) {\n let getTarget = this.nativeView as any;\n\n const keypath = fullkey.split('.');\n const resolvedKeys: string[] = [];\n\n while (keypath.length > 0) {\n if (!getTarget) return null;\n\n let key = keypath.shift()!;\n\n // try to fix case\n const lowerkey = key.toLowerCase();\n for (const realKey in getTarget) {\n if (lowerkey == realKey.toLowerCase()) {\n key = realKey;\n break;\n }\n }\n resolvedKeys.push(key);\n\n if (keypath.length > 0) {\n getTarget = getTarget[key];\n } else {\n return getTarget[key];\n }\n }\n\n return null;\n }\n\n onInsertedChild(childNode: ViewNode, atIndex: number) {\n const parentNode = this;\n if (!parentNode) {\n return;\n }\n\n if (\n !(parentNode instanceof NativeElementNode) ||\n !(childNode instanceof NativeElementNode) ||\n !parentNode.nativeView ||\n !childNode.nativeView\n ) {\n return;\n }\n\n if (parentNode.meta && typeof parentNode.meta.insertChild === 'function') {\n //our dom includes \"textNode\" and \"commentNode\" which does not appear in the nativeview's children.\n //we recalculate the index required for the insert operation buy only including native element nodes in the count\n const nativeIndex = parentNode.childNodes\n .filter((e) => e instanceof NativeElementNode)\n .indexOf(childNode);\n return parentNode.meta.insertChild(parentNode, childNode, nativeIndex);\n }\n\n const parentView = parentNode.nativeView;\n const childView = childNode.nativeView;\n\n //use the builder logic if we aren't being dynamic, to catch config items like <actionbar> that are not likely to be toggled\n if (atIndex < 0 && (parentView as any)._addChildFromBuilder) {\n (parentView as any)._addChildFromBuilder(\n childNode._nativeView.constructor.name,\n childView,\n );\n return;\n }\n\n if (parentView instanceof LayoutBase) {\n if (atIndex >= 0) {\n //our dom includes \"textNode\" and \"commentNode\" which does not appear in the nativeview's children.\n //we recalculate the index required for the insert operation buy only including native element nodes in the count\n const nativeIndex = parentNode.childNodes\n .filter((e) => e instanceof NativeElementNode)\n .indexOf(childNode);\n parentView.insertChild(childView, nativeIndex);\n } else {\n parentView.addChild(childView);\n }\n return;\n }\n\n if ((parentView as any)._addChildFromBuilder) {\n return (parentView as any)._addChildFromBuilder(\n childNode._nativeView.constructor.name,\n childView,\n );\n }\n\n if (parentView instanceof ContentView) {\n parentView.content = childView;\n return;\n }\n\n throw new Error(\n \"Parent can't contain children: \" + parentNode + ', ' + childNode,\n );\n }\n\n onRemovedChild(childNode: ViewNode) {\n const parentNode = this;\n if (!parentNode) {\n return;\n }\n\n if (\n !(parentNode instanceof NativeElementNode) ||\n !(childNode instanceof NativeElementNode) ||\n !parentNode.nativeView ||\n !childNode.nativeView\n ) {\n return;\n }\n\n if (parentNode.meta && typeof parentNode.meta.removeChild === 'function') {\n return parentNode.meta.removeChild(\n parentNode as NativeElementNode,\n childNode as NativeElementNode,\n );\n }\n\n if (!childNode.nativeView || !childNode.nativeView) {\n return;\n }\n\n const parentView = parentNode.nativeView;\n const childView = childNode.nativeView;\n\n if (parentView instanceof LayoutBase) {\n parentView.removeChild(childView);\n } else if (parentView instanceof ContentView) {\n if (parentView.content === childView) {\n (parentView as any).content = null;\n }\n if (childNode.nodeType === 8) {\n parentView._removeView(childView);\n }\n } else if (parentView instanceof View) {\n parentView._removeView(childView);\n } else {\n // throw new Error(\"Unknown parent type: \" + parent);\n }\n }\n\n /* istanbul ignore next */\n setAttribute(fullkey: string, value: any) {\n const nv = this.nativeView as any;\n let setTarget = nv;\n\n // normalize key\n if (isAndroid && fullkey.startsWith('android:')) {\n fullkey = fullkey.substr(8);\n }\n if (isIOS && fullkey.startsWith('ios:')) {\n fullkey = fullkey.substr(4);\n }\n\n //we might be getting an element from a propertyNode eg page.actionBar, unwrap\n if (value instanceof NativeElementNode) {\n value = value.nativeView;\n }\n const keypath = fullkey.split('.');\n const resolvedKeys: string[] = [];\n\n while (keypath.length > 0) {\n if (!setTarget) return;\n let key = keypath.shift()!;\n\n // try to fix case\n const lowerkey = key.toLowerCase();\n for (const realKey in setTarget) {\n if (lowerkey == realKey.toLowerCase()) {\n key = realKey;\n break;\n }\n }\n resolvedKeys.push(key);\n\n if (keypath.length > 0) {\n setTarget = setTarget[key];\n } else {\n try {\n // log.debug(`setAttr ${this} ${resolvedKeys.join('.')} ${value}`);\n setTarget[key] = value;\n } catch (e) {\n // ignore but log\n console.error(\n `set attribute threw an error, attr:${key} on ${this._tagName}: ${(e as any).message}`,\n );\n }\n }\n }\n }\n\n dispatchEvent(event: EventData) {\n if (this.nativeView) {\n //nativescript uses the EventName while dom uses Type\n event.eventName = (event as any).type;\n this.nativeView.notify(event);\n }\n }\n\n clear(node: any) {\n while (node.childNodes.length) {\n this.clear(node.firstChild);\n }\n node.parentNode.removeChild(node);\n }\n\n appendChild(childNode: ViewNode) {\n super.appendChild(childNode);\n if (childNode.nodeType === 3) {\n this.updateText();\n }\n }\n\n insertBefore(childNode: ViewNode, referenceNode: ViewNode) {\n super.insertBefore(childNode, referenceNode);\n if (childNode.nodeType === 3) {\n this.updateText();\n }\n }\n\n removeChild(childNode: ViewNode) {\n super.removeChild(childNode);\n if (childNode.nodeType === 3) {\n this.updateText();\n }\n }\n\n removeChildren() {\n while (this.childNodes.length) {\n this.clear(this.firstChild);\n }\n }\n\n getBoundingClientRect() {\n if (!this.nativeView) return null;\n if (!(this.nativeView as View).getLocationInWindow) return null;\n const nw = this.nativeView as View;\n const point = nw.getLocationInWindow();\n const actualSize = nw.getActualSize();\n return {\n left: point.x,\n top: point.y,\n bottom: point.y + actualSize.height,\n width: actualSize.width,\n height: actualSize.height,\n };\n }\n}\n"],"names":["camelize","kebab","replace","_m","l","toUpperCase","defaultViewMeta","skipAddToDom","NativeElementNode","ElementNode","constructor","tagName","viewClass","meta","_defineProperty","nodeType","_meta","Object","assign","nativeView","_nativeView","__GlimmerNativeElement__","setStyleAttribute","value","setAttribute","getStyleAttribute","getAttribute","getParentPage","page","animations","Map","oldAnimations","addAnimation","animation","Error","set","length","oldAnimation","shift","isPlaying","cancel","animationInfos","CssAnimationParser","keyframeAnimationsFromCSSDeclarations","property","animationInfo","animationWithKeyframes","getKeyframeAnimationWithName","name","keyframes","animationInstance","KeyframeAnimation","keyframeAnimationFromInfo","play","removeAnimation","has","get","delete","push","style","setProperty","propertyName","setStyle","removeProperty","keys","join","new_animations","trim","split","map","a","anim","indexOf","cssText","toString","endsWith","v","updateText","hasTextAttr","TextBase","t","childNodes","c","text","filter","Boolean","view","addEventListener","globalThis","triggerEvent","event","handler","on","removeEventListener","off","fullkey","getTarget","keypath","key","lowerkey","toLowerCase","realKey","onInsertedChild","childNode","atIndex","parentNode","insertChild","nativeIndex","e","parentView","childView","_addChildFromBuilder","LayoutBase","addChild","ContentView","content","onRemovedChild","removeChild","_removeView","View","nv","setTarget","isAndroid","startsWith","substr","isIOS","console","error","_tagName","message","dispatchEvent","eventName","type","notify","clear","node","firstChild","appendChild","insertBefore","referenceNode","removeChildren","getBoundingClientRect","getLocationInWindow","nw","point","actualSize","getActualSize","left","x","top","y","bottom","height","width"],"mappings":";;;;;;;;AAgBA,SAASA,QAAQA,CAACC,KAAa,EAAU;AACvC,EAAA,OAAOA,KAAK,CAACC,OAAO,CAAC,SAAS,EAAE,CAACC,EAAE,EAAEC,CAAC,KAAKA,CAAC,CAACC,WAAW,EAAE,CAAC;AAC7D;AAYA,MAAMC,eAAe,GAAG;AACtBC,EAAAA,YAAY,EAAE;AAChB,CAAC;AAEc,MAAMC,iBAAiB,SAE5BC,WAAW,CAAC;EAIpBC,WAAWA,CACTC,OAAe,EACfC,SAA6B,EAC7BC,IAA0B,GAAG,IAAI,EACjC;IACA,KAAK,CAACF,OAAO,CAAC;IAAAG,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;IAEd,IAAI,CAACC,QAAQ,GAAG,CAAC;IACjB,IAAI,CAACJ,OAAO,GAAGA,OAAO;AAEtB,IAAA,IAAI,CAACK,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAC,EAAE,EAAEZ,eAAe,EAAEO,IAAI,IAAI,EAAE,CAAC;AAE3D,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,IAAI,CAACO,UAAU,GAAG,IAAKP,SAAS,EAAU;AACzC,MAAA,IAAI,CAACQ,WAAW,CAASC,wBAAwB,GAAG,IAAI;AAC3D;;AAEA;;AAEA;;IAEA,MAAMC,iBAAiB,GAA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,IAAIA,SAAS,CAACxF,QAAQ,KAAK,CAAC,EAAE;MAC5B,IAAI,CAAC8D,UAAU,EAAE;AACnB;AACF;AAEA+D,EAAAA,cAAcA,GAAG;AACf,IAAA,OAAO,IAAI,CAAC3D,UAAU,CAAC7C,MAAM,EAAE;AAC7B,MAAA,IAAI,CAACkG,KAAK,CAAC,IAAI,CAACE,UAAU,CAAC;AAC7B;AACF;AAEAK,EAAAA,qBAAqBA,GAAG;AACtB,IAAA,IAAI,CAAC,IAAI,CAAC1H,UAAU,EAAE,OAAO,IAAI;IACjC,IAAI,CAAE,IAAI,CAACA,UAAU,CAAU2H,mBAAmB,EAAE,OAAO,IAAI;AAC/D,IAAA,MAAMC,EAAE,GAAG,IAAI,CAAC5H,UAAkB;AAClC,IAAA,MAAM6H,KAAK,GAAGD,EAAE,CAACD,mBAAmB,EAAE;AACtC,IAAA,MAAMG,UAAU,GAAGF,EAAE,CAACG,aAAa,EAAE;IACrC,OAAO;MACLC,IAAI,EAAEH,KAAK,CAACI,CAAC;MACbC,GAAG,EAAEL,KAAK,CAACM,CAAC;AACZC,MAAAA,MAAM,EAAEP,KAAK,CAACM,CAAC,GAAGL,UAAU,CAACO,MAAM;MACnCC,KAAK,EAAER,UAAU,CAACQ,KAAK;MACvBD,MAAM,EAAEP,UAAU,CAACO;KACpB;AACH;AACF;;;;"}
@@ -0,0 +1,11 @@
1
+ import { Page } from '@nativescript/core/ui/page';
2
+ import NativeElementNode from './NativeElementNode.js';
3
+
4
+ class PageElement extends NativeElementNode {
5
+ constructor() {
6
+ super('page', Page, null);
7
+ }
8
+ }
9
+
10
+ export { PageElement as default };
11
+ //# sourceMappingURL=PageElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageElement.js","sources":["../../../src/dom/native/PageElement.ts"],"sourcesContent":["import { Page } from '@nativescript/core/ui/page';\n\nimport NativeElementNode from './NativeElementNode.ts';\n\nexport default class PageElement extends NativeElementNode<Page> {\n constructor() {\n super('page', Page, null);\n }\n}\n"],"names":["PageElement","NativeElementNode","constructor","Page"],"mappings":";;;AAIe,MAAMA,WAAW,SAASC,iBAAiB,CAAO;AAC/DC,EAAAA,WAAWA,GAAG;AACZ,IAAA,KAAK,CAAC,MAAM,EAAEC,IAAI,EAAE,IAAI,CAAC;AAC3B;AACF;;;;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=native-elements-tag-name-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-elements-tag-name-map.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { _ as _defineProperty } from '../../_rollupPluginBabelHelpers-DZQzmiRH.js';
2
+ import ElementNode from './ElementNode.js';
3
+
4
+ class CommentNode extends ElementNode {
5
+ constructor(text) {
6
+ super('comment');
7
+ _defineProperty(this, "nodeType", void 0);
8
+ _defineProperty(this, "text", void 0);
9
+ this.nodeType = 8;
10
+ this.text = text;
11
+ }
12
+ }
13
+
14
+ export { CommentNode as default };
15
+ //# sourceMappingURL=CommentNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentNode.js","sources":["../../../src/dom/nodes/CommentNode.ts"],"sourcesContent":["import ElementNode from './ElementNode.ts';\n\nexport default class CommentNode extends ElementNode {\n nodeType: any;\n text: any;\n constructor(text: any) {\n super('comment');\n\n this.nodeType = 8;\n this.text = text;\n }\n}\n"],"names":["CommentNode","ElementNode","constructor","text","_defineProperty","nodeType"],"mappings":";;;AAEe,MAAMA,WAAW,SAASC,WAAW,CAAC;EAGnDC,WAAWA,CAACC,IAAS,EAAE;IACrB,KAAK,CAAC,SAAS,CAAC;IAAAC,eAAA,CAAA,IAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;IAEhB,IAAI,CAACC,QAAQ,GAAG,CAAC;IACjB,IAAI,CAACF,IAAI,GAAGA,IAAI;AAClB;AACF;;;;"}