@player-ui/context-plugin 0.16.0--canary.891.38194
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/ContextPlugin.native.js +1407 -0
- package/dist/ContextPlugin.native.js.map +1 -0
- package/dist/cjs/index.cjs +621 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.legacy-esm.js +578 -0
- package/dist/index.mjs +578 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +34 -0
- package/src/__tests__/history.test.ts +27 -0
- package/src/__tests__/key.test.ts +22 -0
- package/src/__tests__/plugin.test.ts +376 -0
- package/src/__tests__/state-plugin.test.ts +346 -0
- package/src/__tests__/store.test.ts +107 -0
- package/src/history.ts +25 -0
- package/src/index.ts +6 -0
- package/src/key.ts +35 -0
- package/src/plugin.ts +261 -0
- package/src/state-plugin.ts +286 -0
- package/src/store.ts +205 -0
- package/src/symbols.ts +1 -0
- package/src/types.ts +57 -0
- package/src/utils.ts +17 -0
- package/types/history.d.ts +13 -0
- package/types/index.d.ts +7 -0
- package/types/key.d.ts +20 -0
- package/types/plugin.d.ts +64 -0
- package/types/state-plugin.d.ts +92 -0
- package/types/store.d.ts +26 -0
- package/types/symbols.d.ts +2 -0
- package/types/types.d.ts +45 -0
- package/types/utils.d.ts +7 -0
|
@@ -0,0 +1,1407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _array_without_holes(arr) {
|
|
11
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
12
|
+
}
|
|
13
|
+
function _assert_this_initialized(self) {
|
|
14
|
+
if (self === void 0) {
|
|
15
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
16
|
+
}
|
|
17
|
+
return self;
|
|
18
|
+
}
|
|
19
|
+
function _call_super(_this, derived, args) {
|
|
20
|
+
derived = _get_prototype_of(derived);
|
|
21
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
22
|
+
}
|
|
23
|
+
function _class_call_check(instance, Constructor) {
|
|
24
|
+
if (!(instance instanceof Constructor)) {
|
|
25
|
+
throw new TypeError("Cannot call a class as a function");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function _defineProperties(target, props) {
|
|
29
|
+
for(var i = 0; i < props.length; i++){
|
|
30
|
+
var descriptor = props[i];
|
|
31
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
32
|
+
descriptor.configurable = true;
|
|
33
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
34
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
38
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
39
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
40
|
+
return Constructor;
|
|
41
|
+
}
|
|
42
|
+
function _define_property(obj, key, value) {
|
|
43
|
+
if (key in obj) {
|
|
44
|
+
Object.defineProperty(obj, key, {
|
|
45
|
+
value: value,
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
obj[key] = value;
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
function _get_prototype_of(o) {
|
|
56
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
57
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
58
|
+
};
|
|
59
|
+
return _get_prototype_of(o);
|
|
60
|
+
}
|
|
61
|
+
function _inherits(subClass, superClass) {
|
|
62
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
63
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
64
|
+
}
|
|
65
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
66
|
+
constructor: {
|
|
67
|
+
value: subClass,
|
|
68
|
+
writable: true,
|
|
69
|
+
configurable: true
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
73
|
+
}
|
|
74
|
+
function _instanceof(left, right) {
|
|
75
|
+
"@swc/helpers - instanceof";
|
|
76
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
77
|
+
return !!right[Symbol.hasInstance](left);
|
|
78
|
+
} else {
|
|
79
|
+
return left instanceof right;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function _iterable_to_array(iter) {
|
|
83
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
84
|
+
}
|
|
85
|
+
function _iterable_to_array_limit(arr, i) {
|
|
86
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
87
|
+
if (_i == null) return;
|
|
88
|
+
var _arr = [];
|
|
89
|
+
var _n = true;
|
|
90
|
+
var _d = false;
|
|
91
|
+
var _s, _e;
|
|
92
|
+
try {
|
|
93
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
94
|
+
_arr.push(_s.value);
|
|
95
|
+
if (i && _arr.length === i) break;
|
|
96
|
+
}
|
|
97
|
+
} catch (err) {
|
|
98
|
+
_d = true;
|
|
99
|
+
_e = err;
|
|
100
|
+
} finally{
|
|
101
|
+
try {
|
|
102
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
103
|
+
} finally{
|
|
104
|
+
if (_d) throw _e;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return _arr;
|
|
108
|
+
}
|
|
109
|
+
function _non_iterable_rest() {
|
|
110
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
111
|
+
}
|
|
112
|
+
function _non_iterable_spread() {
|
|
113
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
114
|
+
}
|
|
115
|
+
function _object_spread(target) {
|
|
116
|
+
for(var i = 1; i < arguments.length; i++){
|
|
117
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
118
|
+
var ownKeys = Object.keys(source);
|
|
119
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
120
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
121
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
ownKeys.forEach(function(key) {
|
|
125
|
+
_define_property(target, key, source[key]);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return target;
|
|
129
|
+
}
|
|
130
|
+
function ownKeys(object, enumerableOnly) {
|
|
131
|
+
var keys = Object.keys(object);
|
|
132
|
+
if (Object.getOwnPropertySymbols) {
|
|
133
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
134
|
+
if (enumerableOnly) {
|
|
135
|
+
symbols = symbols.filter(function(sym) {
|
|
136
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
keys.push.apply(keys, symbols);
|
|
140
|
+
}
|
|
141
|
+
return keys;
|
|
142
|
+
}
|
|
143
|
+
function _object_spread_props(target, source) {
|
|
144
|
+
source = source != null ? source : {};
|
|
145
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
146
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
147
|
+
} else {
|
|
148
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
149
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return target;
|
|
153
|
+
}
|
|
154
|
+
function _possible_constructor_return(self, call) {
|
|
155
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
156
|
+
return call;
|
|
157
|
+
}
|
|
158
|
+
return _assert_this_initialized(self);
|
|
159
|
+
}
|
|
160
|
+
function _set_prototype_of(o, p) {
|
|
161
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
162
|
+
o.__proto__ = p;
|
|
163
|
+
return o;
|
|
164
|
+
};
|
|
165
|
+
return _set_prototype_of(o, p);
|
|
166
|
+
}
|
|
167
|
+
function _sliced_to_array(arr, i) {
|
|
168
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
169
|
+
}
|
|
170
|
+
function _to_array(arr) {
|
|
171
|
+
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
172
|
+
}
|
|
173
|
+
function _to_consumable_array(arr) {
|
|
174
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
175
|
+
}
|
|
176
|
+
function _type_of(obj) {
|
|
177
|
+
"@swc/helpers - typeof";
|
|
178
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
179
|
+
}
|
|
180
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
181
|
+
if (!o) return;
|
|
182
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
183
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
184
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
185
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
186
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
187
|
+
}
|
|
188
|
+
function _is_native_reflect_construct() {
|
|
189
|
+
try {
|
|
190
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
191
|
+
} catch (_) {}
|
|
192
|
+
return (_is_native_reflect_construct = function() {
|
|
193
|
+
return !!result;
|
|
194
|
+
})();
|
|
195
|
+
}
|
|
196
|
+
var ContextPlugin = function() {
|
|
197
|
+
var equalToOrIn = // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/tapable-ts@0.2.4/node_modules/tapable-ts/dist/hooks.mjs
|
|
198
|
+
function equalToOrIn(value, check) {
|
|
199
|
+
if (Array.isArray(check)) {
|
|
200
|
+
return check.includes(value);
|
|
201
|
+
}
|
|
202
|
+
return check === value;
|
|
203
|
+
};
|
|
204
|
+
var callTap = function callTap(tap, args, ctx) {
|
|
205
|
+
var _tap;
|
|
206
|
+
if (tap.context) {
|
|
207
|
+
var _tap1;
|
|
208
|
+
return (_tap1 = tap).callback.apply(_tap1, [
|
|
209
|
+
ctx
|
|
210
|
+
].concat(_to_consumable_array(args)));
|
|
211
|
+
}
|
|
212
|
+
return (_tap = tap).callback.apply(_tap, _to_consumable_array(args));
|
|
213
|
+
};
|
|
214
|
+
var getContextPlugin = // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/utils.ts
|
|
215
|
+
function getContextPlugin(player) {
|
|
216
|
+
var existing = player.findPlugin(ContextPluginSymbol);
|
|
217
|
+
var plugin = existing !== null && existing !== void 0 ? existing : new ContextPlugin();
|
|
218
|
+
if (!existing) {
|
|
219
|
+
player.registerPlugin(plugin);
|
|
220
|
+
}
|
|
221
|
+
return plugin;
|
|
222
|
+
};
|
|
223
|
+
var __defProp = Object.defineProperty;
|
|
224
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
225
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
226
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
227
|
+
var __export = function __export(target, all) {
|
|
228
|
+
for(var name in all)__defProp(target, name, {
|
|
229
|
+
get: all[name],
|
|
230
|
+
enumerable: true
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
234
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
235
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
236
|
+
try {
|
|
237
|
+
var _loop = function() {
|
|
238
|
+
var key = _step.value;
|
|
239
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
240
|
+
get: function get() {
|
|
241
|
+
return from[key];
|
|
242
|
+
},
|
|
243
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
247
|
+
} catch (err) {
|
|
248
|
+
_didIteratorError = true;
|
|
249
|
+
_iteratorError = err;
|
|
250
|
+
} finally{
|
|
251
|
+
try {
|
|
252
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
253
|
+
_iterator.return();
|
|
254
|
+
}
|
|
255
|
+
} finally{
|
|
256
|
+
if (_didIteratorError) {
|
|
257
|
+
throw _iteratorError;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return to;
|
|
263
|
+
};
|
|
264
|
+
var __toCommonJS = function __toCommonJS(mod) {
|
|
265
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
266
|
+
value: true
|
|
267
|
+
}), mod);
|
|
268
|
+
};
|
|
269
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/index.ts
|
|
270
|
+
var src_exports = {};
|
|
271
|
+
__export(src_exports, {
|
|
272
|
+
ContextPlugin: function ContextPlugin1() {
|
|
273
|
+
return ContextPlugin;
|
|
274
|
+
},
|
|
275
|
+
ContextPluginSymbol: function ContextPluginSymbol1() {
|
|
276
|
+
return ContextPluginSymbol;
|
|
277
|
+
},
|
|
278
|
+
StateContextPlugin: function StateContextPlugin1() {
|
|
279
|
+
return StateContextPlugin;
|
|
280
|
+
},
|
|
281
|
+
dataContextKey: function dataContextKey1() {
|
|
282
|
+
return dataContextKey;
|
|
283
|
+
},
|
|
284
|
+
defineContextKey: function defineContextKey1() {
|
|
285
|
+
return defineContextKey;
|
|
286
|
+
},
|
|
287
|
+
flowIdContextKey: function flowIdContextKey1() {
|
|
288
|
+
return flowIdContextKey;
|
|
289
|
+
},
|
|
290
|
+
flowStateContextKey: function flowStateContextKey1() {
|
|
291
|
+
return flowStateContextKey;
|
|
292
|
+
},
|
|
293
|
+
getContextPlugin: function getContextPlugin1() {
|
|
294
|
+
return getContextPlugin;
|
|
295
|
+
},
|
|
296
|
+
nameOfContextKey: function nameOfContextKey1() {
|
|
297
|
+
return nameOfContextKey;
|
|
298
|
+
},
|
|
299
|
+
playerStateContextKey: function playerStateContextKey1() {
|
|
300
|
+
return playerStateContextKey;
|
|
301
|
+
},
|
|
302
|
+
playerStatusContextKey: function playerStatusContextKey1() {
|
|
303
|
+
return playerStatusContextKey;
|
|
304
|
+
},
|
|
305
|
+
resolveContextKeySymbol: function resolveContextKeySymbol1() {
|
|
306
|
+
return resolveContextKeySymbol;
|
|
307
|
+
},
|
|
308
|
+
setDataActionKey: function setDataActionKey1() {
|
|
309
|
+
return setDataActionKey;
|
|
310
|
+
},
|
|
311
|
+
transitionActionKey: function transitionActionKey1() {
|
|
312
|
+
return transitionActionKey;
|
|
313
|
+
},
|
|
314
|
+
validationContextKey: function validationContextKey1() {
|
|
315
|
+
return validationContextKey;
|
|
316
|
+
},
|
|
317
|
+
viewContextKey: function viewContextKey1() {
|
|
318
|
+
return viewContextKey;
|
|
319
|
+
},
|
|
320
|
+
viewIdContextKey: function viewIdContextKey1() {
|
|
321
|
+
return viewIdContextKey;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
var InterceptionManager = /*#__PURE__*/ function() {
|
|
325
|
+
function InterceptionManager() {
|
|
326
|
+
_class_call_check(this, InterceptionManager);
|
|
327
|
+
this.interceptions = [];
|
|
328
|
+
this.interceptionKeySet = /* @__PURE__ */ new Set();
|
|
329
|
+
}
|
|
330
|
+
_create_class(InterceptionManager, [
|
|
331
|
+
{
|
|
332
|
+
key: "isUsed",
|
|
333
|
+
value: function isUsed() {
|
|
334
|
+
return this.interceptions.length > 0;
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
key: "intercept",
|
|
339
|
+
value: function intercept(int) {
|
|
340
|
+
var _this = this;
|
|
341
|
+
this.interceptions.push(int);
|
|
342
|
+
Object.keys(int).forEach(function(s) {
|
|
343
|
+
_this.interceptionKeySet.add(s);
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
key: "tap",
|
|
349
|
+
value: function tap(tap) {
|
|
350
|
+
if (this.interceptionKeySet.has("tap")) {
|
|
351
|
+
this.interceptions.forEach(function(i) {
|
|
352
|
+
var _a;
|
|
353
|
+
(_a = i.tap) == null ? void 0 : _a.call(i, tap);
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
key: "call",
|
|
360
|
+
value: function call(ctx) {
|
|
361
|
+
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
362
|
+
args[_key - 1] = arguments[_key];
|
|
363
|
+
}
|
|
364
|
+
if (this.interceptionKeySet.has("call")) {
|
|
365
|
+
this.interceptions.forEach(function(i) {
|
|
366
|
+
var _a, _b;
|
|
367
|
+
if (i.context) {
|
|
368
|
+
var _a1;
|
|
369
|
+
(_a = i.call) == null ? void 0 : (_a1 = _a).call.apply(_a1, [
|
|
370
|
+
i,
|
|
371
|
+
ctx
|
|
372
|
+
].concat(_to_consumable_array(args)));
|
|
373
|
+
} else {
|
|
374
|
+
var _b1;
|
|
375
|
+
(_b = i.call) == null ? void 0 : (_b1 = _b).call.apply(_b1, [
|
|
376
|
+
i
|
|
377
|
+
].concat(_to_consumable_array(args)));
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
key: "loop",
|
|
385
|
+
value: function loop() {
|
|
386
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
387
|
+
args[_key] = arguments[_key];
|
|
388
|
+
}
|
|
389
|
+
if (this.interceptionKeySet.has("loop")) {
|
|
390
|
+
this.interceptions.forEach(function(i) {
|
|
391
|
+
var _a;
|
|
392
|
+
var _a1;
|
|
393
|
+
(_a1 = i.loop) == null ? void 0 : (_a = _a1).call.apply(_a, [
|
|
394
|
+
i
|
|
395
|
+
].concat(_to_consumable_array(args)));
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
key: "error",
|
|
402
|
+
value: function error(err) {
|
|
403
|
+
if (this.interceptionKeySet.has("error")) {
|
|
404
|
+
if (_instanceof(err, Error)) {
|
|
405
|
+
var asError = err;
|
|
406
|
+
this.interceptions.forEach(function(i) {
|
|
407
|
+
var _a;
|
|
408
|
+
(_a = i.error) == null ? void 0 : _a.call(i, asError);
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
key: "result",
|
|
416
|
+
value: function result(r) {
|
|
417
|
+
if (this.interceptionKeySet.has("result")) {
|
|
418
|
+
this.interceptions.forEach(function(i) {
|
|
419
|
+
var _a;
|
|
420
|
+
(_a = i.result) == null ? void 0 : _a.call(i, r);
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
key: "done",
|
|
427
|
+
value: function done() {
|
|
428
|
+
if (this.interceptionKeySet.has("done")) {
|
|
429
|
+
this.interceptions.forEach(function(i) {
|
|
430
|
+
var _a;
|
|
431
|
+
(_a = i.done) == null ? void 0 : _a.call(i);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
]);
|
|
437
|
+
return InterceptionManager;
|
|
438
|
+
}();
|
|
439
|
+
var Hook = /*#__PURE__*/ function() {
|
|
440
|
+
function Hook() {
|
|
441
|
+
_class_call_check(this, Hook);
|
|
442
|
+
this.taps = [];
|
|
443
|
+
this.interceptions = new InterceptionManager();
|
|
444
|
+
}
|
|
445
|
+
_create_class(Hook, [
|
|
446
|
+
{
|
|
447
|
+
key: "tap",
|
|
448
|
+
value: function tap(options, callback) {
|
|
449
|
+
var resolvedOptions = typeof options === "string" ? {
|
|
450
|
+
name: options,
|
|
451
|
+
context: false
|
|
452
|
+
} : _object_spread({
|
|
453
|
+
context: false
|
|
454
|
+
}, options);
|
|
455
|
+
var key = Symbol(resolvedOptions.name);
|
|
456
|
+
var tap = _object_spread_props(_object_spread({
|
|
457
|
+
key: key
|
|
458
|
+
}, resolvedOptions), {
|
|
459
|
+
callback: callback
|
|
460
|
+
});
|
|
461
|
+
if (tap.before) {
|
|
462
|
+
var insertionIndex = this.taps.length;
|
|
463
|
+
var beforeSet = new Set(Array.isArray(tap.before) ? tap.before : [
|
|
464
|
+
tap.before
|
|
465
|
+
]);
|
|
466
|
+
for(insertionIndex; insertionIndex > 0 && beforeSet.size > 0; insertionIndex--){
|
|
467
|
+
var t = this.taps[insertionIndex - 1];
|
|
468
|
+
if (beforeSet.has(t.name)) {
|
|
469
|
+
beforeSet.delete(t.name);
|
|
470
|
+
}
|
|
471
|
+
if (t.before && equalToOrIn(tap.name, t.before)) {
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
this.taps.splice(insertionIndex, 0, tap);
|
|
476
|
+
} else {
|
|
477
|
+
this.taps.push(tap);
|
|
478
|
+
}
|
|
479
|
+
this.interceptions.tap(tap);
|
|
480
|
+
return tap;
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
key: "untap",
|
|
485
|
+
value: function untap(tap) {
|
|
486
|
+
this.taps = this.taps.filter(function(t) {
|
|
487
|
+
return t.key !== tap.key;
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
key: "isUsed",
|
|
493
|
+
value: function isUsed() {
|
|
494
|
+
return this.taps.length > 0 || this.interceptions.isUsed();
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
key: "intercept",
|
|
499
|
+
value: function intercept(int) {
|
|
500
|
+
this.interceptions.intercept(int);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
]);
|
|
504
|
+
return Hook;
|
|
505
|
+
}();
|
|
506
|
+
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
507
|
+
_inherits(SyncHook, Hook);
|
|
508
|
+
function SyncHook() {
|
|
509
|
+
_class_call_check(this, SyncHook);
|
|
510
|
+
return _call_super(this, SyncHook, arguments);
|
|
511
|
+
}
|
|
512
|
+
_create_class(SyncHook, [
|
|
513
|
+
{
|
|
514
|
+
key: "call",
|
|
515
|
+
value: function call() {
|
|
516
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
517
|
+
args[_key] = arguments[_key];
|
|
518
|
+
}
|
|
519
|
+
var _this_interceptions;
|
|
520
|
+
if (!this.isUsed()) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
var ctx = {};
|
|
524
|
+
(_this_interceptions = this.interceptions).call.apply(_this_interceptions, [
|
|
525
|
+
ctx
|
|
526
|
+
].concat(_to_consumable_array(args)));
|
|
527
|
+
try {
|
|
528
|
+
this.taps.forEach(function(t) {
|
|
529
|
+
callTap(t, args, ctx);
|
|
530
|
+
});
|
|
531
|
+
} catch (err) {
|
|
532
|
+
this.interceptions.error(err);
|
|
533
|
+
throw err;
|
|
534
|
+
}
|
|
535
|
+
this.interceptions.done();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
]);
|
|
539
|
+
return SyncHook;
|
|
540
|
+
}(Hook);
|
|
541
|
+
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
542
|
+
_inherits(SyncWaterfallHook, Hook);
|
|
543
|
+
function SyncWaterfallHook() {
|
|
544
|
+
_class_call_check(this, SyncWaterfallHook);
|
|
545
|
+
return _call_super(this, SyncWaterfallHook, arguments);
|
|
546
|
+
}
|
|
547
|
+
_create_class(SyncWaterfallHook, [
|
|
548
|
+
{
|
|
549
|
+
key: "call",
|
|
550
|
+
value: function call() {
|
|
551
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
552
|
+
args[_key] = arguments[_key];
|
|
553
|
+
}
|
|
554
|
+
var _this_interceptions;
|
|
555
|
+
var ctx = {};
|
|
556
|
+
(_this_interceptions = this.interceptions).call.apply(_this_interceptions, [
|
|
557
|
+
ctx
|
|
558
|
+
].concat(_to_consumable_array(args)));
|
|
559
|
+
var _args = _to_array(args), rtn = _args[0], rest = _args.slice(1);
|
|
560
|
+
for(var tapIndex = 0; tapIndex < this.taps.length; tapIndex += 1){
|
|
561
|
+
var tapValue = callTap(this.taps[tapIndex], [
|
|
562
|
+
rtn
|
|
563
|
+
].concat(_to_consumable_array(rest)), ctx);
|
|
564
|
+
if (tapValue !== void 0) {
|
|
565
|
+
rtn = tapValue;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
this.interceptions.result(rtn);
|
|
569
|
+
return rtn;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
]);
|
|
573
|
+
return SyncWaterfallHook;
|
|
574
|
+
}(Hook);
|
|
575
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/key.ts
|
|
576
|
+
var KEY_NAMESPACE = "player-ui.context.";
|
|
577
|
+
var defineContextKey = function defineContextKey(name, description) {
|
|
578
|
+
return {
|
|
579
|
+
symbol: Symbol.for("".concat(KEY_NAMESPACE).concat(name)),
|
|
580
|
+
description: description
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
var resolveContextKeySymbol = function resolveContextKeySymbol(name) {
|
|
584
|
+
return Symbol.for("".concat(KEY_NAMESPACE).concat(name));
|
|
585
|
+
};
|
|
586
|
+
var nameOfContextKey = function nameOfContextKey(key) {
|
|
587
|
+
var k = Symbol.keyFor(key.symbol);
|
|
588
|
+
if (!k || !k.startsWith(KEY_NAMESPACE)) return void 0;
|
|
589
|
+
return k.slice(KEY_NAMESPACE.length);
|
|
590
|
+
};
|
|
591
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/store.ts
|
|
592
|
+
var deepFreezeEntry = function deepFreezeEntry(entry) {
|
|
593
|
+
Object.freeze(entry);
|
|
594
|
+
return entry;
|
|
595
|
+
};
|
|
596
|
+
var tombstone = function tombstone(description) {
|
|
597
|
+
return function() {
|
|
598
|
+
throw new Error('[ContextPlugin] Action "'.concat(description, '" is no longer valid — its flow has ended'));
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
var tombstoneFunctions = function tombstoneFunctions1(value, description) {
|
|
602
|
+
if (typeof value === "function") {
|
|
603
|
+
return tombstone(description);
|
|
604
|
+
}
|
|
605
|
+
if (Array.isArray(value)) {
|
|
606
|
+
return value.map(function(item) {
|
|
607
|
+
return tombstoneFunctions(item, description);
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
if (value !== null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object") {
|
|
611
|
+
var out = {};
|
|
612
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
613
|
+
try {
|
|
614
|
+
for(var _iterator = Object.entries(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
615
|
+
var _step_value = _sliced_to_array(_step.value, 2), k = _step_value[0], v = _step_value[1];
|
|
616
|
+
out[k] = tombstoneFunctions(v, description);
|
|
617
|
+
}
|
|
618
|
+
} catch (err) {
|
|
619
|
+
_didIteratorError = true;
|
|
620
|
+
_iteratorError = err;
|
|
621
|
+
} finally{
|
|
622
|
+
try {
|
|
623
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
624
|
+
_iterator.return();
|
|
625
|
+
}
|
|
626
|
+
} finally{
|
|
627
|
+
if (_didIteratorError) {
|
|
628
|
+
throw _iteratorError;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return out;
|
|
633
|
+
}
|
|
634
|
+
return value;
|
|
635
|
+
};
|
|
636
|
+
var ContextStore = /*#__PURE__*/ function() {
|
|
637
|
+
function ContextStore() {
|
|
638
|
+
_class_call_check(this, ContextStore);
|
|
639
|
+
this.entries = /* @__PURE__ */ new Map();
|
|
640
|
+
/** source symbol -> set of target symbols (reverse index for invalidation). */ this.dependents = /* @__PURE__ */ new Map();
|
|
641
|
+
}
|
|
642
|
+
_create_class(ContextStore, [
|
|
643
|
+
{
|
|
644
|
+
key: "register",
|
|
645
|
+
value: function register(key) {
|
|
646
|
+
if (this.entries.has(key.symbol)) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
this.entries.set(key.symbol, {
|
|
650
|
+
key: key,
|
|
651
|
+
hasLiteral: false
|
|
652
|
+
});
|
|
653
|
+
return true;
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
key: "set",
|
|
658
|
+
value: function set(key, value) {
|
|
659
|
+
var existing = this.entries.get(key.symbol);
|
|
660
|
+
if (existing) {
|
|
661
|
+
existing.hasLiteral = true;
|
|
662
|
+
existing.literal = value;
|
|
663
|
+
existing.key = key;
|
|
664
|
+
} else {
|
|
665
|
+
this.entries.set(key.symbol, {
|
|
666
|
+
key: key,
|
|
667
|
+
hasLiteral: true,
|
|
668
|
+
literal: value
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
key: "registerTransform",
|
|
675
|
+
value: function registerTransform(key, transform) {
|
|
676
|
+
var _existing_transform;
|
|
677
|
+
var existing = this.entries.get(key.symbol);
|
|
678
|
+
var previousSources = existing === null || existing === void 0 ? void 0 : (_existing_transform = existing.transform) === null || _existing_transform === void 0 ? void 0 : _existing_transform.sources;
|
|
679
|
+
if (previousSources) {
|
|
680
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
681
|
+
try {
|
|
682
|
+
for(var _iterator = previousSources[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
683
|
+
var src = _step.value;
|
|
684
|
+
var _this_dependents_get;
|
|
685
|
+
(_this_dependents_get = this.dependents.get(src.symbol)) === null || _this_dependents_get === void 0 ? void 0 : _this_dependents_get.delete(key.symbol);
|
|
686
|
+
}
|
|
687
|
+
} catch (err) {
|
|
688
|
+
_didIteratorError = true;
|
|
689
|
+
_iteratorError = err;
|
|
690
|
+
} finally{
|
|
691
|
+
try {
|
|
692
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
693
|
+
_iterator.return();
|
|
694
|
+
}
|
|
695
|
+
} finally{
|
|
696
|
+
if (_didIteratorError) {
|
|
697
|
+
throw _iteratorError;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
var stored = {
|
|
703
|
+
sources: transform.sources,
|
|
704
|
+
compute: transform.compute
|
|
705
|
+
};
|
|
706
|
+
if (existing) {
|
|
707
|
+
existing.transform = stored;
|
|
708
|
+
existing.key = key;
|
|
709
|
+
} else {
|
|
710
|
+
this.entries.set(key.symbol, {
|
|
711
|
+
key: key,
|
|
712
|
+
hasLiteral: false,
|
|
713
|
+
transform: stored
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
717
|
+
try {
|
|
718
|
+
for(var _iterator1 = transform.sources[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
719
|
+
var src1 = _step1.value;
|
|
720
|
+
var set = this.dependents.get(src1.symbol);
|
|
721
|
+
if (!set) {
|
|
722
|
+
set = /* @__PURE__ */ new Set();
|
|
723
|
+
this.dependents.set(src1.symbol, set);
|
|
724
|
+
}
|
|
725
|
+
set.add(key.symbol);
|
|
726
|
+
}
|
|
727
|
+
} catch (err) {
|
|
728
|
+
_didIteratorError1 = true;
|
|
729
|
+
_iteratorError1 = err;
|
|
730
|
+
} finally{
|
|
731
|
+
try {
|
|
732
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
733
|
+
_iterator1.return();
|
|
734
|
+
}
|
|
735
|
+
} finally{
|
|
736
|
+
if (_didIteratorError1) {
|
|
737
|
+
throw _iteratorError1;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
previousSources: previousSources
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
key: "get",
|
|
748
|
+
value: function get(key) {
|
|
749
|
+
return this.compute(key.symbol);
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
key: "has",
|
|
754
|
+
value: function has(key) {
|
|
755
|
+
var entry = this.entries.get(key.symbol);
|
|
756
|
+
return Boolean(entry && (entry.hasLiteral || entry.transform));
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
/** Return the keys that depend on the given source key (direct dependents only). */ key: "dependentsOf",
|
|
761
|
+
value: function dependentsOf(sourceSymbol) {
|
|
762
|
+
var set = this.dependents.get(sourceSymbol);
|
|
763
|
+
if (!set || set.size === 0) {
|
|
764
|
+
return [];
|
|
765
|
+
}
|
|
766
|
+
var out = [];
|
|
767
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
768
|
+
try {
|
|
769
|
+
for(var _iterator = set[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
770
|
+
var targetSymbol = _step.value;
|
|
771
|
+
var target = this.entries.get(targetSymbol);
|
|
772
|
+
if (target) {
|
|
773
|
+
out.push(target.key);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
} catch (err) {
|
|
777
|
+
_didIteratorError = true;
|
|
778
|
+
_iteratorError = err;
|
|
779
|
+
} finally{
|
|
780
|
+
try {
|
|
781
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
782
|
+
_iterator.return();
|
|
783
|
+
}
|
|
784
|
+
} finally{
|
|
785
|
+
if (_didIteratorError) {
|
|
786
|
+
throw _iteratorError;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return out;
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
key: "list",
|
|
795
|
+
value: function list() {
|
|
796
|
+
var out = [];
|
|
797
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
798
|
+
try {
|
|
799
|
+
for(var _iterator = this.entries.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
800
|
+
var entry = _step.value;
|
|
801
|
+
out.push({
|
|
802
|
+
symbol: entry.key.symbol,
|
|
803
|
+
description: entry.key.description,
|
|
804
|
+
hasValue: entry.hasLiteral,
|
|
805
|
+
hasTransform: Boolean(entry.transform)
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
} catch (err) {
|
|
809
|
+
_didIteratorError = true;
|
|
810
|
+
_iteratorError = err;
|
|
811
|
+
} finally{
|
|
812
|
+
try {
|
|
813
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
814
|
+
_iterator.return();
|
|
815
|
+
}
|
|
816
|
+
} finally{
|
|
817
|
+
if (_didIteratorError) {
|
|
818
|
+
throw _iteratorError;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
return out;
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
key: "freeze",
|
|
827
|
+
value: function freeze(meta) {
|
|
828
|
+
var frozenEntries = [];
|
|
829
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
830
|
+
try {
|
|
831
|
+
for(var _iterator = this.entries.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
832
|
+
var entry = _step.value;
|
|
833
|
+
if (!entry.hasLiteral && !entry.transform) {
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
var computed = this.compute(entry.key.symbol);
|
|
837
|
+
var value = tombstoneFunctions(computed, entry.key.description);
|
|
838
|
+
frozenEntries.push(deepFreezeEntry({
|
|
839
|
+
symbol: entry.key.symbol,
|
|
840
|
+
name: nameOfContextKey(entry.key),
|
|
841
|
+
description: entry.key.description,
|
|
842
|
+
value: value
|
|
843
|
+
}));
|
|
844
|
+
}
|
|
845
|
+
} catch (err) {
|
|
846
|
+
_didIteratorError = true;
|
|
847
|
+
_iteratorError = err;
|
|
848
|
+
} finally{
|
|
849
|
+
try {
|
|
850
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
851
|
+
_iterator.return();
|
|
852
|
+
}
|
|
853
|
+
} finally{
|
|
854
|
+
if (_didIteratorError) {
|
|
855
|
+
throw _iteratorError;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
var bySymbol = new Map(frozenEntries.map(function(e) {
|
|
860
|
+
return [
|
|
861
|
+
e.symbol,
|
|
862
|
+
e.value
|
|
863
|
+
];
|
|
864
|
+
}));
|
|
865
|
+
var snapshot = {
|
|
866
|
+
flowId: meta.flowId,
|
|
867
|
+
endedAt: meta.endedAt,
|
|
868
|
+
entries: Object.freeze(frozenEntries),
|
|
869
|
+
get: function get(key) {
|
|
870
|
+
return bySymbol.get(key.symbol);
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
return Object.freeze(snapshot);
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
key: "compute",
|
|
878
|
+
value: function compute(sym) {
|
|
879
|
+
var _this = this;
|
|
880
|
+
var entry = this.entries.get(sym);
|
|
881
|
+
if (!entry) return void 0;
|
|
882
|
+
if (entry.hasLiteral) return entry.literal;
|
|
883
|
+
if (!entry.transform) return void 0;
|
|
884
|
+
var reader = function reader(otherKey) {
|
|
885
|
+
return _this.compute(otherKey.symbol);
|
|
886
|
+
};
|
|
887
|
+
return entry.transform.compute(reader);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
]);
|
|
891
|
+
return ContextStore;
|
|
892
|
+
}();
|
|
893
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/history.ts
|
|
894
|
+
var ContextHistory = /*#__PURE__*/ function() {
|
|
895
|
+
function ContextHistory() {
|
|
896
|
+
_class_call_check(this, ContextHistory);
|
|
897
|
+
this.stack = [];
|
|
898
|
+
}
|
|
899
|
+
_create_class(ContextHistory, [
|
|
900
|
+
{
|
|
901
|
+
key: "push",
|
|
902
|
+
value: function push(snapshot) {
|
|
903
|
+
this.stack.push(snapshot);
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
key: "entries",
|
|
908
|
+
value: function entries() {
|
|
909
|
+
return this.stack;
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
key: "size",
|
|
914
|
+
value: function size() {
|
|
915
|
+
return this.stack.length;
|
|
916
|
+
}
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
key: "clear",
|
|
920
|
+
value: function clear() {
|
|
921
|
+
this.stack = [];
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
]);
|
|
925
|
+
return ContextHistory;
|
|
926
|
+
}();
|
|
927
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/symbols.ts
|
|
928
|
+
var ContextPluginSymbol = Symbol.for("ContextPlugin");
|
|
929
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/plugin.ts
|
|
930
|
+
var subscriptionCounter = 0;
|
|
931
|
+
var _ContextPlugin = /*#__PURE__*/ function() {
|
|
932
|
+
function _ContextPlugin() {
|
|
933
|
+
_class_call_check(this, _ContextPlugin);
|
|
934
|
+
this.name = "context";
|
|
935
|
+
this.symbol = _ContextPlugin.Symbol;
|
|
936
|
+
this.hooks = {
|
|
937
|
+
onSet: new SyncHook(),
|
|
938
|
+
resolveValue: new SyncWaterfallHook(),
|
|
939
|
+
onRegister: new SyncHook(),
|
|
940
|
+
onFlowFrozen: new SyncHook()
|
|
941
|
+
};
|
|
942
|
+
this.transforms = /* @__PURE__ */ new Map();
|
|
943
|
+
this.perKeySubs = /* @__PURE__ */ new Map();
|
|
944
|
+
this.globalSubs = /* @__PURE__ */ new Map();
|
|
945
|
+
this.tokenIndex = /* @__PURE__ */ new Map();
|
|
946
|
+
this.store = new ContextStore();
|
|
947
|
+
this.historyStack = new ContextHistory();
|
|
948
|
+
}
|
|
949
|
+
_create_class(_ContextPlugin, [
|
|
950
|
+
{
|
|
951
|
+
key: "apply",
|
|
952
|
+
value: function apply(player) {
|
|
953
|
+
var _this = this;
|
|
954
|
+
var existing = player.findPlugin(ContextPluginSymbol);
|
|
955
|
+
if (existing !== void 0 && existing !== this) {
|
|
956
|
+
this.store = existing.store;
|
|
957
|
+
this.historyStack = existing.historyStack;
|
|
958
|
+
this.transforms = existing.transforms;
|
|
959
|
+
this.perKeySubs = existing.perKeySubs;
|
|
960
|
+
this.globalSubs = existing.globalSubs;
|
|
961
|
+
this.tokenIndex = existing.tokenIndex;
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
player.hooks.onStart.tap(this.name, function(flow) {
|
|
965
|
+
_this.currentFlowId = flow === null || flow === void 0 ? void 0 : flow.id;
|
|
966
|
+
});
|
|
967
|
+
player.hooks.onEnd.tap(this.name, function() {
|
|
968
|
+
var snapshot = _this.store.freeze({
|
|
969
|
+
flowId: _this.currentFlowId,
|
|
970
|
+
endedAt: Date.now()
|
|
971
|
+
});
|
|
972
|
+
_this.historyStack.push(snapshot);
|
|
973
|
+
_this.hooks.onFlowFrozen.call(snapshot);
|
|
974
|
+
_this.rotateStore();
|
|
975
|
+
_this.currentFlowId = void 0;
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
key: "register",
|
|
981
|
+
value: function register(key) {
|
|
982
|
+
var added = this.store.register(key);
|
|
983
|
+
if (added) {
|
|
984
|
+
this.hooks.onRegister.call(key);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
key: "set",
|
|
990
|
+
value: function set(key, value) {
|
|
991
|
+
var isFirstSighting = !this.store.has(key);
|
|
992
|
+
this.store.set(key, value);
|
|
993
|
+
if (isFirstSighting) {
|
|
994
|
+
this.hooks.onRegister.call(key);
|
|
995
|
+
}
|
|
996
|
+
this.notify(key, value);
|
|
997
|
+
var dependents = this.store.dependentsOf(key.symbol);
|
|
998
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
999
|
+
try {
|
|
1000
|
+
for(var _iterator = dependents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1001
|
+
var dep = _step.value;
|
|
1002
|
+
var computed = this.store.get(dep);
|
|
1003
|
+
this.notify(dep, computed);
|
|
1004
|
+
}
|
|
1005
|
+
} catch (err) {
|
|
1006
|
+
_didIteratorError = true;
|
|
1007
|
+
_iteratorError = err;
|
|
1008
|
+
} finally{
|
|
1009
|
+
try {
|
|
1010
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1011
|
+
_iterator.return();
|
|
1012
|
+
}
|
|
1013
|
+
} finally{
|
|
1014
|
+
if (_didIteratorError) {
|
|
1015
|
+
throw _iteratorError;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
key: "get",
|
|
1023
|
+
value: function get(key) {
|
|
1024
|
+
var raw = this.store.get(key);
|
|
1025
|
+
var resolved = this.hooks.resolveValue.call(raw, key);
|
|
1026
|
+
return resolved;
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
key: "has",
|
|
1031
|
+
value: function has(key) {
|
|
1032
|
+
return this.store.has(key);
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
key: "registerTransform",
|
|
1037
|
+
value: function registerTransform(key, transform) {
|
|
1038
|
+
var isFirstSighting = !this.store.has(key);
|
|
1039
|
+
this.store.registerTransform(key, transform);
|
|
1040
|
+
this.transforms.set(key.symbol, {
|
|
1041
|
+
key: key,
|
|
1042
|
+
transform: {
|
|
1043
|
+
sources: transform.sources,
|
|
1044
|
+
compute: transform.compute
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
if (isFirstSighting) {
|
|
1048
|
+
this.hooks.onRegister.call(key);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
key: "subscribe",
|
|
1054
|
+
value: function subscribe(key, handler) {
|
|
1055
|
+
var token = this.nextToken();
|
|
1056
|
+
var bucket = this.perKeySubs.get(key.symbol);
|
|
1057
|
+
if (!bucket) {
|
|
1058
|
+
bucket = /* @__PURE__ */ new Map();
|
|
1059
|
+
this.perKeySubs.set(key.symbol, bucket);
|
|
1060
|
+
}
|
|
1061
|
+
bucket.set(token, handler);
|
|
1062
|
+
this.tokenIndex.set(token, key.symbol);
|
|
1063
|
+
return token;
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
key: "subscribeAll",
|
|
1068
|
+
value: function subscribeAll(handler) {
|
|
1069
|
+
var token = this.nextToken();
|
|
1070
|
+
this.globalSubs.set(token, handler);
|
|
1071
|
+
this.tokenIndex.set(token, void 0);
|
|
1072
|
+
return token;
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
key: "unsubscribe",
|
|
1077
|
+
value: function unsubscribe(token) {
|
|
1078
|
+
var owner = this.tokenIndex.get(token);
|
|
1079
|
+
if (owner === void 0) {
|
|
1080
|
+
this.globalSubs.delete(token);
|
|
1081
|
+
} else {
|
|
1082
|
+
var _this_perKeySubs_get;
|
|
1083
|
+
(_this_perKeySubs_get = this.perKeySubs.get(owner)) === null || _this_perKeySubs_get === void 0 ? void 0 : _this_perKeySubs_get.delete(token);
|
|
1084
|
+
}
|
|
1085
|
+
this.tokenIndex.delete(token);
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
key: "list",
|
|
1090
|
+
value: function list() {
|
|
1091
|
+
return this.store.list();
|
|
1092
|
+
}
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
key: "history",
|
|
1096
|
+
value: function history() {
|
|
1097
|
+
return this.historyStack.entries();
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
key: "snapshot",
|
|
1102
|
+
value: function snapshot() {
|
|
1103
|
+
return this.store.freeze({
|
|
1104
|
+
flowId: this.currentFlowId,
|
|
1105
|
+
endedAt: Date.now()
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
/**
|
|
1111
|
+
* Bridge-friendly: set a value by string name. Used by native wrappers that
|
|
1112
|
+
* cannot construct a `ContextKey` object directly.
|
|
1113
|
+
*/ key: "setByName",
|
|
1114
|
+
value: function setByName(name, description, value) {
|
|
1115
|
+
this.set(this.ensureNamedKey(name, description), value);
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
/** Bridge-friendly: get a value by string name. */ key: "getByName",
|
|
1120
|
+
value: function getByName(name) {
|
|
1121
|
+
return this.get(this.ensureNamedKey(name));
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
/** Bridge-friendly: check presence by string name. */ key: "hasByName",
|
|
1126
|
+
value: function hasByName(name) {
|
|
1127
|
+
return this.has(this.ensureNamedKey(name));
|
|
1128
|
+
}
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
/** Bridge-friendly: subscribe by string name. */ key: "subscribeByName",
|
|
1132
|
+
value: function subscribeByName(name, description, handler) {
|
|
1133
|
+
return this.subscribe(this.ensureNamedKey(name, description), function(value) {
|
|
1134
|
+
return handler(value, name);
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
/**
|
|
1140
|
+
* Bridge-friendly: subscribe to all updates. The handler receives the
|
|
1141
|
+
* key's resolved name (or undefined for non-namespaced keys).
|
|
1142
|
+
*/ key: "subscribeAllByName",
|
|
1143
|
+
value: function subscribeAllByName(handler) {
|
|
1144
|
+
return this.subscribeAll(function(value, key) {
|
|
1145
|
+
return handler(value, nameOfContextKey(key), key.description);
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
key: "ensureNamedKey",
|
|
1151
|
+
value: function ensureNamedKey(name, description) {
|
|
1152
|
+
return defineContextKey(name, description !== null && description !== void 0 ? description : name);
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
key: "notify",
|
|
1157
|
+
value: function notify(key, value) {
|
|
1158
|
+
this.hooks.onSet.call(key, value);
|
|
1159
|
+
var bucket = this.perKeySubs.get(key.symbol);
|
|
1160
|
+
if (bucket) {
|
|
1161
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1162
|
+
try {
|
|
1163
|
+
for(var _iterator = bucket.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1164
|
+
var handler = _step.value;
|
|
1165
|
+
handler(value, key);
|
|
1166
|
+
}
|
|
1167
|
+
} catch (err) {
|
|
1168
|
+
_didIteratorError = true;
|
|
1169
|
+
_iteratorError = err;
|
|
1170
|
+
} finally{
|
|
1171
|
+
try {
|
|
1172
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1173
|
+
_iterator.return();
|
|
1174
|
+
}
|
|
1175
|
+
} finally{
|
|
1176
|
+
if (_didIteratorError) {
|
|
1177
|
+
throw _iteratorError;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
1183
|
+
try {
|
|
1184
|
+
for(var _iterator1 = this.globalSubs.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
1185
|
+
var handler1 = _step1.value;
|
|
1186
|
+
handler1(value, key);
|
|
1187
|
+
}
|
|
1188
|
+
} catch (err) {
|
|
1189
|
+
_didIteratorError1 = true;
|
|
1190
|
+
_iteratorError1 = err;
|
|
1191
|
+
} finally{
|
|
1192
|
+
try {
|
|
1193
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
1194
|
+
_iterator1.return();
|
|
1195
|
+
}
|
|
1196
|
+
} finally{
|
|
1197
|
+
if (_didIteratorError1) {
|
|
1198
|
+
throw _iteratorError1;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
key: "rotateStore",
|
|
1206
|
+
value: function rotateStore() {
|
|
1207
|
+
this.store = new ContextStore();
|
|
1208
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1209
|
+
try {
|
|
1210
|
+
for(var _iterator = this.transforms.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1211
|
+
var _step_value = _step.value, key = _step_value.key, transform = _step_value.transform;
|
|
1212
|
+
this.store.registerTransform(key, transform);
|
|
1213
|
+
}
|
|
1214
|
+
} catch (err) {
|
|
1215
|
+
_didIteratorError = true;
|
|
1216
|
+
_iteratorError = err;
|
|
1217
|
+
} finally{
|
|
1218
|
+
try {
|
|
1219
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1220
|
+
_iterator.return();
|
|
1221
|
+
}
|
|
1222
|
+
} finally{
|
|
1223
|
+
if (_didIteratorError) {
|
|
1224
|
+
throw _iteratorError;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
key: "nextToken",
|
|
1232
|
+
value: function nextToken() {
|
|
1233
|
+
subscriptionCounter += 1;
|
|
1234
|
+
return "ctx_".concat(subscriptionCounter);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
]);
|
|
1238
|
+
return _ContextPlugin;
|
|
1239
|
+
}();
|
|
1240
|
+
_ContextPlugin.Symbol = ContextPluginSymbol;
|
|
1241
|
+
var ContextPlugin = _ContextPlugin;
|
|
1242
|
+
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/context/core/src/state-plugin.ts
|
|
1243
|
+
var flowIdContextKey = defineContextKey("player.flow.id", "Identifier of the running flow");
|
|
1244
|
+
var flowStateContextKey = defineContextKey("player.flow.state", "Name of the current FSM state in the running flow");
|
|
1245
|
+
var viewIdContextKey = defineContextKey("player.view.id", "Identifier of the currently-resolved view");
|
|
1246
|
+
var viewContextKey = defineContextKey("player.view", "Full resolved view object for the current FSM state");
|
|
1247
|
+
var dataContextKey = defineContextKey("player.data", "Full data model tree for the running flow");
|
|
1248
|
+
var playerStatusContextKey = defineContextKey("player.status", "Player flow status: not-started, in-progress, completed, or error");
|
|
1249
|
+
var validationContextKey = defineContextKey("player.validation", "Validation state for the running view, keyed by binding");
|
|
1250
|
+
var setDataActionKey = defineContextKey("player.data.set", "Set a value in the Player data model at the given binding");
|
|
1251
|
+
var transitionActionKey = defineContextKey("player.flow.transition", "Transition the current flow using the given transition value");
|
|
1252
|
+
var playerStateContextKey = defineContextKey("player.state", "Aggregated snapshot of every Player runtime context entry");
|
|
1253
|
+
var StateContextPlugin = /*#__PURE__*/ function() {
|
|
1254
|
+
function StateContextPlugin() {
|
|
1255
|
+
_class_call_check(this, StateContextPlugin);
|
|
1256
|
+
this.name = "state-context";
|
|
1257
|
+
}
|
|
1258
|
+
_create_class(StateContextPlugin, [
|
|
1259
|
+
{
|
|
1260
|
+
key: "apply",
|
|
1261
|
+
value: function apply(player) {
|
|
1262
|
+
var _this = this;
|
|
1263
|
+
var ctx = getContextPlugin(player);
|
|
1264
|
+
var validationController;
|
|
1265
|
+
var publishValidation = function publishValidation() {
|
|
1266
|
+
if (!validationController) return;
|
|
1267
|
+
var byBinding = {};
|
|
1268
|
+
var canTransition = true;
|
|
1269
|
+
validationController.getBindings().forEach(function(binding) {
|
|
1270
|
+
var _ref;
|
|
1271
|
+
var _validationController_getValidationForBinding;
|
|
1272
|
+
var all = (_ref = (_validationController_getValidationForBinding = validationController.getValidationForBinding(binding)) === null || _validationController_getValidationForBinding === void 0 ? void 0 : _validationController_getValidationForBinding.getAll()) !== null && _ref !== void 0 ? _ref : [];
|
|
1273
|
+
if (all.length === 0) return;
|
|
1274
|
+
byBinding[binding.asString()] = all.map(function(v) {
|
|
1275
|
+
return {
|
|
1276
|
+
severity: v.severity,
|
|
1277
|
+
message: v.message,
|
|
1278
|
+
displayTarget: v.displayTarget,
|
|
1279
|
+
blocking: v.blocking
|
|
1280
|
+
};
|
|
1281
|
+
});
|
|
1282
|
+
if (all.some(function(v) {
|
|
1283
|
+
return v.blocking;
|
|
1284
|
+
})) {
|
|
1285
|
+
canTransition = false;
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
ctx.set(validationContextKey, {
|
|
1289
|
+
canTransition: canTransition,
|
|
1290
|
+
byBinding: byBinding
|
|
1291
|
+
});
|
|
1292
|
+
};
|
|
1293
|
+
ctx.register(flowIdContextKey);
|
|
1294
|
+
ctx.register(flowStateContextKey);
|
|
1295
|
+
ctx.register(viewIdContextKey);
|
|
1296
|
+
ctx.register(viewContextKey);
|
|
1297
|
+
ctx.register(dataContextKey);
|
|
1298
|
+
ctx.register(playerStatusContextKey);
|
|
1299
|
+
ctx.register(validationContextKey);
|
|
1300
|
+
ctx.register(setDataActionKey);
|
|
1301
|
+
ctx.register(transitionActionKey);
|
|
1302
|
+
ctx.registerTransform(playerStateContextKey, {
|
|
1303
|
+
sources: [
|
|
1304
|
+
flowIdContextKey,
|
|
1305
|
+
flowStateContextKey,
|
|
1306
|
+
viewIdContextKey,
|
|
1307
|
+
viewContextKey,
|
|
1308
|
+
dataContextKey,
|
|
1309
|
+
playerStatusContextKey,
|
|
1310
|
+
validationContextKey,
|
|
1311
|
+
setDataActionKey,
|
|
1312
|
+
transitionActionKey
|
|
1313
|
+
],
|
|
1314
|
+
compute: function compute(read) {
|
|
1315
|
+
var _read;
|
|
1316
|
+
return {
|
|
1317
|
+
status: read(playerStatusContextKey),
|
|
1318
|
+
flow: {
|
|
1319
|
+
id: read(flowIdContextKey),
|
|
1320
|
+
state: read(flowStateContextKey),
|
|
1321
|
+
transition: read(transitionActionKey)
|
|
1322
|
+
},
|
|
1323
|
+
view: {
|
|
1324
|
+
id: read(viewIdContextKey),
|
|
1325
|
+
resolved: read(viewContextKey)
|
|
1326
|
+
},
|
|
1327
|
+
data: {
|
|
1328
|
+
model: read(dataContextKey),
|
|
1329
|
+
set: read(setDataActionKey)
|
|
1330
|
+
},
|
|
1331
|
+
validation: (_read = read(validationContextKey)) !== null && _read !== void 0 ? _read : {
|
|
1332
|
+
canTransition: true,
|
|
1333
|
+
byBinding: {}
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
player.hooks.onStart.tap(this.name, function(flow) {
|
|
1339
|
+
if (flow === null || flow === void 0 ? void 0 : flow.id) {
|
|
1340
|
+
ctx.set(flowIdContextKey, flow.id);
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
player.hooks.state.tap(this.name, function(state) {
|
|
1344
|
+
ctx.set(playerStatusContextKey, state.status);
|
|
1345
|
+
});
|
|
1346
|
+
player.hooks.flowController.tap(this.name, function(flowController) {
|
|
1347
|
+
var transition = function transition(value) {
|
|
1348
|
+
return flowController.transition(value);
|
|
1349
|
+
};
|
|
1350
|
+
ctx.set(transitionActionKey, transition);
|
|
1351
|
+
flowController.hooks.flow.tap(_this.name, function(flowInstance) {
|
|
1352
|
+
var recordState = function recordState() {
|
|
1353
|
+
var _flowInstance_currentState;
|
|
1354
|
+
var name = (_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.name;
|
|
1355
|
+
if (name) {
|
|
1356
|
+
ctx.set(flowStateContextKey, name);
|
|
1357
|
+
}
|
|
1358
|
+
};
|
|
1359
|
+
recordState();
|
|
1360
|
+
flowInstance.hooks.afterTransition.tap(_this.name, recordState);
|
|
1361
|
+
});
|
|
1362
|
+
});
|
|
1363
|
+
player.hooks.validationController.tap(this.name, function(vc) {
|
|
1364
|
+
validationController = vc;
|
|
1365
|
+
publishValidation();
|
|
1366
|
+
});
|
|
1367
|
+
player.hooks.viewController.tap(this.name, function(viewController) {
|
|
1368
|
+
viewController.hooks.view.tap(_this.name, function(view) {
|
|
1369
|
+
var _view_initialView;
|
|
1370
|
+
var id = (_view_initialView = view.initialView) === null || _view_initialView === void 0 ? void 0 : _view_initialView.id;
|
|
1371
|
+
if (id) {
|
|
1372
|
+
ctx.set(viewIdContextKey, id);
|
|
1373
|
+
}
|
|
1374
|
+
view.hooks.onUpdate.tap(_this.name, function(resolved) {
|
|
1375
|
+
ctx.set(viewContextKey, resolved);
|
|
1376
|
+
if (resolved === null || resolved === void 0 ? void 0 : resolved.id) {
|
|
1377
|
+
ctx.set(viewIdContextKey, resolved.id);
|
|
1378
|
+
}
|
|
1379
|
+
publishValidation();
|
|
1380
|
+
});
|
|
1381
|
+
});
|
|
1382
|
+
});
|
|
1383
|
+
player.hooks.dataController.tap(this.name, function(dataController) {
|
|
1384
|
+
var setData = function setData(binding, value) {
|
|
1385
|
+
dataController.set([
|
|
1386
|
+
[
|
|
1387
|
+
binding,
|
|
1388
|
+
value
|
|
1389
|
+
]
|
|
1390
|
+
]);
|
|
1391
|
+
};
|
|
1392
|
+
ctx.set(setDataActionKey, setData);
|
|
1393
|
+
var publish = function publish() {
|
|
1394
|
+
ctx.set(dataContextKey, dataController.serialize());
|
|
1395
|
+
publishValidation();
|
|
1396
|
+
};
|
|
1397
|
+
dataController.hooks.onUpdate.tap(_this.name, publish);
|
|
1398
|
+
publish();
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
]);
|
|
1403
|
+
return StateContextPlugin;
|
|
1404
|
+
}();
|
|
1405
|
+
return __toCommonJS(src_exports);
|
|
1406
|
+
}();
|
|
1407
|
+
//# sourceMappingURL=index.global.js.map
|