@player-ui/beacon-plugin 1.0.1 → 1.1.0--canary.866.38489

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.
@@ -7912,8 +7912,8 @@ var BeaconPlugin = function() {
7912
7912
  ref: Symbol("not-started"),
7913
7913
  status: "not-started"
7914
7914
  };
7915
- var PLAYER_VERSION = true ? "1.0.1" : "unknown";
7916
- var COMMIT = true ? "b2d81e4bf7bb035fa6edbe65d21641d79631c53d" : "unknown";
7915
+ var PLAYER_VERSION = true ? "1.1.0--canary.866.38489" : "unknown";
7916
+ var COMMIT = true ? "3da792fb855f66e3747d2b873d0292ae811523a1" : "unknown";
7917
7917
  var _Player = /*#__PURE__*/ function() {
7918
7918
  function _Player2(config) {
7919
7919
  var _this = this;
@@ -7935,7 +7935,8 @@ var BeaconPlugin = function() {
7935
7935
  state: new SyncHook(),
7936
7936
  onStart: new SyncHook(),
7937
7937
  onEnd: new SyncHook(),
7938
- resolveFlowContent: new SyncWaterfallHook()
7938
+ resolveFlowContent: new SyncWaterfallHook(),
7939
+ transformContent: new SyncWaterfallHook()
7939
7940
  };
7940
7941
  if (config === null || config === void 0 ? void 0 : config.logger) {
7941
7942
  this.logger.addHandler(config.logger);
@@ -8255,14 +8256,19 @@ var BeaconPlugin = function() {
8255
8256
  },
8256
8257
  {
8257
8258
  key: "start",
8258
- value: function start(payload) {
8259
+ value: function start(payload, options) {
8259
8260
  return _async_to_generator(function() {
8260
- var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
8261
+ var _this, _options_format, meta, flow, _flow_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
8261
8262
  return _ts_generator(this, function(_state) {
8262
8263
  switch(_state.label){
8263
8264
  case 0:
8264
8265
  _this = this;
8265
- ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
8266
+ meta = {
8267
+ format: (_options_format = options === null || options === void 0 ? void 0 : options.format) !== null && _options_format !== void 0 ? _options_format : "player",
8268
+ version: options === null || options === void 0 ? void 0 : options.version
8269
+ };
8270
+ flow = this.hooks.transformContent.call(payload, meta);
8271
+ ref = Symbol((_flow_id = flow === null || flow === void 0 ? void 0 : flow.id) !== null && _flow_id !== void 0 ? _flow_id : "payload");
8266
8272
  maybeUpdateState = function(newState) {
8267
8273
  if (_this.state.ref !== ref) {
8268
8274
  _this.logger.warn("Received update for a flow that's not the current one");
@@ -8283,7 +8289,7 @@ var BeaconPlugin = function() {
8283
8289
  ,
8284
8290
  4
8285
8291
  ]);
8286
- _this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
8292
+ _this_setupFlow = this.setupFlow(flow), state = _this_setupFlow.state, start = _this_setupFlow.start;
8287
8293
  this.setState(_object_spread({
8288
8294
  ref: ref
8289
8295
  }, state));
@@ -8318,7 +8324,7 @@ var BeaconPlugin = function() {
8318
8324
  errorState = {
8319
8325
  status: "error",
8320
8326
  ref: ref,
8321
- flow: payload,
8327
+ flow: flow,
8322
8328
  error: error
8323
8329
  };
8324
8330
  maybeUpdateState(errorState);