pome-ui 2.0.0-preview22 → 2.0.0-preview23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pome-ui",
3
- "version": "2.0.0-preview22",
3
+ "version": "2.0.0-preview23",
4
4
  "description": "Front-end MVC library",
5
5
  "main": "pome-ui.js",
6
6
  "bin": {
package/pome-ui.dev.js CHANGED
@@ -17333,6 +17333,7 @@ function build(options, exports) {
17333
17333
  layoutHtml = layoutHtml.substr(htmlBeginTagIndex2 + 1);
17334
17334
  var htmlEndTagIndex = layoutHtml.lastIndexOf('</html>');
17335
17335
  layoutHtml = layoutHtml.substr(0, htmlEndTagIndex);
17336
+ layoutHtml = _patchTemplate(layout, layoutHtml);
17336
17337
  document.querySelector('html').innerHTML = layoutHtml;
17337
17338
 
17338
17339
  var ticks = new Date().getTime();
@@ -17736,7 +17737,7 @@ function build(options, exports) {
17736
17737
  _patchComponent(viewName, _opt);
17737
17738
  return _resolveModules(_opt.modules, viewName).then(function () {
17738
17739
  PageNext(_opt);
17739
- return Promise.resolve();P
17740
+ return Promise.resolve();
17740
17741
  });
17741
17742
  });
17742
17743
  }
@@ -18244,6 +18245,36 @@ function build(options, exports) {
18244
18245
  };
18245
18246
  }
18246
18247
 
18248
+ function _patchTemplate(view, html) {
18249
+ for (let i = 0; i < exports._addins.length; ++i) {
18250
+ let v = exports._addins[i].view;
18251
+ let addin = exports._addins[i].opt;
18252
+ if (v != '*' && view != v) {
18253
+ continue;
18254
+ }
18255
+
18256
+ if (addin.template) {
18257
+ if (addin.template instanceof Function) {
18258
+ if (html.indexOf('<html') >= 0) {
18259
+ var template = new DOMParser().parseFromString(html, 'text/html');
18260
+ addin.template(template);
18261
+ html = new XMLSerializer().serializeToString(template);
18262
+ } else {
18263
+ html = `<pome-ui-template>${html}</pome-ui-template>`
18264
+ var template = new DOMParser().parseFromString(html, 'text/html');
18265
+ addin.template(template);
18266
+ html = new XMLSerializer().serializeToString(template);
18267
+ html = html.substr(html.indexOf('<pome-ui-template>') + '<pome-ui-template>'.length);
18268
+ html = html.substr(0, html.indexOf('</pome-ui-template>'));
18269
+ }
18270
+ } else {
18271
+ html = addin.template;
18272
+ }
18273
+ }
18274
+ }
18275
+ return html;
18276
+ }
18277
+
18247
18278
  function UseAddin(addinUrl) {
18248
18279
  var Addin = function (view, opt) {
18249
18280
  exports._addins.push({view, opt});