@jxsuite/import 0.35.1 → 0.37.0

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/package.json +4 -4
  2. package/src/to-jx.ts +3 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/import",
3
- "version": "0.35.1",
3
+ "version": "0.37.0",
4
4
  "description": "Clone a live website into a Jx project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,8 +31,8 @@
31
31
  "import": "bun run src/cli.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@jxsuite/parser": "^0.35.1",
35
- "@jxsuite/schema": "^0.35.0",
34
+ "@jxsuite/markup": "^0.3.0",
35
+ "@jxsuite/schema": "^1.1.0",
36
36
  "pixelmatch": "^7.2.0",
37
37
  "pngjs": "^7.0.0",
38
38
  "puppeteer-core": "^24.9.0"
@@ -42,6 +42,6 @@
42
42
  "happy-dom": "^20.10.6"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@jxsuite/compiler": "^0.35.0"
45
+ "@jxsuite/compiler": "^1.1.0"
46
46
  }
47
47
  }
package/src/to-jx.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { htmlToJx } from "@jxsuite/parser/html-to-jx";
1
+ import { htmlToJx } from "@jxsuite/markup/html-to-jx";
2
2
  import type { JxElement } from "@jxsuite/schema/types";
3
3
 
4
4
  export interface ToJxResult {
@@ -40,18 +40,12 @@ function stripTags(nodes: (JxElement | string)[]): {
40
40
 
41
41
  const tag = String(node.tagName ?? "").toLowerCase();
42
42
 
43
- // Collect inline <style> content for Phase 1
43
+ // Collect inline <style> content for Phase 1. Style elements hold raw text, which htmlToJx
44
+ // Always collapses into textContent (never string children).
44
45
  if (tag === "style") {
45
46
  if (typeof node.textContent === "string") {
46
47
  styles.push(node.textContent);
47
48
  }
48
- if (Array.isArray(node.children)) {
49
- for (const c of node.children) {
50
- if (typeof c === "string") {
51
- styles.push(c);
52
- }
53
- }
54
- }
55
49
  continue;
56
50
  }
57
51