@player-ui/check-path-plugin 0.13.0-next.0 → 0.13.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.
@@ -5095,20 +5095,15 @@ var CheckPathPlugin = function() {
5095
5095
  }();
5096
5096
  var ViewInstance = /*#__PURE__*/ function() {
5097
5097
  function ViewInstance(initialView, resolverOptions) {
5098
- var _this = this;
5099
5098
  _class_call_check(this, ViewInstance);
5100
5099
  this.hooks = {
5101
5100
  onUpdate: new SyncHook(),
5102
5101
  parser: new SyncHook(),
5103
5102
  resolver: new SyncHook(),
5104
- onTemplatePluginCreated: new SyncHook(),
5105
5103
  templatePlugin: new SyncHook()
5106
5104
  };
5107
5105
  this.initialView = initialView;
5108
5106
  this.resolverOptions = resolverOptions;
5109
- this.hooks.onTemplatePluginCreated.tap("view", function(templatePlugin) {
5110
- _this.templatePlugin = templatePlugin;
5111
- });
5112
5107
  }
5113
5108
  _create_class(ViewInstance, [
5114
5109
  {
@@ -5155,6 +5150,12 @@ var CheckPathPlugin = function() {
5155
5150
  var _this_validationProvider;
5156
5151
  return (_this_validationProvider = this.validationProvider) === null || _this_validationProvider === void 0 ? void 0 : _this_validationProvider.getValidationsForBinding(binding);
5157
5152
  }
5153
+ },
5154
+ {
5155
+ key: "setTemplatePlugin",
5156
+ value: function setTemplatePlugin(plugin) {
5157
+ this.templatePlugin = plugin;
5158
+ }
5158
5159
  }
5159
5160
  ]);
5160
5161
  return ViewInstance;
@@ -5326,6 +5327,7 @@ var CheckPathPlugin = function() {
5326
5327
  value: function apply(view) {
5327
5328
  view.hooks.parser.tap("template", this.applyParser.bind(this));
5328
5329
  view.hooks.resolver.tap("template", this.applyResolverHooks.bind(this));
5330
+ view.setTemplatePlugin(this);
5329
5331
  }
5330
5332
  }
5331
5333
  ]);
@@ -6934,8 +6936,7 @@ var CheckPathPlugin = function() {
6934
6936
  var _this1 = this;
6935
6937
  _class_call_check(this, ViewController);
6936
6938
  this.hooks = {
6937
- /** Do any processing before the `View` instance is created */ resolveView: new SyncWaterfallHook(),
6938
- // The hook right before the View starts resolving. Attach anything custom here
6939
+ resolveView: new SyncWaterfallHook(),
6939
6940
  view: new SyncHook()
6940
6941
  };
6941
6942
  this.transformRegistry = new Registry();
@@ -6983,6 +6984,7 @@ var CheckPathPlugin = function() {
6983
6984
  ]));
6984
6985
  }
6985
6986
  });
6987
+ this.viewPlugins = this.createViewPlugins();
6986
6988
  }
6987
6989
  _create_class(ViewController, [
6988
6990
  {
@@ -7038,9 +7040,50 @@ var CheckPathPlugin = function() {
7038
7040
  }
7039
7041
  var view = new ViewInstance(source, this.viewOptions);
7040
7042
  this.currentView = view;
7043
+ this.applyViewPlugins(view);
7041
7044
  this.hooks.view.call(view);
7042
7045
  view.update();
7043
7046
  }
7047
+ },
7048
+ {
7049
+ key: "applyViewPlugins",
7050
+ value: function applyViewPlugins(view) {
7051
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
7052
+ try {
7053
+ for(var _iterator = this.viewPlugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
7054
+ var plugin = _step.value;
7055
+ plugin.apply(view);
7056
+ }
7057
+ } catch (err) {
7058
+ _didIteratorError = true;
7059
+ _iteratorError = err;
7060
+ } finally{
7061
+ try {
7062
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
7063
+ _iterator.return();
7064
+ }
7065
+ } finally{
7066
+ if (_didIteratorError) {
7067
+ throw _iteratorError;
7068
+ }
7069
+ }
7070
+ }
7071
+ }
7072
+ },
7073
+ {
7074
+ key: "createViewPlugins",
7075
+ value: function createViewPlugins() {
7076
+ var pluginOptions = toNodeResolveOptions(this.viewOptions);
7077
+ return [
7078
+ new AssetPlugin(),
7079
+ new SwitchPlugin(pluginOptions),
7080
+ new ApplicabilityPlugin(),
7081
+ new AssetTransformCorePlugin(this.transformRegistry),
7082
+ new StringResolverPlugin(),
7083
+ new TemplatePlugin(pluginOptions),
7084
+ new MultiNodePlugin()
7085
+ ];
7086
+ }
7044
7087
  }
7045
7088
  ]);
7046
7089
  return ViewController;
@@ -7413,35 +7456,6 @@ var CheckPathPlugin = function() {
7413
7456
  ref: Symbol("not-started"),
7414
7457
  status: "not-started"
7415
7458
  };
7416
- var DefaultViewPlugin = /*#__PURE__*/ function() {
7417
- function DefaultViewPlugin() {
7418
- _class_call_check(this, DefaultViewPlugin);
7419
- this.name = "default-view-plugin";
7420
- }
7421
- _create_class(DefaultViewPlugin, [
7422
- {
7423
- key: "apply",
7424
- value: function apply(player) {
7425
- var _this = this;
7426
- player.hooks.viewController.tap(this.name, function(viewController) {
7427
- viewController.hooks.view.tap(_this.name, function(view) {
7428
- var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7429
- new AssetPlugin().apply(view);
7430
- new SwitchPlugin(pluginOptions).apply(view);
7431
- new ApplicabilityPlugin().apply(view);
7432
- new AssetTransformCorePlugin(viewController.transformRegistry).apply(view);
7433
- new StringResolverPlugin().apply(view);
7434
- var templatePlugin = new TemplatePlugin(pluginOptions);
7435
- templatePlugin.apply(view);
7436
- view.hooks.onTemplatePluginCreated.call(templatePlugin);
7437
- new MultiNodePlugin().apply(view);
7438
- });
7439
- });
7440
- }
7441
- }
7442
- ]);
7443
- return DefaultViewPlugin;
7444
- }();
7445
7459
  var PLAYER_VERSION = "__VERSION__";
7446
7460
  var COMMIT = "__GIT_COMMIT__";
7447
7461
  var _Player = /*#__PURE__*/ function() {
@@ -7471,8 +7485,7 @@ var CheckPathPlugin = function() {
7471
7485
  }
7472
7486
  this.config = config || {};
7473
7487
  this.config.plugins = [
7474
- new DefaultExpPlugin(),
7475
- new DefaultViewPlugin()
7488
+ new DefaultExpPlugin()
7476
7489
  ].concat(_to_consumable_array(this.config.plugins || []), [
7477
7490
  new FlowExpPlugin()
7478
7491
  ]);
@@ -7785,11 +7798,9 @@ var CheckPathPlugin = function() {
7785
7798
  }),
7786
7799
  constants: this.constantsController
7787
7800
  });
7788
- this.hooks.viewController.tap("player", function(vc) {
7789
- vc.hooks.view.tap("player", function(view) {
7790
- validationController.onView(view);
7791
- _this.hooks.view.call(view);
7792
- });
7801
+ viewController.hooks.view.tap("player", function(view) {
7802
+ validationController.onView(view);
7803
+ _this.hooks.view.call(view);
7793
7804
  });
7794
7805
  this.hooks.viewController.call(viewController);
7795
7806
  return {