pome-ui 2.0.0-preview66 → 2.0.0-preview68

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,21 +1,21 @@
1
- {
2
- "name": "pome-ui",
3
- "version": "2.0.0-preview66",
4
- "description": "Front-end MVC library",
5
- "main": "pome-ui.js",
6
- "bin": {
7
- "pomelo-vue": "bin/pome-ui.js"
8
- },
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://git.net/pomesoft/pome-ui.git"
15
- },
16
- "author": "Yuko Zheng",
17
- "license": "GPL v3",
18
- "bugs": {
19
- },
20
- "homepage": "https://git.net/pomesoft/pome-ui"
21
- }
1
+ {
2
+ "name": "pome-ui",
3
+ "version": "2.0.0-preview68",
4
+ "description": "Front-end MVC library",
5
+ "main": "pome-ui.js",
6
+ "bin": {
7
+ "pomelo-vue": "bin/pome-ui.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://git.net/pomesoft/pome-ui.git"
15
+ },
16
+ "author": "Yuko Zheng",
17
+ "license": "GPL v3",
18
+ "bugs": {
19
+ },
20
+ "homepage": "https://git.net/pomesoft/pome-ui"
21
+ }
package/pome-ui.dev.js CHANGED
@@ -19235,6 +19235,22 @@ function build(options, exports) {
19235
19235
  } else {
19236
19236
  var msg = 'Mount component to ' + self.selector + ' failed: container element not found in DOM after retries. URL: ' + url;
19237
19237
  console.error('[PomeUI]', msg);
19238
+ try {
19239
+ var _pomelos = Array.prototype.map.call(document.querySelectorAll('[id^="pomelo-"]'), function (e) { return '#' + e.id; });
19240
+ var _containers = Array.prototype.map.call(document.querySelectorAll('[id^="container-"]'), function (e) { return '#' + e.id; });
19241
+ var _bodyHtml = document.body ? document.body.innerHTML : '(no body)';
19242
+ console.error('[PomeUI] Container-not-found diagnostics:', {
19243
+ wantedSelector: self.selector,
19244
+ url: url,
19245
+ pomeloRoots: _pomelos,
19246
+ containerDivs: _containers,
19247
+ bodyInnerLength: _bodyHtml.length,
19248
+ bodyInnerHead: _bodyHtml.substring(0, 600),
19249
+ rootProxyExists: !!exports.root()
19250
+ });
19251
+ } catch (diagErr) {
19252
+ console.error('[PomeUI] diagnostics failed:', diagErr);
19253
+ }
19238
19254
  return rej(new Error(msg));
19239
19255
  }
19240
19256
  }
@@ -20180,6 +20196,10 @@ function build(options, exports) {
20180
20196
  var appId = 'pomelo-' + ticks;
20181
20197
  var containerId = 'container-' + ticks;
20182
20198
  var bodyHtml = document.querySelector('body').innerHTML;
20199
+ // Strip HTML comments first: a literal <render-body> mentioned inside a
20200
+ // comment (e.g. an explanatory note in the layout) must not be mistaken
20201
+ // for the real mount point. Comments are inert in the compiled template.
20202
+ bodyHtml = bodyHtml.replace(/<!--[\s\S]*?-->/g, '');
20183
20203
  var renderBodyRegex = /<render-body\s*(?:\/\s*)?>(?:<\/render-body\s*>)?/i;
20184
20204
  var body;
20185
20205
  if (renderBodyRegex.test(bodyHtml)) {
@@ -20224,8 +20244,23 @@ function build(options, exports) {
20224
20244
  document.querySelector('body').innerHTML = '<div id="' + appId + '" class="_pome-vue-cloak">' + body + '</div>';
20225
20245
  if (!document.getElementById(containerId)) {
20226
20246
  console.error('[PomeUI] Container element #' + containerId + ' not found in DOM immediately after setting body innerHTML. The <render-body> replacement likely failed.');
20247
+ try {
20248
+ var _idxInBody = body.indexOf('id="' + containerId + '"');
20249
+ var _cp = document.querySelector('.center-pane');
20250
+ console.error('[PomeUI] render-body-replace diagnostics:', {
20251
+ containerInBodyString: _idxInBody,
20252
+ bodyStringLength: body.length,
20253
+ bodyAroundContainer: _idxInBody >= 0 ? body.substring(Math.max(0, _idxInBody - 300), _idxInBody + 120) : '(container id not in body string)',
20254
+ centerPaneExists: !!_cp,
20255
+ centerPaneInnerHtml: _cp ? _cp.innerHTML.substring(0, 200) : '(no .center-pane in parsed DOM)',
20256
+ centerPaneOuterStart: _cp ? _cp.outerHTML.substring(0, 120) : '(n/a)',
20257
+ parsedBodyLength: document.body.innerHTML.length
20258
+ });
20259
+ } catch (rbErr) {
20260
+ console.error('[PomeUI] render-body-replace diagnostics failed:', rbErr);
20261
+ }
20227
20262
  }
20228
- options.template = null;
20263
+ options.template = body;
20229
20264
  if (!options.mounted) {
20230
20265
  options.mounted = function () { };
20231
20266
  }