@nativescript-community/gesturehandler 0.1.45 → 0.1.49
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.
- package/CHANGELOG.md +41 -0
- package/package.json +2 -2
- package/platforms/android/include.gradle +1 -1
- package/platforms/android/native-api-usage.json +5 -0
- package/platforms/ios/src/GestureHandler.h +3 -0
- package/platforms/ios/src/GestureHandler.m +4 -0
- package/pnpm-global/5/node_modules/.modules.yaml +0 -22
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/CHANGELOG.md +0 -102
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/LICENSE +0 -201
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/README.md +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/observable.d.ts +0 -17
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/observable.js +0 -54
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/observablearray.d.ts +0 -15
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/observablearray.js +0 -226
- package/pnpm-global/5/node_modules/.pnpm/@nativescript-community+observable@2.0.10/node_modules/@nativescript-community/observable/package.json +0 -31
- package/pnpm-global/5/node_modules/.pnpm/lock.yaml +0 -13
- package/pnpm-global/5/node_modules/@nativescript-community/observable/CHANGELOG.md +0 -102
- package/pnpm-global/5/node_modules/@nativescript-community/observable/LICENSE +0 -201
- package/pnpm-global/5/node_modules/@nativescript-community/observable/README.md +0 -17
- package/pnpm-global/5/node_modules/@nativescript-community/observable/observable.d.ts +0 -17
- package/pnpm-global/5/node_modules/@nativescript-community/observable/observable.js +0 -54
- package/pnpm-global/5/node_modules/@nativescript-community/observable/observablearray.d.ts +0 -15
- package/pnpm-global/5/node_modules/@nativescript-community/observable/observablearray.js +0 -226
- package/pnpm-global/5/node_modules/@nativescript-community/observable/package.json +0 -31
- package/pnpm-global/5/pnpm-lock.yaml +0 -13
@@ -1,226 +0,0 @@
|
|
1
|
-
import { Observable } from '@nativescript/core/data/observable';
|
2
|
-
import { ChangeType } from '@nativescript/core/data/observable-array';
|
3
|
-
const CHANGE = 'change';
|
4
|
-
class ObservableArrayInsideObservable extends Observable {
|
5
|
-
constructor(parent) {
|
6
|
-
super();
|
7
|
-
this.parent = new WeakRef(parent);
|
8
|
-
this._addArgs = {
|
9
|
-
eventName: CHANGE,
|
10
|
-
action: ChangeType.Add,
|
11
|
-
index: null,
|
12
|
-
removed: [],
|
13
|
-
addedCount: 1,
|
14
|
-
};
|
15
|
-
this._deleteArgs = {
|
16
|
-
eventName: CHANGE,
|
17
|
-
action: ChangeType.Delete,
|
18
|
-
index: null,
|
19
|
-
removed: null,
|
20
|
-
addedCount: 0,
|
21
|
-
};
|
22
|
-
}
|
23
|
-
toString() {
|
24
|
-
return '[ObservableArrayInsideObservable]';
|
25
|
-
}
|
26
|
-
notify(args) {
|
27
|
-
const parent = this.parent && this.parent.get();
|
28
|
-
args.object = parent || args.object;
|
29
|
-
super.notify(args);
|
30
|
-
}
|
31
|
-
_notifyLengthChange() {
|
32
|
-
const parent = this.parent && this.parent.get();
|
33
|
-
if (parent) {
|
34
|
-
const lengthChangedData = this._createPropertyChangeData('length', parent.length);
|
35
|
-
this.notify(lengthChangedData);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
let ID_INCREMENT = 0;
|
40
|
-
export class ObservableArray {
|
41
|
-
constructor(...args) {
|
42
|
-
this.shouldIgnoreSet = false;
|
43
|
-
this.shouldIgnoreOps = false;
|
44
|
-
let result;
|
45
|
-
if (args.length === 1) {
|
46
|
-
result = new Proxy(args[0].slice(), this);
|
47
|
-
}
|
48
|
-
else {
|
49
|
-
result = new Proxy([...args], this);
|
50
|
-
}
|
51
|
-
this._observable = new ObservableArrayInsideObservable(result);
|
52
|
-
result.id = ID_INCREMENT++;
|
53
|
-
return result;
|
54
|
-
}
|
55
|
-
toString() {
|
56
|
-
return '[ObservableArray]';
|
57
|
-
}
|
58
|
-
static [Symbol.hasInstance](instance) {
|
59
|
-
return true;
|
60
|
-
}
|
61
|
-
getPrototypeOf(target) {
|
62
|
-
return Observable.prototype;
|
63
|
-
}
|
64
|
-
get(target, prop) {
|
65
|
-
if (typeof prop === 'symbol') {
|
66
|
-
return target[prop];
|
67
|
-
}
|
68
|
-
const that = this;
|
69
|
-
const notifier = that._observable;
|
70
|
-
const val = target[prop];
|
71
|
-
if (!val) {
|
72
|
-
if (!val && typeof notifier[prop] === 'function') {
|
73
|
-
return notifier[prop].bind(notifier);
|
74
|
-
}
|
75
|
-
else if (prop === 'getItem') {
|
76
|
-
return function (index) {
|
77
|
-
return target[index];
|
78
|
-
};
|
79
|
-
}
|
80
|
-
else if (prop === 'setItem') {
|
81
|
-
return function (index, value) {
|
82
|
-
return this[index] = value;
|
83
|
-
};
|
84
|
-
}
|
85
|
-
}
|
86
|
-
else if (typeof val === 'function') {
|
87
|
-
if (prop === 'toString') {
|
88
|
-
return function () {
|
89
|
-
return JSON.stringify(target);
|
90
|
-
};
|
91
|
-
}
|
92
|
-
if (this.shouldIgnoreOps) {
|
93
|
-
return val;
|
94
|
-
}
|
95
|
-
if (prop === 'concat') {
|
96
|
-
notifier._addArgs.index = this.length;
|
97
|
-
}
|
98
|
-
if (prop === 'reverse') {
|
99
|
-
return function (el) {
|
100
|
-
that.shouldIgnoreSet = true;
|
101
|
-
const removed = [...target];
|
102
|
-
const result = Array.prototype[prop].apply(this, arguments);
|
103
|
-
that.shouldIgnoreSet = false;
|
104
|
-
notifier.notify({
|
105
|
-
eventName: CHANGE,
|
106
|
-
action: ChangeType.Splice,
|
107
|
-
index: 0,
|
108
|
-
removed,
|
109
|
-
addedCount: target.length,
|
110
|
-
});
|
111
|
-
return result;
|
112
|
-
};
|
113
|
-
}
|
114
|
-
if (prop === 'push') {
|
115
|
-
return function (el) {
|
116
|
-
notifier._addArgs.index = target.length;
|
117
|
-
that.shouldIgnoreSet = true;
|
118
|
-
const result = Array.prototype[prop].apply(this, arguments);
|
119
|
-
that.shouldIgnoreSet = false;
|
120
|
-
notifier._addArgs.addedCount = target.length - notifier._addArgs.index;
|
121
|
-
notifier.notify(notifier._addArgs);
|
122
|
-
notifier._notifyLengthChange();
|
123
|
-
return result;
|
124
|
-
};
|
125
|
-
}
|
126
|
-
if (prop === 'unshift') {
|
127
|
-
return function (el) {
|
128
|
-
const length = target.length;
|
129
|
-
that.shouldIgnoreSet = true;
|
130
|
-
const result = Array.prototype[prop].apply(this, arguments);
|
131
|
-
that.shouldIgnoreSet = false;
|
132
|
-
notifier._addArgs.index = 0;
|
133
|
-
notifier._addArgs.addedCount = result - length;
|
134
|
-
notifier.notify(notifier._addArgs);
|
135
|
-
notifier._notifyLengthChange();
|
136
|
-
return result;
|
137
|
-
};
|
138
|
-
}
|
139
|
-
if (prop === 'pop') {
|
140
|
-
return function (el) {
|
141
|
-
notifier._deleteArgs.index = target.length - 1;
|
142
|
-
that.shouldIgnoreSet = true;
|
143
|
-
const result = Array.prototype[prop].apply(this, arguments);
|
144
|
-
that.shouldIgnoreSet = false;
|
145
|
-
notifier._deleteArgs.removed = [result];
|
146
|
-
notifier.notify(notifier._deleteArgs);
|
147
|
-
notifier._notifyLengthChange();
|
148
|
-
return result;
|
149
|
-
};
|
150
|
-
}
|
151
|
-
if (prop === 'shift') {
|
152
|
-
return function (el) {
|
153
|
-
that.shouldIgnoreSet = true;
|
154
|
-
const result = Array.prototype[prop].apply(this, arguments);
|
155
|
-
that.shouldIgnoreSet = false;
|
156
|
-
notifier._deleteArgs.index = 0;
|
157
|
-
notifier._deleteArgs.removed = [result];
|
158
|
-
notifier.notify(notifier._deleteArgs);
|
159
|
-
notifier._notifyLengthChange();
|
160
|
-
return result;
|
161
|
-
};
|
162
|
-
}
|
163
|
-
if (prop === 'splice') {
|
164
|
-
return function (start) {
|
165
|
-
const length = target.length;
|
166
|
-
that.shouldIgnoreSet = true;
|
167
|
-
const result = Array.prototype[prop].apply(this, arguments);
|
168
|
-
that.shouldIgnoreSet = false;
|
169
|
-
notifier.notify({
|
170
|
-
eventName: CHANGE,
|
171
|
-
action: ChangeType.Splice,
|
172
|
-
index: Math.max(Math.min(start, length - (result.length > 0 ? 1 : 0)), 0),
|
173
|
-
removed: result,
|
174
|
-
addedCount: target.length + result.length - length,
|
175
|
-
});
|
176
|
-
if (target.length !== length) {
|
177
|
-
notifier._notifyLengthChange();
|
178
|
-
}
|
179
|
-
return result;
|
180
|
-
};
|
181
|
-
}
|
182
|
-
}
|
183
|
-
return val;
|
184
|
-
}
|
185
|
-
set(target, key, value) {
|
186
|
-
let event;
|
187
|
-
if (Number.isInteger(Number(key)) || key === 'length') {
|
188
|
-
if (!this.shouldIgnoreSet) {
|
189
|
-
event = {
|
190
|
-
eventName: CHANGE,
|
191
|
-
action: ChangeType.Update,
|
192
|
-
index: key,
|
193
|
-
removed: [target[key]],
|
194
|
-
addedCount: 1,
|
195
|
-
};
|
196
|
-
}
|
197
|
-
}
|
198
|
-
target[key] = value;
|
199
|
-
if (event) {
|
200
|
-
this._observable.notify(event);
|
201
|
-
}
|
202
|
-
return true;
|
203
|
-
}
|
204
|
-
deleteProperty(target, key) {
|
205
|
-
const notifier = this._observable;
|
206
|
-
let event;
|
207
|
-
if (Number.isInteger(Number(key)) || key === 'length') {
|
208
|
-
if (!this.shouldIgnoreSet) {
|
209
|
-
event = {
|
210
|
-
eventName: CHANGE,
|
211
|
-
action: ChangeType.Update,
|
212
|
-
index: key,
|
213
|
-
removed: [target[key]],
|
214
|
-
addedCount: 1,
|
215
|
-
};
|
216
|
-
}
|
217
|
-
}
|
218
|
-
delete target[key];
|
219
|
-
if (event) {
|
220
|
-
notifier.notify(event);
|
221
|
-
}
|
222
|
-
return true;
|
223
|
-
}
|
224
|
-
}
|
225
|
-
ObservableArray.changeEvent = CHANGE;
|
226
|
-
//# sourceMappingURL=observablearray.js.map
|
@@ -1,31 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "@nativescript-community/observable",
|
3
|
-
"version": "2.0.10",
|
4
|
-
"description": "Nativescript Observable class extension.",
|
5
|
-
"main": "./observable",
|
6
|
-
"sideEffects": false,
|
7
|
-
"typings": "./observable.d.ts",
|
8
|
-
"nativescript": {
|
9
|
-
"platforms": {
|
10
|
-
"android": "3.0.0",
|
11
|
-
"ios": "3.0.0"
|
12
|
-
}
|
13
|
-
},
|
14
|
-
"keywords": [
|
15
|
-
"NativeScript",
|
16
|
-
"JavaScript",
|
17
|
-
"Android",
|
18
|
-
"iOS"
|
19
|
-
],
|
20
|
-
"author": {
|
21
|
-
"name": "Martin Guillon",
|
22
|
-
"email": "martin@akylas.fr"
|
23
|
-
},
|
24
|
-
"bugs": {
|
25
|
-
"url": "https://github.com/nativescript-community/observable/issues"
|
26
|
-
},
|
27
|
-
"license": "Apache-2.0",
|
28
|
-
"homepage": "https://github.com/Akylas/@nativescript-community/observable",
|
29
|
-
"readmeFilename": "README.md",
|
30
|
-
"gitHead": "b6d566f4ec874519e33afdee6bace18c505254cd"
|
31
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
lockfileVersion: 5.3
|
2
|
-
|
3
|
-
specifiers:
|
4
|
-
'@nativescript-community/observable': ^2.0.8
|
5
|
-
|
6
|
-
dependencies:
|
7
|
-
'@nativescript-community/observable': 2.0.10
|
8
|
-
|
9
|
-
packages:
|
10
|
-
|
11
|
-
/@nativescript-community/observable/2.0.10:
|
12
|
-
resolution: {integrity: sha512-8dHT/QE5b2gbD/CmgCzzs9BTwRp5XZuhw1FVbGOOqidlNZh04WQeY7aPc9llbtqTE2AP9pYVS5e/h4TaVZOjFw==}
|
13
|
-
dev: false
|