@player-ui/async-node-plugin 1.1.0--canary.866.38904 → 1.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8062,8 +8062,8 @@ var AsyncNodePlugin = function() {
|
|
|
8062
8062
|
ref: Symbol("not-started"),
|
|
8063
8063
|
status: "not-started"
|
|
8064
8064
|
};
|
|
8065
|
-
var PLAYER_VERSION = true ? "1.1.0
|
|
8066
|
-
var COMMIT = true ? "
|
|
8065
|
+
var PLAYER_VERSION = true ? "1.1.0-next.1" : "unknown";
|
|
8066
|
+
var COMMIT = true ? "8d1e44b77769e923785e6218de2d9f99342b9b1a" : "unknown";
|
|
8067
8067
|
var _Player = /*#__PURE__*/ function() {
|
|
8068
8068
|
function _Player2(config) {
|
|
8069
8069
|
var _this = this;
|
|
@@ -8085,8 +8085,7 @@ var AsyncNodePlugin = function() {
|
|
|
8085
8085
|
state: new SyncHook(),
|
|
8086
8086
|
onStart: new SyncHook(),
|
|
8087
8087
|
onEnd: new SyncHook(),
|
|
8088
|
-
resolveFlowContent: new SyncWaterfallHook()
|
|
8089
|
-
transformContent: new SyncBailHook()
|
|
8088
|
+
resolveFlowContent: new SyncWaterfallHook()
|
|
8090
8089
|
};
|
|
8091
8090
|
if (config === null || config === void 0 ? void 0 : config.logger) {
|
|
8092
8091
|
this.logger.addHandler(config.logger);
|
|
@@ -8100,9 +8099,6 @@ var AsyncNodePlugin = function() {
|
|
|
8100
8099
|
(_this_config_plugins = this.config.plugins) === null || _this_config_plugins === void 0 ? void 0 : _this_config_plugins.forEach(function(plugin) {
|
|
8101
8100
|
plugin.apply(_this);
|
|
8102
8101
|
});
|
|
8103
|
-
this.hooks.transformContent.tap("player", function(payload, meta) {
|
|
8104
|
-
return meta.format === "player" ? payload : void 0;
|
|
8105
|
-
});
|
|
8106
8102
|
}
|
|
8107
8103
|
_create_class(_Player2, [
|
|
8108
8104
|
{
|
|
@@ -8409,22 +8405,14 @@ var AsyncNodePlugin = function() {
|
|
|
8409
8405
|
},
|
|
8410
8406
|
{
|
|
8411
8407
|
key: "start",
|
|
8412
|
-
value: function start(payload
|
|
8408
|
+
value: function start(payload) {
|
|
8413
8409
|
return _async_to_generator(function() {
|
|
8414
|
-
var _this,
|
|
8410
|
+
var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
8415
8411
|
return _ts_generator(this, function(_state) {
|
|
8416
8412
|
switch(_state.label){
|
|
8417
8413
|
case 0:
|
|
8418
8414
|
_this = this;
|
|
8419
|
-
|
|
8420
|
-
format: (_options_format = options === null || options === void 0 ? void 0 : options.format) !== null && _options_format !== void 0 ? _options_format : "player",
|
|
8421
|
-
version: options === null || options === void 0 ? void 0 : options.version
|
|
8422
|
-
};
|
|
8423
|
-
flow = this.hooks.transformContent.call(payload, meta);
|
|
8424
|
-
if (!flow) {
|
|
8425
|
-
throw new Error('Player.start received content with format "'.concat(meta.format, '" that no plugin transformed into a Flow.'));
|
|
8426
|
-
}
|
|
8427
|
-
ref = Symbol((_flow_id = flow.id) !== null && _flow_id !== void 0 ? _flow_id : "payload");
|
|
8415
|
+
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
8428
8416
|
maybeUpdateState = function(newState) {
|
|
8429
8417
|
if (_this.state.ref !== ref) {
|
|
8430
8418
|
_this.logger.warn("Received update for a flow that's not the current one");
|
|
@@ -8445,7 +8433,7 @@ var AsyncNodePlugin = function() {
|
|
|
8445
8433
|
,
|
|
8446
8434
|
4
|
|
8447
8435
|
]);
|
|
8448
|
-
_this_setupFlow = this.setupFlow(
|
|
8436
|
+
_this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
8449
8437
|
this.setState(_object_spread({
|
|
8450
8438
|
ref: ref
|
|
8451
8439
|
}, state));
|
|
@@ -8480,7 +8468,7 @@ var AsyncNodePlugin = function() {
|
|
|
8480
8468
|
errorState = {
|
|
8481
8469
|
status: "error",
|
|
8482
8470
|
ref: ref,
|
|
8483
|
-
flow:
|
|
8471
|
+
flow: payload,
|
|
8484
8472
|
error: error
|
|
8485
8473
|
};
|
|
8486
8474
|
maybeUpdateState(errorState);
|