@player-ui/metrics-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.
@@ -7924,8 +7924,8 @@ var MetricsPlugin = function() {
7924
7924
  ref: Symbol("not-started"),
7925
7925
  status: "not-started"
7926
7926
  };
7927
- var PLAYER_VERSION = true ? "1.0.1" : "unknown";
7928
- var COMMIT = true ? "b2d81e4bf7bb035fa6edbe65d21641d79631c53d" : "unknown";
7927
+ var PLAYER_VERSION = true ? "1.1.0--canary.866.38489" : "unknown";
7928
+ var COMMIT = true ? "3da792fb855f66e3747d2b873d0292ae811523a1" : "unknown";
7929
7929
  var _Player = /*#__PURE__*/ function() {
7930
7930
  function _Player2(config) {
7931
7931
  var _this = this;
@@ -7947,7 +7947,8 @@ var MetricsPlugin = function() {
7947
7947
  state: new SyncHook(),
7948
7948
  onStart: new SyncHook(),
7949
7949
  onEnd: new SyncHook(),
7950
- resolveFlowContent: new SyncWaterfallHook()
7950
+ resolveFlowContent: new SyncWaterfallHook(),
7951
+ transformContent: new SyncWaterfallHook()
7951
7952
  };
7952
7953
  if (config === null || config === void 0 ? void 0 : config.logger) {
7953
7954
  this.logger.addHandler(config.logger);
@@ -8267,14 +8268,19 @@ var MetricsPlugin = function() {
8267
8268
  },
8268
8269
  {
8269
8270
  key: "start",
8270
- value: function start(payload) {
8271
+ value: function start(payload, options) {
8271
8272
  return _async_to_generator(function() {
8272
- var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
8273
+ var _this, _options_format, meta, flow, _flow_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
8273
8274
  return _ts_generator(this, function(_state) {
8274
8275
  switch(_state.label){
8275
8276
  case 0:
8276
8277
  _this = this;
8277
- ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
8278
+ meta = {
8279
+ format: (_options_format = options === null || options === void 0 ? void 0 : options.format) !== null && _options_format !== void 0 ? _options_format : "player",
8280
+ version: options === null || options === void 0 ? void 0 : options.version
8281
+ };
8282
+ flow = this.hooks.transformContent.call(payload, meta);
8283
+ ref = Symbol((_flow_id = flow === null || flow === void 0 ? void 0 : flow.id) !== null && _flow_id !== void 0 ? _flow_id : "payload");
8278
8284
  maybeUpdateState = function(newState) {
8279
8285
  if (_this.state.ref !== ref) {
8280
8286
  _this.logger.warn("Received update for a flow that's not the current one");
@@ -8295,7 +8301,7 @@ var MetricsPlugin = function() {
8295
8301
  ,
8296
8302
  4
8297
8303
  ]);
8298
- _this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
8304
+ _this_setupFlow = this.setupFlow(flow), state = _this_setupFlow.state, start = _this_setupFlow.start;
8299
8305
  this.setState(_object_spread({
8300
8306
  ref: ref
8301
8307
  }, state));
@@ -8330,7 +8336,7 @@ var MetricsPlugin = function() {
8330
8336
  errorState = {
8331
8337
  status: "error",
8332
8338
  ref: ref,
8333
- flow: payload,
8339
+ flow: flow,
8334
8340
  error: error
8335
8341
  };
8336
8342
  maybeUpdateState(errorState);