@jay-framework/compiler-jay-html 0.19.5 → 0.19.6

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -4
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -18766,12 +18766,20 @@ function parseHeadLinks(root, excludeCssLinks = false) {
18766
18766
  };
18767
18767
  });
18768
18768
  }
18769
+ function toParts(value) {
18770
+ try {
18771
+ return parseTemplateParts(value);
18772
+ } catch {
18773
+ return [{ kind: "static", value }];
18774
+ }
18775
+ }
18769
18776
  function parseHeadMeta(root) {
18770
18777
  const head = root.querySelector("head");
18771
18778
  if (!head)
18772
18779
  return void 0;
18773
18780
  const titleEl = head.querySelector("title");
18774
- const title = titleEl?.textContent?.trim() || void 0;
18781
+ const titleText = titleEl?.textContent?.trim();
18782
+ const title = titleText ? toParts(titleText) : void 0;
18775
18783
  const meta = [];
18776
18784
  for (const el of head.querySelectorAll("meta")) {
18777
18785
  const content = el.getAttribute("content");
@@ -18780,7 +18788,11 @@ function parseHeadMeta(root) {
18780
18788
  const name = el.getAttribute("name");
18781
18789
  const property = el.getAttribute("property");
18782
18790
  if (name || property) {
18783
- meta.push({ name: name || void 0, property: property || void 0, content });
18791
+ meta.push({
18792
+ name: name || void 0,
18793
+ property: property || void 0,
18794
+ content: toParts(content)
18795
+ });
18784
18796
  }
18785
18797
  }
18786
18798
  const links = [];
@@ -18788,8 +18800,13 @@ function parseHeadMeta(root) {
18788
18800
  const rel = el.getAttribute("rel");
18789
18801
  if (!rel)
18790
18802
  continue;
18791
- const attrs = { ...el.attributes };
18792
- links.push(attrs);
18803
+ const hrefRaw = el.getAttribute("href") || "";
18804
+ const extraAttrs = {};
18805
+ for (const [k, v] of Object.entries(el.attributes)) {
18806
+ if (k !== "rel" && k !== "href")
18807
+ extraAttrs[k] = v;
18808
+ }
18809
+ links.push({ rel, href: toParts(hrefRaw), ...extraAttrs });
18793
18810
  }
18794
18811
  return { title, meta, links };
18795
18812
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/compiler-jay-html",
3
- "version": "0.19.5",
3
+ "version": "0.19.6",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -34,12 +34,12 @@
34
34
  },
35
35
  "author": "",
36
36
  "dependencies": {
37
- "@jay-framework/compiler-analyze-exported-types": "^0.19.5",
38
- "@jay-framework/compiler-shared": "^0.19.5",
39
- "@jay-framework/component": "^0.19.5",
40
- "@jay-framework/logger": "^0.19.5",
41
- "@jay-framework/runtime": "^0.19.5",
42
- "@jay-framework/secure": "^0.19.5",
37
+ "@jay-framework/compiler-analyze-exported-types": "^0.19.6",
38
+ "@jay-framework/compiler-shared": "^0.19.6",
39
+ "@jay-framework/component": "^0.19.6",
40
+ "@jay-framework/logger": "^0.19.6",
41
+ "@jay-framework/runtime": "^0.19.6",
42
+ "@jay-framework/secure": "^0.19.6",
43
43
  "@types/js-yaml": "^4.0.9",
44
44
  "change-case": "^4.1.2",
45
45
  "he": "^1.2.0",
@@ -52,8 +52,8 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@caiogondim/strip-margin": "^1.0.0",
55
- "@jay-framework/4-react": "^0.19.5",
56
- "@jay-framework/dev-environment": "^0.19.5",
55
+ "@jay-framework/4-react": "^0.19.6",
56
+ "@jay-framework/dev-environment": "^0.19.6",
57
57
  "@testing-library/jest-dom": "^6.2.0",
58
58
  "@types/js-beautify": "^1",
59
59
  "@types/node": "^20.11.5",