@tamagui/react-native-web-internals 1.129.12 → 1.129.14
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/dist/cjs/modules/InteractionManager.cjs +158 -37
- package/dist/cjs/modules/InteractionManager.js +117 -14
- package/dist/cjs/modules/InteractionManager.js.map +1 -1
- package/dist/cjs/modules/InteractionManager.native.js +208 -11
- package/dist/cjs/modules/InteractionManager.native.js.map +2 -2
- package/dist/esm/modules/InteractionManager.js +118 -14
- package/dist/esm/modules/InteractionManager.js.map +1 -1
- package/dist/esm/modules/InteractionManager.mjs +158 -36
- package/dist/esm/modules/InteractionManager.mjs.map +1 -1
- package/dist/esm/modules/InteractionManager.native.js +214 -12
- package/dist/esm/modules/InteractionManager.native.js.map +1 -1
- package/package.json +8 -8
- package/src/modules/InteractionManager.tsx +276 -24
- package/types/modules/InteractionManager.d.ts +24 -10
- package/types/modules/InteractionManager.d.ts.map +1 -1
|
@@ -31,44 +31,165 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
}), mod);
|
|
32
32
|
var InteractionManager_exports = {};
|
|
33
33
|
__export(InteractionManager_exports, {
|
|
34
|
-
InteractionManager: () => InteractionManager
|
|
35
|
-
default: () => InteractionManager_default
|
|
34
|
+
InteractionManager: () => InteractionManager
|
|
36
35
|
});
|
|
37
36
|
module.exports = __toCommonJS(InteractionManager_exports);
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
var import_invariant = require("./invariant.cjs"),
|
|
38
|
+
import_requestIdleCallback = __toESM(require("./requestIdleCallback/index.cjs"));
|
|
39
|
+
class EventEmitter {
|
|
40
|
+
_registry = {};
|
|
41
|
+
addListener(eventType, listener, context) {
|
|
42
|
+
const registrations = this._allocate(eventType),
|
|
43
|
+
registration = {
|
|
44
|
+
context,
|
|
45
|
+
listener,
|
|
46
|
+
remove: () => {
|
|
47
|
+
registrations.delete(registration);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return registrations.add(registration), registration;
|
|
51
|
+
}
|
|
52
|
+
emit(eventType, ...args) {
|
|
53
|
+
const registrations = this._registry[eventType];
|
|
54
|
+
if (registrations != null) for (const registration of Array.from(registrations)) registration.listener.apply(registration.context, args);
|
|
55
|
+
}
|
|
56
|
+
_allocate(eventType) {
|
|
57
|
+
let registrations = this._registry[eventType];
|
|
58
|
+
return registrations == null && (registrations = /* @__PURE__ */new Set(), this._registry[eventType] = registrations), registrations;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
class TaskQueue {
|
|
62
|
+
_queueStack;
|
|
63
|
+
_onMoreTasks;
|
|
64
|
+
constructor({
|
|
65
|
+
onMoreTasks
|
|
66
|
+
}) {
|
|
67
|
+
this._onMoreTasks = onMoreTasks, this._queueStack = [{
|
|
68
|
+
tasks: [],
|
|
69
|
+
popable: !0
|
|
70
|
+
}];
|
|
71
|
+
}
|
|
72
|
+
enqueueTasks(tasks) {
|
|
73
|
+
tasks.forEach(task => this._enqueue(task));
|
|
74
|
+
}
|
|
75
|
+
cancelTasks(tasksToCancel) {
|
|
76
|
+
this._queueStack = this._queueStack.map(queue => ({
|
|
77
|
+
...queue,
|
|
78
|
+
tasks: queue.tasks.filter(task => !tasksToCancel.includes(task))
|
|
79
|
+
})).filter((queue, idx) => queue.tasks.length > 0 || idx === 0);
|
|
80
|
+
}
|
|
81
|
+
hasTasksToProcess() {
|
|
82
|
+
return this._getCurrentQueue().length > 0;
|
|
83
|
+
}
|
|
84
|
+
processNext() {
|
|
85
|
+
const queue = this._getCurrentQueue();
|
|
86
|
+
if (queue.length) {
|
|
87
|
+
const task = queue.shift();
|
|
88
|
+
try {
|
|
89
|
+
typeof task == "object" && task && "gen" in task ? this._genPromise(task) : typeof task == "object" && task && "run" in task ? task.run() : ((0, import_invariant.invariant)(typeof task == "function", `Expected Function, SimpleTask, or PromiseTask, but got:
|
|
90
|
+
` + JSON.stringify(task, null, 2)), task());
|
|
91
|
+
} catch (e) {
|
|
92
|
+
if (e instanceof Error) {
|
|
93
|
+
const taskName = task && typeof task == "object" && "name" in task ? task.name : "";
|
|
94
|
+
e.message = "TaskQueue: Error with task " + taskName + ": " + e.message;
|
|
95
|
+
}
|
|
96
|
+
throw e;
|
|
59
97
|
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
_enqueue(task) {
|
|
101
|
+
this._getCurrentQueue().push(task);
|
|
102
|
+
}
|
|
103
|
+
_getCurrentQueue() {
|
|
104
|
+
const stackIdx = this._queueStack.length - 1,
|
|
105
|
+
queue = this._queueStack[stackIdx];
|
|
106
|
+
return queue.popable && queue.tasks.length === 0 && stackIdx > 0 ? (this._queueStack.pop(), this._getCurrentQueue()) : queue.tasks;
|
|
107
|
+
}
|
|
108
|
+
_genPromise(task) {
|
|
109
|
+
const stackIdx = this._queueStack.push({
|
|
110
|
+
tasks: [],
|
|
111
|
+
popable: !1
|
|
112
|
+
}) - 1,
|
|
113
|
+
stackItem = this._queueStack[stackIdx];
|
|
114
|
+
task.gen().then(() => {
|
|
115
|
+
stackItem.popable = !0, this.hasTasksToProcess() && this._onMoreTasks();
|
|
116
|
+
}).catch(ex => {
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
throw ex instanceof Error && (ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`), ex;
|
|
119
|
+
}, 0);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const _emitter = new EventEmitter(),
|
|
124
|
+
InteractionManager = {
|
|
125
|
+
Events: {
|
|
126
|
+
interactionStart: "interactionStart",
|
|
127
|
+
interactionComplete: "interactionComplete"
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Schedule a function to run after all interactions have completed.
|
|
131
|
+
*/
|
|
132
|
+
runAfterInteractions(task) {
|
|
133
|
+
const tasks = [],
|
|
134
|
+
promise = new Promise(resolve => {
|
|
135
|
+
_scheduleUpdate(), task && tasks.push(task), tasks.push({
|
|
136
|
+
run: resolve,
|
|
137
|
+
name: "resolve " + (task && typeof task == "object" && "name" in task && task.name || "?")
|
|
138
|
+
}), _taskQueue.enqueueTasks(tasks);
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
then: promise.then.bind(promise),
|
|
142
|
+
done: promise.then.bind(promise),
|
|
143
|
+
cancel: () => {
|
|
144
|
+
_taskQueue.cancelTasks(tasks);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
/**
|
|
149
|
+
* Notify manager that an interaction has started.
|
|
150
|
+
*/
|
|
151
|
+
createInteractionHandle() {
|
|
152
|
+
_scheduleUpdate();
|
|
153
|
+
const handle = ++_inc;
|
|
154
|
+
return _addInteractionSet.add(handle), handle;
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* Notify manager that an interaction has completed.
|
|
158
|
+
*/
|
|
159
|
+
clearInteractionHandle(handle) {
|
|
160
|
+
(0, import_invariant.invariant)(!!handle, "Must provide a handle to clear."), _scheduleUpdate(), _addInteractionSet.delete(handle), _deleteInteractionSet.add(handle);
|
|
161
|
+
},
|
|
162
|
+
addListener: _emitter.addListener.bind(_emitter),
|
|
163
|
+
/**
|
|
164
|
+
* Set deadline for task processing
|
|
165
|
+
*/
|
|
166
|
+
setDeadline(deadline) {
|
|
167
|
+
_deadline = deadline;
|
|
168
|
+
}
|
|
67
169
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
|
|
170
|
+
_interactionSet = /* @__PURE__ */new Set(),
|
|
171
|
+
_addInteractionSet = /* @__PURE__ */new Set(),
|
|
172
|
+
_deleteInteractionSet = /* @__PURE__ */new Set(),
|
|
173
|
+
_taskQueue = new TaskQueue({
|
|
174
|
+
onMoreTasks: _scheduleUpdate
|
|
175
|
+
});
|
|
176
|
+
let _nextUpdateHandle = null,
|
|
177
|
+
_inc = 0,
|
|
178
|
+
_deadline = -1;
|
|
179
|
+
function _scheduleUpdate() {
|
|
180
|
+
_nextUpdateHandle || (_deadline > 0 ? _nextUpdateHandle = setTimeout(_processUpdate) : _nextUpdateHandle = (0, import_requestIdleCallback.default)(_processUpdate));
|
|
181
|
+
}
|
|
182
|
+
function _processUpdate() {
|
|
183
|
+
_nextUpdateHandle = null;
|
|
184
|
+
const interactionCount = _interactionSet.size;
|
|
185
|
+
_addInteractionSet.forEach(handle => _interactionSet.add(handle)), _deleteInteractionSet.forEach(handle => _interactionSet.delete(handle));
|
|
186
|
+
const nextInteractionCount = _interactionSet.size;
|
|
187
|
+
if (interactionCount !== 0 && nextInteractionCount === 0 ? _emitter.emit("interactionComplete") : interactionCount === 0 && nextInteractionCount !== 0 && _emitter.emit("interactionStart"), nextInteractionCount === 0) {
|
|
188
|
+
const begin = Date.now();
|
|
189
|
+
for (; _taskQueue.hasTasksToProcess();) if (_taskQueue.processNext(), _deadline > 0 && Date.now() - begin >= _deadline) {
|
|
190
|
+
_scheduleUpdate();
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
_addInteractionSet.clear(), _deleteInteractionSet.clear();
|
|
195
|
+
}
|
|
@@ -22,12 +22,89 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
23
|
var InteractionManager_exports = {};
|
|
24
24
|
__export(InteractionManager_exports, {
|
|
25
|
-
InteractionManager: () => InteractionManager
|
|
26
|
-
default: () => InteractionManager_default
|
|
25
|
+
InteractionManager: () => InteractionManager
|
|
27
26
|
});
|
|
28
27
|
module.exports = __toCommonJS(InteractionManager_exports);
|
|
29
|
-
var import_requestIdleCallback = __toESM(require("./requestIdleCallback"));
|
|
30
|
-
|
|
28
|
+
var import_invariant = require("./invariant"), import_requestIdleCallback = __toESM(require("./requestIdleCallback/index"));
|
|
29
|
+
class EventEmitter {
|
|
30
|
+
_registry = {};
|
|
31
|
+
addListener(eventType, listener, context) {
|
|
32
|
+
const registrations = this._allocate(eventType), registration = {
|
|
33
|
+
context,
|
|
34
|
+
listener,
|
|
35
|
+
remove: () => {
|
|
36
|
+
registrations.delete(registration);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return registrations.add(registration), registration;
|
|
40
|
+
}
|
|
41
|
+
emit(eventType, ...args) {
|
|
42
|
+
const registrations = this._registry[eventType];
|
|
43
|
+
if (registrations != null)
|
|
44
|
+
for (const registration of Array.from(registrations))
|
|
45
|
+
registration.listener.apply(registration.context, args);
|
|
46
|
+
}
|
|
47
|
+
_allocate(eventType) {
|
|
48
|
+
let registrations = this._registry[eventType];
|
|
49
|
+
return registrations == null && (registrations = /* @__PURE__ */ new Set(), this._registry[eventType] = registrations), registrations;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
class TaskQueue {
|
|
53
|
+
_queueStack;
|
|
54
|
+
_onMoreTasks;
|
|
55
|
+
constructor({ onMoreTasks }) {
|
|
56
|
+
this._onMoreTasks = onMoreTasks, this._queueStack = [{ tasks: [], popable: !0 }];
|
|
57
|
+
}
|
|
58
|
+
enqueueTasks(tasks) {
|
|
59
|
+
tasks.forEach((task) => this._enqueue(task));
|
|
60
|
+
}
|
|
61
|
+
cancelTasks(tasksToCancel) {
|
|
62
|
+
this._queueStack = this._queueStack.map((queue) => ({
|
|
63
|
+
...queue,
|
|
64
|
+
tasks: queue.tasks.filter((task) => !tasksToCancel.includes(task))
|
|
65
|
+
})).filter((queue, idx) => queue.tasks.length > 0 || idx === 0);
|
|
66
|
+
}
|
|
67
|
+
hasTasksToProcess() {
|
|
68
|
+
return this._getCurrentQueue().length > 0;
|
|
69
|
+
}
|
|
70
|
+
processNext() {
|
|
71
|
+
const queue = this._getCurrentQueue();
|
|
72
|
+
if (queue.length) {
|
|
73
|
+
const task = queue.shift();
|
|
74
|
+
try {
|
|
75
|
+
typeof task == "object" && task && "gen" in task ? this._genPromise(task) : typeof task == "object" && task && "run" in task ? task.run() : ((0, import_invariant.invariant)(
|
|
76
|
+
typeof task == "function",
|
|
77
|
+
`Expected Function, SimpleTask, or PromiseTask, but got:
|
|
78
|
+
` + JSON.stringify(task, null, 2)
|
|
79
|
+
), task());
|
|
80
|
+
} catch (e) {
|
|
81
|
+
if (e instanceof Error) {
|
|
82
|
+
const taskName = task && typeof task == "object" && "name" in task ? task.name : "";
|
|
83
|
+
e.message = "TaskQueue: Error with task " + taskName + ": " + e.message;
|
|
84
|
+
}
|
|
85
|
+
throw e;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
_enqueue(task) {
|
|
90
|
+
this._getCurrentQueue().push(task);
|
|
91
|
+
}
|
|
92
|
+
_getCurrentQueue() {
|
|
93
|
+
const stackIdx = this._queueStack.length - 1, queue = this._queueStack[stackIdx];
|
|
94
|
+
return queue.popable && queue.tasks.length === 0 && stackIdx > 0 ? (this._queueStack.pop(), this._getCurrentQueue()) : queue.tasks;
|
|
95
|
+
}
|
|
96
|
+
_genPromise(task) {
|
|
97
|
+
const stackIdx = this._queueStack.push({ tasks: [], popable: !1 }) - 1, stackItem = this._queueStack[stackIdx];
|
|
98
|
+
task.gen().then(() => {
|
|
99
|
+
stackItem.popable = !0, this.hasTasksToProcess() && this._onMoreTasks();
|
|
100
|
+
}).catch((ex) => {
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
throw ex instanceof Error && (ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`), ex;
|
|
103
|
+
}, 0);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const _emitter = new EventEmitter(), InteractionManager = {
|
|
31
108
|
Events: {
|
|
32
109
|
interactionStart: "interactionStart",
|
|
33
110
|
interactionComplete: "interactionComplete"
|
|
@@ -36,17 +113,17 @@ const InteractionManager = {
|
|
|
36
113
|
* Schedule a function to run after all interactions have completed.
|
|
37
114
|
*/
|
|
38
115
|
runAfterInteractions(task) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
116
|
+
const tasks = [], promise = new Promise((resolve) => {
|
|
117
|
+
_scheduleUpdate(), task && tasks.push(task), tasks.push({
|
|
118
|
+
run: resolve,
|
|
119
|
+
name: "resolve " + (task && typeof task == "object" && "name" in task && task.name || "?")
|
|
120
|
+
}), _taskQueue.enqueueTasks(tasks);
|
|
44
121
|
});
|
|
45
122
|
return {
|
|
46
123
|
then: promise.then.bind(promise),
|
|
47
124
|
done: promise.then.bind(promise),
|
|
48
125
|
cancel: () => {
|
|
49
|
-
|
|
126
|
+
_taskQueue.cancelTasks(tasks);
|
|
50
127
|
}
|
|
51
128
|
};
|
|
52
129
|
},
|
|
@@ -54,15 +131,41 @@ const InteractionManager = {
|
|
|
54
131
|
* Notify manager that an interaction has started.
|
|
55
132
|
*/
|
|
56
133
|
createInteractionHandle() {
|
|
57
|
-
|
|
134
|
+
_scheduleUpdate();
|
|
135
|
+
const handle = ++_inc;
|
|
136
|
+
return _addInteractionSet.add(handle), handle;
|
|
58
137
|
},
|
|
59
138
|
/**
|
|
60
139
|
* Notify manager that an interaction has completed.
|
|
61
140
|
*/
|
|
62
141
|
clearInteractionHandle(handle) {
|
|
142
|
+
(0, import_invariant.invariant)(!!handle, "Must provide a handle to clear."), _scheduleUpdate(), _addInteractionSet.delete(handle), _deleteInteractionSet.add(handle);
|
|
63
143
|
},
|
|
64
|
-
addListener: ()
|
|
144
|
+
addListener: _emitter.addListener.bind(_emitter),
|
|
145
|
+
/**
|
|
146
|
+
* Set deadline for task processing
|
|
147
|
+
*/
|
|
148
|
+
setDeadline(deadline) {
|
|
149
|
+
_deadline = deadline;
|
|
65
150
|
}
|
|
66
|
-
};
|
|
67
|
-
|
|
151
|
+
}, _interactionSet = /* @__PURE__ */ new Set(), _addInteractionSet = /* @__PURE__ */ new Set(), _deleteInteractionSet = /* @__PURE__ */ new Set(), _taskQueue = new TaskQueue({ onMoreTasks: _scheduleUpdate });
|
|
152
|
+
let _nextUpdateHandle = null, _inc = 0, _deadline = -1;
|
|
153
|
+
function _scheduleUpdate() {
|
|
154
|
+
_nextUpdateHandle || (_deadline > 0 ? _nextUpdateHandle = setTimeout(_processUpdate) : _nextUpdateHandle = (0, import_requestIdleCallback.default)(_processUpdate));
|
|
155
|
+
}
|
|
156
|
+
function _processUpdate() {
|
|
157
|
+
_nextUpdateHandle = null;
|
|
158
|
+
const interactionCount = _interactionSet.size;
|
|
159
|
+
_addInteractionSet.forEach((handle) => _interactionSet.add(handle)), _deleteInteractionSet.forEach((handle) => _interactionSet.delete(handle));
|
|
160
|
+
const nextInteractionCount = _interactionSet.size;
|
|
161
|
+
if (interactionCount !== 0 && nextInteractionCount === 0 ? _emitter.emit("interactionComplete") : interactionCount === 0 && nextInteractionCount !== 0 && _emitter.emit("interactionStart"), nextInteractionCount === 0) {
|
|
162
|
+
const begin = Date.now();
|
|
163
|
+
for (; _taskQueue.hasTasksToProcess(); )
|
|
164
|
+
if (_taskQueue.processNext(), _deadline > 0 && Date.now() - begin >= _deadline) {
|
|
165
|
+
_scheduleUpdate();
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_addInteractionSet.clear(), _deleteInteractionSet.clear();
|
|
170
|
+
}
|
|
68
171
|
//# sourceMappingURL=InteractionManager.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2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S,YAAY,KAAK,QAAQ;AAAA;AAAA;AAAA;AAAA,EAS/C,YAAY,UAAwB;AAClC,gBAAY;AAAA,EACd;AACF,GAEM,kBAAkB,oBAAI,IAAY,GAClC,qBAAqB,oBAAI,IAAY,GACrC,wBAAwB,oBAAI,IAAY,GACxC,aAAa,IAAI,UAAU,EAAE,aAAa,gBAAgB,CAAC;AACjE,IAAI,oBAAmE,MACnE,OAAO,GACP,YAAY;AAKhB,SAAS,kBAAwB;AAC/B,EAAK,sBACC,YAAY,IACd,oBAAoB,WAAW,cAAc,IAE7C,wBAAoB,2BAAAA,SAAoB,cAAc;AAG5D;AAKA,SAAS,iBAAuB;AAC9B,sBAAoB;AACpB,QAAM,mBAAmB,gBAAgB;AACzC,qBAAmB,QAAQ,CAAC,WAAW,gBAAgB,IAAI,MAAM,CAAC,GAClE,sBAAsB,QAAQ,CAAC,WAAW,gBAAgB,OAAO,MAAM,CAAC;AACxE,QAAM,uBAAuB,gBAAgB;AAQ7C,MANI,qBAAqB,KAAK,yBAAyB,IACrD,SAAS,KAAK,qBAAqB,IAC1B,qBAAqB,KAAK,yBAAyB,KAC5D,SAAS,KAAK,kBAAkB,GAG9B,yBAAyB,GAAG;AAG9B,UAAM,QAAQ,KAAK,IAAI;AACvB,WAAO,WAAW,kBAAkB;AAElC,UADA,WAAW,YAAY,GACnB,YAAY,KAAK,KAAK,IAAI,IAAI,SAAS,WAAW;AACpD,wBAAgB;AAChB;AAAA,MACF;AAAA,EAEJ;AACA,qBAAmB,MAAM,GACzB,sBAAsB,MAAM;AAC9B;",
|
|
5
5
|
"names": ["requestIdleCallback"]
|
|
6
6
|
}
|
|
@@ -23,11 +23,176 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
24
|
var InteractionManager_exports = {};
|
|
25
25
|
__export(InteractionManager_exports, {
|
|
26
|
-
InteractionManager: () => InteractionManager
|
|
27
|
-
default: () => InteractionManager_default
|
|
26
|
+
InteractionManager: () => InteractionManager
|
|
28
27
|
});
|
|
29
28
|
module.exports = __toCommonJS(InteractionManager_exports);
|
|
30
|
-
var import_requestIdleCallback = __toESM(require("./requestIdleCallback"))
|
|
29
|
+
var import_invariant = require("./invariant"), import_requestIdleCallback = __toESM(require("./requestIdleCallback/index"));
|
|
30
|
+
function _class_call_check(instance, Constructor) {
|
|
31
|
+
if (!(instance instanceof Constructor))
|
|
32
|
+
throw new TypeError("Cannot call a class as a function");
|
|
33
|
+
}
|
|
34
|
+
function _defineProperties(target, props) {
|
|
35
|
+
for (var i = 0; i < props.length; i++) {
|
|
36
|
+
var descriptor = props[i];
|
|
37
|
+
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
41
|
+
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
42
|
+
}
|
|
43
|
+
function _define_property(obj, key, value) {
|
|
44
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
45
|
+
value,
|
|
46
|
+
enumerable: !0,
|
|
47
|
+
configurable: !0,
|
|
48
|
+
writable: !0
|
|
49
|
+
}) : obj[key] = value, obj;
|
|
50
|
+
}
|
|
51
|
+
var EventEmitter = /* @__PURE__ */ function() {
|
|
52
|
+
"use strict";
|
|
53
|
+
function EventEmitter2() {
|
|
54
|
+
_class_call_check(this, EventEmitter2), _define_property(this, "_registry", {});
|
|
55
|
+
}
|
|
56
|
+
return _create_class(EventEmitter2, [
|
|
57
|
+
{
|
|
58
|
+
key: "addListener",
|
|
59
|
+
value: function(eventType, listener, context) {
|
|
60
|
+
var registrations = this._allocate(eventType), registration = {
|
|
61
|
+
context,
|
|
62
|
+
listener,
|
|
63
|
+
remove: function() {
|
|
64
|
+
registrations.delete(registration);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return registrations.add(registration), registration;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "emit",
|
|
72
|
+
value: function(eventType) {
|
|
73
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)
|
|
74
|
+
args[_key - 1] = arguments[_key];
|
|
75
|
+
var registrations = this._registry[eventType];
|
|
76
|
+
if (registrations != null) {
|
|
77
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
78
|
+
try {
|
|
79
|
+
for (var _iterator = Array.from(registrations)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
80
|
+
var registration = _step.value;
|
|
81
|
+
registration.listener.apply(registration.context, args);
|
|
82
|
+
}
|
|
83
|
+
} catch (err) {
|
|
84
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
85
|
+
} finally {
|
|
86
|
+
try {
|
|
87
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
88
|
+
} finally {
|
|
89
|
+
if (_didIteratorError)
|
|
90
|
+
throw _iteratorError;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: "_allocate",
|
|
98
|
+
value: function(eventType) {
|
|
99
|
+
var registrations = this._registry[eventType];
|
|
100
|
+
return registrations == null && (registrations = /* @__PURE__ */ new Set(), this._registry[eventType] = registrations), registrations;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
]), EventEmitter2;
|
|
104
|
+
}(), TaskQueue = /* @__PURE__ */ function() {
|
|
105
|
+
"use strict";
|
|
106
|
+
function TaskQueue2(param) {
|
|
107
|
+
var { onMoreTasks } = param;
|
|
108
|
+
_class_call_check(this, TaskQueue2), _define_property(this, "_queueStack", void 0), _define_property(this, "_onMoreTasks", void 0), this._onMoreTasks = onMoreTasks, this._queueStack = [
|
|
109
|
+
{
|
|
110
|
+
tasks: [],
|
|
111
|
+
popable: !0
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
return _create_class(TaskQueue2, [
|
|
116
|
+
{
|
|
117
|
+
key: "enqueueTasks",
|
|
118
|
+
value: function(tasks) {
|
|
119
|
+
var _this = this;
|
|
120
|
+
tasks.forEach(function(task) {
|
|
121
|
+
return _this._enqueue(task);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: "cancelTasks",
|
|
127
|
+
value: function(tasksToCancel) {
|
|
128
|
+
this._queueStack = this._queueStack.map(function(queue) {
|
|
129
|
+
return {
|
|
130
|
+
...queue,
|
|
131
|
+
tasks: queue.tasks.filter(function(task) {
|
|
132
|
+
return !tasksToCancel.includes(task);
|
|
133
|
+
})
|
|
134
|
+
};
|
|
135
|
+
}).filter(function(queue, idx) {
|
|
136
|
+
return queue.tasks.length > 0 || idx === 0;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "hasTasksToProcess",
|
|
142
|
+
value: function() {
|
|
143
|
+
return this._getCurrentQueue().length > 0;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: "processNext",
|
|
148
|
+
value: function() {
|
|
149
|
+
var queue = this._getCurrentQueue();
|
|
150
|
+
if (queue.length) {
|
|
151
|
+
var task = queue.shift();
|
|
152
|
+
try {
|
|
153
|
+
typeof task == "object" && task && "gen" in task ? this._genPromise(task) : typeof task == "object" && task && "run" in task ? task.run() : ((0, import_invariant.invariant)(typeof task == "function", `Expected Function, SimpleTask, or PromiseTask, but got:
|
|
154
|
+
` + JSON.stringify(task, null, 2)), task());
|
|
155
|
+
} catch (e) {
|
|
156
|
+
if (e instanceof Error) {
|
|
157
|
+
var taskName = task && typeof task == "object" && "name" in task ? task.name : "";
|
|
158
|
+
e.message = "TaskQueue: Error with task " + taskName + ": " + e.message;
|
|
159
|
+
}
|
|
160
|
+
throw e;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
key: "_enqueue",
|
|
167
|
+
value: function(task) {
|
|
168
|
+
this._getCurrentQueue().push(task);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
key: "_getCurrentQueue",
|
|
173
|
+
value: function() {
|
|
174
|
+
var stackIdx = this._queueStack.length - 1, queue = this._queueStack[stackIdx];
|
|
175
|
+
return queue.popable && queue.tasks.length === 0 && stackIdx > 0 ? (this._queueStack.pop(), this._getCurrentQueue()) : queue.tasks;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
key: "_genPromise",
|
|
180
|
+
value: function(task) {
|
|
181
|
+
var _this = this, length = this._queueStack.push({
|
|
182
|
+
tasks: [],
|
|
183
|
+
popable: !1
|
|
184
|
+
}), stackIdx = length - 1, stackItem = this._queueStack[stackIdx];
|
|
185
|
+
task.gen().then(function() {
|
|
186
|
+
stackItem.popable = !0, _this.hasTasksToProcess() && _this._onMoreTasks();
|
|
187
|
+
}).catch(function(ex) {
|
|
188
|
+
setTimeout(function() {
|
|
189
|
+
throw ex instanceof Error && (ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`), ex;
|
|
190
|
+
}, 0);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
]), TaskQueue2;
|
|
195
|
+
}(), _emitter = new EventEmitter(), InteractionManager = {
|
|
31
196
|
Events: {
|
|
32
197
|
interactionStart: "interactionStart",
|
|
33
198
|
interactionComplete: "interactionComplete"
|
|
@@ -36,16 +201,17 @@ var import_requestIdleCallback = __toESM(require("./requestIdleCallback")), Inte
|
|
|
36
201
|
* Schedule a function to run after all interactions have completed.
|
|
37
202
|
*/
|
|
38
203
|
runAfterInteractions(task) {
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
204
|
+
var tasks = [], promise = new Promise(function(resolve) {
|
|
205
|
+
_scheduleUpdate(), task && tasks.push(task), tasks.push({
|
|
206
|
+
run: resolve,
|
|
207
|
+
name: "resolve " + (task && typeof task == "object" && "name" in task && task.name || "?")
|
|
208
|
+
}), _taskQueue.enqueueTasks(tasks);
|
|
43
209
|
});
|
|
44
210
|
return {
|
|
45
211
|
then: promise.then.bind(promise),
|
|
46
212
|
done: promise.then.bind(promise),
|
|
47
213
|
cancel: function() {
|
|
48
|
-
|
|
214
|
+
_taskQueue.cancelTasks(tasks);
|
|
49
215
|
}
|
|
50
216
|
};
|
|
51
217
|
},
|
|
@@ -53,16 +219,47 @@ var import_requestIdleCallback = __toESM(require("./requestIdleCallback")), Inte
|
|
|
53
219
|
* Notify manager that an interaction has started.
|
|
54
220
|
*/
|
|
55
221
|
createInteractionHandle() {
|
|
56
|
-
|
|
222
|
+
_scheduleUpdate();
|
|
223
|
+
var handle = ++_inc;
|
|
224
|
+
return _addInteractionSet.add(handle), handle;
|
|
57
225
|
},
|
|
58
226
|
/**
|
|
59
227
|
* Notify manager that an interaction has completed.
|
|
60
228
|
*/
|
|
61
229
|
clearInteractionHandle(handle) {
|
|
230
|
+
(0, import_invariant.invariant)(!!handle, "Must provide a handle to clear."), _scheduleUpdate(), _addInteractionSet.delete(handle), _deleteInteractionSet.add(handle);
|
|
62
231
|
},
|
|
63
|
-
addListener:
|
|
232
|
+
addListener: _emitter.addListener.bind(_emitter),
|
|
233
|
+
/**
|
|
234
|
+
* Set deadline for task processing
|
|
235
|
+
*/
|
|
236
|
+
setDeadline(deadline) {
|
|
237
|
+
_deadline = deadline;
|
|
238
|
+
}
|
|
239
|
+
}, _interactionSet = /* @__PURE__ */ new Set(), _addInteractionSet = /* @__PURE__ */ new Set(), _deleteInteractionSet = /* @__PURE__ */ new Set(), _taskQueue = new TaskQueue({
|
|
240
|
+
onMoreTasks: _scheduleUpdate
|
|
241
|
+
}), _nextUpdateHandle = null, _inc = 0, _deadline = -1;
|
|
242
|
+
function _scheduleUpdate() {
|
|
243
|
+
_nextUpdateHandle || (_deadline > 0 ? _nextUpdateHandle = setTimeout(_processUpdate) : _nextUpdateHandle = (0, import_requestIdleCallback.default)(_processUpdate));
|
|
244
|
+
}
|
|
245
|
+
function _processUpdate() {
|
|
246
|
+
_nextUpdateHandle = null;
|
|
247
|
+
var interactionCount = _interactionSet.size;
|
|
248
|
+
_addInteractionSet.forEach(function(handle) {
|
|
249
|
+
return _interactionSet.add(handle);
|
|
250
|
+
}), _deleteInteractionSet.forEach(function(handle) {
|
|
251
|
+
return _interactionSet.delete(handle);
|
|
252
|
+
});
|
|
253
|
+
var nextInteractionCount = _interactionSet.size;
|
|
254
|
+
if (interactionCount !== 0 && nextInteractionCount === 0 ? _emitter.emit("interactionComplete") : interactionCount === 0 && nextInteractionCount !== 0 && _emitter.emit("interactionStart"), nextInteractionCount === 0) {
|
|
255
|
+
for (var begin = Date.now(); _taskQueue.hasTasksToProcess(); )
|
|
256
|
+
if (_taskQueue.processNext(), _deadline > 0 && Date.now() - begin >= _deadline) {
|
|
257
|
+
_scheduleUpdate();
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
64
260
|
}
|
|
65
|
-
|
|
261
|
+
_addInteractionSet.clear(), _deleteInteractionSet.clear();
|
|
262
|
+
}
|
|
66
263
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
264
|
0 && (module.exports = {
|
|
68
265
|
InteractionManager
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/modules/InteractionManager.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;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gBK;AAQ7C,MANID,qBAAqB,KAAKE,yBAAyB,IACrD7B,SAAS/C,KAAK,qBAAA,IACL0E,qBAAqB,KAAKE,yBAAyB,KAC5D7B,SAAS/C,KAAK,kBAAA,GAGZ4E,yBAAyB;AAI3B,aADMC,QAAQC,KAAKC,IAAG,GACftB,WAAWjC,kBAAiB;AAEjC,UADAiC,WAAW/B,YAAW,GAClB2C,YAAY,KAAKS,KAAKC,IAAG,IAAKF,SAASR,WAAW;AACpDb,wBAAAA;AACA;MACF;;AAGJQ,qBAAmBgB,MAAK,GACxBd,sBAAsBc,MAAK;AAC7B;",
|
|
5
|
+
"names": ["EventEmitter", "_registry", "addListener", "eventType", "listener", "context", "registrations", "_allocate", "registration", "remove", "delete", "add", "emit", "args", "Array", "from", "apply", "Set", "TaskQueue", "onMoreTasks", "_queueStack", "_onMoreTasks", "tasks", "popable", "enqueueTasks", "forEach", "task", "_enqueue", "cancelTasks", "tasksToCancel", "map", "queue", "filter", "includes", "idx", "length", "hasTasksToProcess", "_getCurrentQueue", "processNext", "shift", "_genPromise", "run", "invariant", "JSON", "stringify", "e", "Error", "taskName", "name", "message", "push", "stackIdx", "pop", "stackItem", "gen", "then", "catch", "ex", "setTimeout", "_emitter", "InteractionManager", "Events", "interactionStart", "interactionComplete", "runAfterInteractions", "promise", "Promise", "resolve", "_scheduleUpdate", "_taskQueue", "bind", "done", "cancel", "createInteractionHandle", "handle", "_inc", "_addInteractionSet", "clearInteractionHandle", "_deleteInteractionSet", "setDeadline", "deadline", "_deadline", "_interactionSet", "_nextUpdateHandle", "_processUpdate", "requestIdleCallback", "interactionCount", "size", "nextInteractionCount", "begin", "Date", "now", "clear"]
|
|
6
6
|
}
|