@ptengine/lp-editor-core 1.0.0-alpha.0 → 1.0.0-alpha.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.
Files changed (41) hide show
  1. package/README.md +14 -4
  2. package/dist/golden/fixtures/html/01-tailwind-landing.html +92 -0
  3. package/dist/golden/fixtures/html/02-table-foster-parenting.html +29 -0
  4. package/dist/golden/fixtures/html/03-p-block-nesting.html +20 -0
  5. package/dist/golden/fixtures/html/04-unclosed-misnested.html +29 -0
  6. package/dist/golden/fixtures/html/05-attr-quotes-entities-unicode.html +19 -0
  7. package/dist/golden/fixtures/html/06-comments-rawtext.html +46 -0
  8. package/dist/golden/fixtures/html/07-boolean-empty-attrs.html +46 -0
  9. package/dist/golden/fixtures/html/08-mega-class-list.html +11 -0
  10. package/dist/golden/fixtures/html/09-legacy-doctype.html +17 -0
  11. package/dist/golden/fixtures/html/10-foreign-template-pre.html +40 -0
  12. package/dist/golden/fixtures/html/11-adoption-agency-deep.html +28 -0
  13. package/dist/golden/fixtures/html/12-charrefs-control-chars.html +23 -0
  14. package/dist/golden/fixtures/html/13-namespaces-custom-dup-attrs.html +25 -0
  15. package/dist/golden/fixtures/popup/01-jp-coupon-line-tall.html +10 -0
  16. package/dist/golden/fixtures/popup/02-jp-webinar-doctor.html +17 -0
  17. package/dist/golden/fixtures/popup/03-jp-model-recruit.html +17 -0
  18. package/dist/golden/fixtures/popup/04-jp-shinpi-campaign.html +12 -0
  19. package/dist/golden/fixtures/popup/05-jp-jal-course.html +17 -0
  20. package/dist/golden/fixtures/popup/06-jp-training-two-cta.html +17 -0
  21. package/dist/golden/fixtures/popup/07-vivaia-lightweight-shoes.html +12 -0
  22. package/dist/golden/fixtures/popup/08-sticky-black-friday-countdown.html +8 -0
  23. package/dist/golden/fixtures/popup/09-sticky-line-coupon-countdown.html +6 -0
  24. package/dist/golden/fixtures/popup/10-sticky-coupon-code-countdown.html +9 -0
  25. package/dist/golden/fixtures/popup/11-sticky-anniversary-countdown.html +5 -0
  26. package/dist/golden/fixtures/popup/12-vivaia-product-grid.html +29 -0
  27. package/dist/golden/fixtures/popup/13-vivaia-restock-split.html +9 -0
  28. package/dist/golden/fixtures/popup/14-back-to-school-email-form.html +14 -0
  29. package/dist/golden/fixtures/popup/15-xtool-ebook-split-form.html +9 -0
  30. package/dist/golden/fixtures/popup/16-880-off-gradient-form.html +8 -0
  31. package/dist/golden/fixtures/popup/17-holiday-sale-price-swatch.html +18 -0
  32. package/dist/golden/fixtures/popup/18-solar-battery-dark-specs.html +14 -0
  33. package/dist/golden/fixtures/popup/19-jp-clinic-coupon-placeholder.html +8 -0
  34. package/dist/golden/fixtures/popup/README.md +31 -0
  35. package/dist/golden/manifest.json +84 -0
  36. package/dist/golden/ops-cases.json +179 -0
  37. package/dist/golden/verify.mjs +101 -0
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/index.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #7a5230; --color-ink: #3a2c1a; --color-surface: #f5ead7; }</style>
2
+ <div data-pt-id="root" class="flex w-full items-center justify-center gap-6 bg-surface px-6 py-3">
3
+ <div data-pt-id="c1" class="flex flex-col">
4
+ <p data-pt-type="text" data-pt-id="t1" class="text-base font-bold text-ink">2点以上お買い上げで10%OFF</p>
5
+ <p data-pt-type="text" data-pt-id="t2" class="text-2xs text-ink">5周年キャンペーン終了まで残り</p>
6
+ </div>
7
+ <div data-pt-id="k1" data-pt-component="countdown" data-pt-component-settings='{"style":"flip","units":["days","hours","minutes","seconds"],"endAt":"2026-09-30T23:59:59+09:00"}'></div>
8
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="copy_coupon" href="#" class="flex min-h-10 items-center gap-2 rounded bg-brand px-4 text-sm font-bold text-surface">クーポンコード: VIVAIA5TH</a>
9
+ </div>
@@ -0,0 +1,5 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #5c4326; --color-ink: #2f2413; --color-surface: #f7eede; }</style>
2
+ <div data-pt-id="root" class="flex w-full items-center justify-center gap-4 bg-surface px-6 py-2">
3
+ <p data-pt-type="text" data-pt-id="t1" class="text-sm font-bold text-ink">【まとめ買い2点で10%OFF】6周年特別オーファーが終了まであと</p>
4
+ <div data-pt-id="k1" data-pt-component="countdown" data-pt-component-settings='{"style":"flip","units":["days","hours","minutes","seconds"],"endAt":"2026-12-31T23:59:59+09:00"}'></div>
5
+ </div>
@@ -0,0 +1,29 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #6b4a2b; --color-ink: #2f2418; --color-surface: #ffffff; --color-line: #d8c3a5; }</style>
2
+ <div data-pt-id="root" class="w-full max-w-[420px] rounded bg-surface p-4">
3
+ <div data-pt-id="c1" class="flex flex-col gap-3">
4
+ <h2 data-pt-type="text" data-pt-id="t1" class="text-center text-lg font-bold text-brand">人気商品4品を厳選</h2>
5
+ <p data-pt-type="text" data-pt-id="t2" class="text-center text-base font-bold text-ink">類似オススメ商品はこちら</p>
6
+ <div data-pt-id="c2" data-pt-layout-mobile="scroll" class="grid grid-cols-2 gap-3">
7
+ <div data-pt-id="c3" class="flex flex-col items-center gap-1 rounded border border-line p-2">
8
+ <img data-pt-type="media" data-pt-id="m1" src="samantha.png" alt="Samantha" class="w-full aspect-square object-cover">
9
+ <p data-pt-type="text" data-pt-id="t3" class="text-xs text-ink">Samantha</p>
10
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="shop_1" href="#" class="text-xs font-bold text-ink underline">Shop Now</a>
11
+ </div>
12
+ <div data-pt-id="c4" class="flex flex-col items-center gap-1 rounded border border-line p-2">
13
+ <img data-pt-type="media" data-pt-id="m2" src="jackie.png" alt="Jackie" class="w-full aspect-square object-cover">
14
+ <p data-pt-type="text" data-pt-id="t4" class="text-xs text-ink">Jackie</p>
15
+ <a data-pt-type="button" data-pt-id="b2" data-pt-track="shop_2" href="#" class="text-xs font-bold text-ink underline">Shop Now</a>
16
+ </div>
17
+ <div data-pt-id="c5" class="flex flex-col items-center gap-1 rounded border border-line p-2">
18
+ <img data-pt-type="media" data-pt-id="m3" src="michelle.png" alt="Michelle" class="w-full aspect-square object-cover">
19
+ <p data-pt-type="text" data-pt-id="t5" class="text-xs text-ink">Michelle</p>
20
+ <a data-pt-type="button" data-pt-id="b3" data-pt-track="shop_3" href="#" class="text-xs font-bold text-ink underline">Shop Now</a>
21
+ </div>
22
+ <div data-pt-id="c6" class="flex flex-col items-center gap-1 rounded border border-line p-2">
23
+ <img data-pt-type="media" data-pt-id="m4" src="margot.png" alt="Margot Walker" class="w-full aspect-square object-cover">
24
+ <p data-pt-type="text" data-pt-id="t6" class="text-xs text-ink">Margot Walker</p>
25
+ <a data-pt-type="button" data-pt-id="b4" data-pt-track="shop_4" href="#" class="text-xs font-bold text-ink underline">Shop Now</a>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -0,0 +1,9 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #111111; --color-ink: #1a1a1a; --color-surface: #ffffff; }</style>
2
+ <div data-pt-id="root" class="flex w-full max-w-[640px] flex-col overflow-hidden rounded bg-surface md:flex-row">
3
+ <img data-pt-type="media" data-pt-id="m1" src="restock.png" alt="RESTOCK シューズ" class="w-full aspect-square object-cover md:w-1/2">
4
+ <div data-pt-id="c1" class="flex flex-1 flex-col items-center justify-center gap-4 p-6">
5
+ <h2 data-pt-type="text" data-pt-id="t1" class="text-4xl font-light tracking-widest text-ink">RESTOCK</h2>
6
+ <p data-pt-type="text" data-pt-id="t2" class="text-center text-sm text-ink">完売していた大人気の新作が<br>待望の再入荷</p>
7
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="view_product" href="#" class="flex min-h-12 w-full items-center justify-center rounded bg-brand text-base font-bold text-surface">商品を見る</a>
8
+ </div>
9
+ </div>
@@ -0,0 +1,14 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #1a56ff; --color-ink: #111111; --color-surface: #eef4ff; }</style>
2
+ <div data-pt-id="root" class="w-full max-w-[420px] rounded bg-surface p-6">
3
+ <div data-pt-id="c1" class="flex flex-col items-center gap-4">
4
+ <p data-pt-type="text" data-pt-id="t1" class="text-sm tracking-widest text-brand">UP TO</p>
5
+ <h2 data-pt-type="text" data-pt-id="t2" class="text-center text-4xl font-bold leading-tight text-brand">$1,000 OFF BACK-TO-SCHOOL COUPONS</h2>
6
+ <p data-pt-type="text" data-pt-id="t3" class="text-center text-sm text-ink">Leave your email to unlock up to $1,000 in sale discounts.</p>
7
+ <div data-pt-id="c2" class="flex items-center gap-2 rounded-full border border-ink px-4 py-2">
8
+ <p data-pt-type="text" data-pt-id="t4" class="text-sm text-ink">Offer closes in</p>
9
+ <div data-pt-id="k1" data-pt-component="countdown" data-pt-component-settings='{"style":"plain","units":["minutes","seconds"],"durationSeconds":115}'></div>
10
+ </div>
11
+ <div data-pt-id="k2" data-pt-component="form" data-pt-component-settings='{"fields":[{"name":"email","type":"email","placeholder":"Enter an email to subscribe","required":true}],"submitText":"Claim Now"}'></div>
12
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="dismiss" href="#" class="text-xs text-ink underline">I&#39;ll pass on the $1,000 off (for now).</a>
13
+ </div>
14
+ </div>
@@ -0,0 +1,9 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #000000; --color-ink: #111111; --color-surface: #ffffff; }</style>
2
+ <div data-pt-id="root" class="flex w-full max-w-[860px] flex-col overflow-hidden rounded bg-surface md:flex-row">
3
+ <img data-pt-type="media" data-pt-id="m1" src="xtool.png" alt="xTool" class="w-full aspect-[4/3] object-cover md:w-1/2">
4
+ <div data-pt-id="c1" class="flex flex-1 flex-col justify-center gap-4 p-8">
5
+ <h2 data-pt-type="text" data-pt-id="t1" class="text-2xl font-bold leading-snug text-ink">FREE E-Book: Small Business Handbook (88 pages)</h2>
6
+ <p data-pt-type="text" data-pt-id="t2" class="text-sm text-ink">Make money with your xTool and earn over $1,000 a week!</p>
7
+ <div data-pt-id="k1" data-pt-component="form" data-pt-component-settings='{"fields":[{"name":"email","type":"email","placeholder":"Enter an email to subscribe","required":true}],"submitText":"Download Now"}'></div>
8
+ </div>
9
+ </div>
@@ -0,0 +1,8 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #000000; --color-ink: #0b0b0b; --color-surface: #7ef0c0; }</style>
2
+ <div data-pt-id="root" class="w-full max-w-[420px] rounded-xl bg-surface p-6">
3
+ <div data-pt-id="c1" class="flex flex-col items-center gap-4 border-2 border-white p-6">
4
+ <p data-pt-type="text" data-pt-id="t1" class="text-center text-sm text-ink">Leave your email,<br>claim a coupon pack up to...</p>
5
+ <h2 data-pt-type="text" data-pt-id="t2" class="text-5xl font-black text-ink">$880 OFF!</h2>
6
+ <div data-pt-id="k1" data-pt-component="form" data-pt-component-settings='{"fields":[{"name":"email","type":"email","placeholder":"Enter Your Email to Subscribe","required":true}],"submitText":"Get My Coupons"}'></div>
7
+ </div>
8
+ </div>
@@ -0,0 +1,18 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #9b2418; --color-ink: #2b2b2b; --color-surface: #fdf6ec; }</style>
2
+ <div data-pt-id="root" class="flex w-full max-w-[640px] flex-col overflow-hidden bg-surface md:flex-row">
3
+ <div data-pt-id="c1" class="flex w-full flex-col items-center gap-3 p-6 md:w-1/2">
4
+ <img data-pt-type="media" data-pt-id="m1" src="heel.png" alt="Holiday Sale シューズ" class="w-full aspect-square object-contain">
5
+ <div data-pt-id="c2" data-pt-layout-mobile="scroll" class="flex gap-2">
6
+ <img data-pt-type="media" data-pt-id="m2" src="sw1.png" alt="ベージュ" class="w-8 aspect-square rounded-full object-cover">
7
+ <img data-pt-type="media" data-pt-id="m3" src="sw2.png" alt="ブラック" class="w-8 aspect-square rounded-full object-cover">
8
+ <img data-pt-type="media" data-pt-id="m4" src="sw3.png" alt="ネイビー" class="w-8 aspect-square rounded-full object-cover">
9
+ </div>
10
+ </div>
11
+ <div data-pt-id="c3" class="flex flex-1 flex-col items-center justify-center gap-3 p-6">
12
+ <h2 data-pt-type="text" data-pt-id="t1" class="text-4xl italic text-brand">Holiday Sale</h2>
13
+ <p data-pt-type="text" data-pt-id="t2" class="text-sm text-ink">Limited Time Only</p>
14
+ <p data-pt-type="text" data-pt-id="t3" class="text-5xl font-bold text-brand">$99.00</p>
15
+ <p data-pt-type="text" data-pt-id="t4" class="text-lg text-ink line-through">$109.00</p>
16
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="shop_now" href="#" class="flex min-h-12 w-full items-center justify-center bg-brand text-base font-bold tracking-widest text-surface">SHOP NOW</a>
17
+ </div>
18
+ </div>
@@ -0,0 +1,14 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #f2c879; --color-ink: #ffffff; --color-surface: #0b1c33; }</style>
2
+ <div data-pt-id="root" class="w-full max-w-[720px] rounded bg-surface p-8">
3
+ <div data-pt-id="c1" class="flex flex-col items-center gap-4">
4
+ <p data-pt-type="text" data-pt-id="t1" class="text-xl text-ink"><span class="font-bold text-brand">£9.9 Deposit</span> to Lock in Exclusive Launch Offer</p>
5
+ <h2 data-pt-type="text" data-pt-id="t2" class="text-4xl font-bold text-ink">Solar Battery STREAM 5000</h2>
6
+ <div data-pt-id="c2" data-pt-layout-mobile="stack" class="flex items-center gap-4">
7
+ <p data-pt-type="text" data-pt-id="t3" class="text-base text-ink">5024 Wh</p>
8
+ <p data-pt-type="text" data-pt-id="t4" class="text-base text-ink">5000W PV Input</p>
9
+ <p data-pt-type="text" data-pt-id="t5" class="text-base text-ink">15-Year Lifespan</p>
10
+ </div>
11
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="learn_more" href="#" class="flex min-h-12 items-center justify-center rounded-full bg-ink px-8 text-base font-bold text-surface">Learn More</a>
12
+ <img data-pt-type="media" data-pt-id="m1" src="battery.png" alt="STREAM 5000" class="w-full aspect-[16/10] object-contain">
13
+ </div>
14
+ </div>
@@ -0,0 +1,8 @@
1
+ <style type="text/tailwindcss" data-pt-id="theme">@theme { --color-brand: #06c755; --color-ink: #3a2430; --color-surface: #ffffff; }</style>
2
+ <div data-pt-id="root" class="w-full max-w-[420px] rounded bg-surface p-3">
3
+ <div data-pt-id="c1" class="flex flex-col gap-3">
4
+ <img data-pt-type="media" data-pt-id="m1" data-pt-placeholder data-pt-image-prompt="初来院限定クーポンのビジュアル。ピンク背景に女性モデルと¥25,000OFFクーポン券" src="" class="w-full aspect-[4/5] object-cover">
5
+ <p data-pt-type="text" data-pt-id="t1" class="text-center text-sm font-bold text-brand">LINEクーポン配布中!</p>
6
+ <a data-pt-type="button" data-pt-id="b1" data-pt-track="line_add" href="#" class="flex min-h-12 items-center justify-center rounded-full bg-brand text-base font-bold text-white">友だち追加はこちら</a>
7
+ </div>
8
+ </div>
@@ -0,0 +1,31 @@
1
+ # 弹窗 fixture
2
+
3
+ 按 19 张**真实线上弹窗样本**(设计文档附录「规则来源」里那一组)的形态重建的 v4 源片段。
4
+
5
+ **是重建,不是原样抓取** —— 原样本是各家线上站点的产物、格式各异(多数是 Silex)。
6
+ 这里保留的是对 fixture 有意义的那部分:**结构原型与 class 分布**。逐条对应:
7
+
8
+ | fixture | 原型 | 覆盖到的东西 |
9
+ |---|---|---|
10
+ | 01 / 19 | 纵向模态,单视觉 + CTA | 窄容器、`aspect-*`、**19 号带未落图占位** |
11
+ | 02 | 模态,人物照 + 日期块 | 头部条、分隔线、多层容器 |
12
+ | 03 | 模态,条纹头部 + 三图 | `grid-cols-3`、整行 CTA |
13
+ | 04 | 模态,商品图 + 期限 | `absolute` 叠字、下划线注记 |
14
+ | 05 | 模态,标签群 + 红 CTA | 图文左右分栏、`rounded-full` |
15
+ | 06 | 宽模态,两个 CTA 并排 | `md:flex-row`、边框按钮 vs 实心按钮 |
16
+ | 07 | 宽模态,带注释的视觉 | 长文案、`object-cover` |
17
+ | 08–11 | **吸底条 + 倒计时** | `data-pt-component="countdown"` 四种设置(flip / plain、日时分秒 / 毫秒) |
18
+ | 12 | 模态,2×2 商品网格 | `data-pt-layout-mobile="scroll"`、重复卡片结构 |
19
+ | 13 / 15 / 17 | 图左内容右 | `md:flex-row` 分栏、`md:w-1/2` |
20
+ | 14 / 15 / 16 | **邮件表单** | `data-pt-component="form"`,14 号还叠了倒计时 |
21
+ | 18 | 深色背景 + 三列规格 | `data-pt-layout-mobile="stack"`、深色 token |
22
+
23
+ 两条与 golden 直接相关的性质:
24
+
25
+ - **弹窗是 fragment,不是完整文档**(`KIND_PROFILES.popup.root === 'fragment'`),
26
+ 所以这些文件没有 `<html>` / `<head>`,第一个节点就是主题块。
27
+ - **`form` / `countdown` 在弹窗里是 `engage-sdk` 运行时**:源里只有声明式空壳,
28
+ 行为归 Engage SDK。core 给弹窗表单出脚本会和 SDK 抢同一张表单。
29
+
30
+ 每份各带自己的 `@theme`(品牌色差异很大),这同时把「按主题 hash 分缓存条目」
31
+ 与「tailwind-merge 按 @theme 派生」两条路径都压上了真实数据。
@@ -3,170 +3,254 @@
3
3
  "fixtures": [
4
4
  {
5
5
  "fixture": "canonical/01-tailwind-landing.txt",
6
+ "kind": "document",
7
+ "input": "fixtures/html/01-tailwind-landing.html",
6
8
  "sha256": "c70beb2e085d0c538f0b6852c763735d119e0a065f2bb450d5dfe5ec7c17539f"
7
9
  },
8
10
  {
9
11
  "fixture": "canonical/02-table-foster-parenting.txt",
12
+ "kind": "document",
13
+ "input": "fixtures/html/02-table-foster-parenting.html",
10
14
  "sha256": "3b723af0670b8a9edf275e77a0da643ed7b8ca4bd1dc93514a3dda0a69171408"
11
15
  },
12
16
  {
13
17
  "fixture": "canonical/03-p-block-nesting.txt",
18
+ "kind": "document",
19
+ "input": "fixtures/html/03-p-block-nesting.html",
14
20
  "sha256": "687bb7d4090da2a23d1397dca02c2480992bd3e4f586c5b18469b94b4308ff64"
15
21
  },
16
22
  {
17
23
  "fixture": "canonical/04-unclosed-misnested.txt",
24
+ "kind": "document",
25
+ "input": "fixtures/html/04-unclosed-misnested.html",
18
26
  "sha256": "f5e1b7beb75b6cd7204f28600e4038fedc4543877c93eeff7310bcd7844a6d1b"
19
27
  },
20
28
  {
21
29
  "fixture": "canonical/05-attr-quotes-entities-unicode.txt",
30
+ "kind": "document",
31
+ "input": "fixtures/html/05-attr-quotes-entities-unicode.html",
22
32
  "sha256": "151fcfd19531f5491a2a628cc323df28ab92ac1d01c38cd27e64290a2db36cfc"
23
33
  },
24
34
  {
25
35
  "fixture": "canonical/06-comments-rawtext.txt",
36
+ "kind": "document",
37
+ "input": "fixtures/html/06-comments-rawtext.html",
26
38
  "sha256": "0bc41478abce7a088bf37fc3c82ef706bbbfab556b30795aeff4b5669ac903fa"
27
39
  },
28
40
  {
29
41
  "fixture": "canonical/07-boolean-empty-attrs.txt",
42
+ "kind": "document",
43
+ "input": "fixtures/html/07-boolean-empty-attrs.html",
30
44
  "sha256": "eaf96016ae7d765d66c6e561c8cd2ea9b5e26e665a32a732c94b6e86847fc92b"
31
45
  },
32
46
  {
33
47
  "fixture": "canonical/08-mega-class-list.txt",
48
+ "kind": "document",
49
+ "input": "fixtures/html/08-mega-class-list.html",
34
50
  "sha256": "9c3e9f876500a5b678c36677b5baa75c580c61eb2b222769f1ab10a73b24caf9"
35
51
  },
36
52
  {
37
53
  "fixture": "canonical/09-legacy-doctype.txt",
54
+ "kind": "document",
55
+ "input": "fixtures/html/09-legacy-doctype.html",
38
56
  "sha256": "4fab52be1ccb9c0c985dd98b808178147084beac769aebb355d576156c1422f1"
39
57
  },
40
58
  {
41
59
  "fixture": "canonical/10-foreign-template-pre.txt",
60
+ "kind": "document",
61
+ "input": "fixtures/html/10-foreign-template-pre.html",
42
62
  "sha256": "c015da23781fc7f5fb26f6054f57d3c37e513944c0b368ba406f26c551531d9b"
43
63
  },
44
64
  {
45
65
  "fixture": "canonical/11-adoption-agency-deep.txt",
66
+ "kind": "document",
67
+ "input": "fixtures/html/11-adoption-agency-deep.html",
46
68
  "sha256": "fcb0a5ec78511e2f2039d764ff90b8b9b11b9368efb4e535053749fc7ae96cac"
47
69
  },
48
70
  {
49
71
  "fixture": "canonical/12-charrefs-control-chars.txt",
72
+ "kind": "document",
73
+ "input": "fixtures/html/12-charrefs-control-chars.html",
50
74
  "sha256": "b24a1c4c1f51183485639739fa69bcc451dca7a100de6990e7c510cf66269d42"
51
75
  },
52
76
  {
53
77
  "fixture": "canonical/13-namespaces-custom-dup-attrs.txt",
78
+ "kind": "document",
79
+ "input": "fixtures/html/13-namespaces-custom-dup-attrs.html",
54
80
  "sha256": "951f97adc5eeec527d830fb7b6a3b28b4f13192f2cec1cffdfa802b146efdce0"
55
81
  },
56
82
  {
57
83
  "fixture": "popup-canonical/01-jp-coupon-line-tall.txt",
84
+ "kind": "fragment",
85
+ "input": "fixtures/popup/01-jp-coupon-line-tall.html",
58
86
  "sha256": "f4d6fce08b3413a4bb1a2d8f7be2dbe45d869f29332f536a90ea05a05ef3560e"
59
87
  },
60
88
  {
61
89
  "fixture": "popup-canonical/02-jp-webinar-doctor.txt",
90
+ "kind": "fragment",
91
+ "input": "fixtures/popup/02-jp-webinar-doctor.html",
62
92
  "sha256": "87e56b79f3514678419cf33fd4d8d159f12382548091d3c67cc4a8a50717e4cc"
63
93
  },
64
94
  {
65
95
  "fixture": "popup-canonical/03-jp-model-recruit.txt",
96
+ "kind": "fragment",
97
+ "input": "fixtures/popup/03-jp-model-recruit.html",
66
98
  "sha256": "48b3451d6ecfd3e79ec23ad8ded08d66a137e55828f6eb4e96521ad9f52292f3"
67
99
  },
68
100
  {
69
101
  "fixture": "popup-canonical/04-jp-shinpi-campaign.txt",
102
+ "kind": "fragment",
103
+ "input": "fixtures/popup/04-jp-shinpi-campaign.html",
70
104
  "sha256": "8b866af5f1d2de37eba363b94a567d9a41f6451fbe0a46859588b6b33abe203a"
71
105
  },
72
106
  {
73
107
  "fixture": "popup-canonical/05-jp-jal-course.txt",
108
+ "kind": "fragment",
109
+ "input": "fixtures/popup/05-jp-jal-course.html",
74
110
  "sha256": "919a66d964e775905c2e9c05f61f1e0cd4e36fde5d962aacf25d691aa1cd67b8"
75
111
  },
76
112
  {
77
113
  "fixture": "popup-canonical/06-jp-training-two-cta.txt",
114
+ "kind": "fragment",
115
+ "input": "fixtures/popup/06-jp-training-two-cta.html",
78
116
  "sha256": "caf43139254da316f841c1b09df8714482a6d3c939c861df5e465c4dc3839394"
79
117
  },
80
118
  {
81
119
  "fixture": "popup-canonical/07-vivaia-lightweight-shoes.txt",
120
+ "kind": "fragment",
121
+ "input": "fixtures/popup/07-vivaia-lightweight-shoes.html",
82
122
  "sha256": "acd60830a6231d4680cb0de2ca9ad0f182953761f2524158d0364ea87aac5372"
83
123
  },
84
124
  {
85
125
  "fixture": "popup-canonical/08-sticky-black-friday-countdown.txt",
126
+ "kind": "fragment",
127
+ "input": "fixtures/popup/08-sticky-black-friday-countdown.html",
86
128
  "sha256": "92965e1fbfab27aeff9d98d0359e15820bafa3e78eaa6553b5a937fd6db97dd7"
87
129
  },
88
130
  {
89
131
  "fixture": "popup-canonical/09-sticky-line-coupon-countdown.txt",
132
+ "kind": "fragment",
133
+ "input": "fixtures/popup/09-sticky-line-coupon-countdown.html",
90
134
  "sha256": "8209face5ae705167ef14f21bfccb3d7d2c708aa3f7b6371b87879468fe3b2f9"
91
135
  },
92
136
  {
93
137
  "fixture": "popup-canonical/10-sticky-coupon-code-countdown.txt",
138
+ "kind": "fragment",
139
+ "input": "fixtures/popup/10-sticky-coupon-code-countdown.html",
94
140
  "sha256": "06594d8504a65a3a45ee3fbe10fb5046b5d1b071eaf21fe28ff62c9a60b98fab"
95
141
  },
96
142
  {
97
143
  "fixture": "popup-canonical/11-sticky-anniversary-countdown.txt",
144
+ "kind": "fragment",
145
+ "input": "fixtures/popup/11-sticky-anniversary-countdown.html",
98
146
  "sha256": "51da066020a1e32537842c93be8518e0d665af8fdc94e0339e63bf46bd6828fa"
99
147
  },
100
148
  {
101
149
  "fixture": "popup-canonical/12-vivaia-product-grid.txt",
150
+ "kind": "fragment",
151
+ "input": "fixtures/popup/12-vivaia-product-grid.html",
102
152
  "sha256": "db02805b296c0a054a3c0265bcd59caf904ea113aef9da448412b7d1222e2f79"
103
153
  },
104
154
  {
105
155
  "fixture": "popup-canonical/13-vivaia-restock-split.txt",
156
+ "kind": "fragment",
157
+ "input": "fixtures/popup/13-vivaia-restock-split.html",
106
158
  "sha256": "02c5f27ff8f09fd884e98a7b95fa60407be25441657746bcf8c1a7f6b17e4caa"
107
159
  },
108
160
  {
109
161
  "fixture": "popup-canonical/14-back-to-school-email-form.txt",
162
+ "kind": "fragment",
163
+ "input": "fixtures/popup/14-back-to-school-email-form.html",
110
164
  "sha256": "5df1fa26566773acfa8e33417b84014a90b79e03619062bc7029674056af3954"
111
165
  },
112
166
  {
113
167
  "fixture": "popup-canonical/15-xtool-ebook-split-form.txt",
168
+ "kind": "fragment",
169
+ "input": "fixtures/popup/15-xtool-ebook-split-form.html",
114
170
  "sha256": "6bc46c4e35677bcdbbeb93aad8a42c4b95f7039890ff07b80eda1eeed43cb759"
115
171
  },
116
172
  {
117
173
  "fixture": "popup-canonical/16-880-off-gradient-form.txt",
174
+ "kind": "fragment",
175
+ "input": "fixtures/popup/16-880-off-gradient-form.html",
118
176
  "sha256": "0b0e431349b51ec3eb0aad65da385d69a255cafbc3179af8b9abbe78bbe491cd"
119
177
  },
120
178
  {
121
179
  "fixture": "popup-canonical/17-holiday-sale-price-swatch.txt",
180
+ "kind": "fragment",
181
+ "input": "fixtures/popup/17-holiday-sale-price-swatch.html",
122
182
  "sha256": "5b8b71bbf145753e095e044b2616ab1df7434878a87f0b2739f15819b996b09d"
123
183
  },
124
184
  {
125
185
  "fixture": "popup-canonical/18-solar-battery-dark-specs.txt",
186
+ "kind": "fragment",
187
+ "input": "fixtures/popup/18-solar-battery-dark-specs.html",
126
188
  "sha256": "4601802f37e663159e9b58a0fe9d2617b53bd80f88bc15aea55876fdc18886c7"
127
189
  },
128
190
  {
129
191
  "fixture": "popup-canonical/19-jp-clinic-coupon-placeholder.txt",
192
+ "kind": "fragment",
193
+ "input": "fixtures/popup/19-jp-clinic-coupon-placeholder.html",
130
194
  "sha256": "6b56860a22d361f1cca4419ce5ff0d974fbe08cd00b92ab6c1d48e190ca4c3ef"
131
195
  },
132
196
  {
133
197
  "fixture": "apply-golden/01-set-attrs-classes.txt",
198
+ "kind": "apply",
199
+ "input": "ops-cases.json#01-set-attrs-classes",
134
200
  "sha256": "3309bb2a6959b472e28b5fba4120c1905725d532d1ea1a8363c1662507b66a36"
135
201
  },
136
202
  {
137
203
  "fixture": "apply-golden/02-rich-text-and-theme.txt",
204
+ "kind": "apply",
205
+ "input": "ops-cases.json#02-rich-text-and-theme",
138
206
  "sha256": "0a71c74fdcdd85dfe10312ff49d7e2adc27ba5c45ef86b4ac522c6184a70b450"
139
207
  },
140
208
  {
141
209
  "fixture": "apply-golden/03-insert-delete-whitespace.txt",
210
+ "kind": "apply",
211
+ "input": "ops-cases.json#03-insert-delete-whitespace",
142
212
  "sha256": "65b7772ac8e507869030071be9e0febb664657a07aa10729482b352b1289777e"
143
213
  },
144
214
  {
145
215
  "fixture": "apply-golden/04-sequential-index-semantics.txt",
216
+ "kind": "apply",
217
+ "input": "ops-cases.json#04-sequential-index-semantics",
146
218
  "sha256": "acc91eb6f761f0fe5f35136e4eaa03cfb130ff33add9d5313438a653479e51df"
147
219
  },
148
220
  {
149
221
  "fixture": "apply-golden/05-delete-cascade.txt",
222
+ "kind": "apply",
223
+ "input": "ops-cases.json#05-delete-cascade",
150
224
  "sha256": "60beed20aac09149c67b786e58b66f8501849810d4cac0ea3d2ce7908f8e1f90"
151
225
  },
152
226
  {
153
227
  "fixture": "apply-golden/06-replace-keeps-id.txt",
228
+ "kind": "apply",
229
+ "input": "ops-cases.json#06-replace-keeps-id",
154
230
  "sha256": "c594bb2cbabe05984dced5b5fe14579a815abcefcd7bb0e6fbca69e49d70bb27"
155
231
  },
156
232
  {
157
233
  "fixture": "apply-golden/07-opaque-table-text-edit.txt",
234
+ "kind": "apply",
235
+ "input": "ops-cases.json#07-opaque-table-text-edit",
158
236
  "sha256": "f73439f9454d39caa43470f921f2f5dd0be7934fbb60c9fe27fb95cd99965b7e"
159
237
  },
160
238
  {
161
239
  "fixture": "apply-golden/08-picture-and-placeholder.txt",
240
+ "kind": "apply",
241
+ "input": "ops-cases.json#08-picture-and-placeholder",
162
242
  "sha256": "9f708b74065b9afe078100a50c15549e756fca1e81f9bb299796b1cfa4eaeadf"
163
243
  },
164
244
  {
165
245
  "fixture": "apply-golden/09-move-across-containers.txt",
246
+ "kind": "apply",
247
+ "input": "ops-cases.json#09-move-across-containers",
166
248
  "sha256": "91ab24e869d3082abfc6cb41eda17693bff6621fdf870a53dedd4e3ca10eb05b"
167
249
  },
168
250
  {
169
251
  "fixture": "apply-golden/10-insert-section-into-root.txt",
252
+ "kind": "apply",
253
+ "input": "ops-cases.json#10-insert-section-into-root",
170
254
  "sha256": "7131403b7dc6e97f947d7b57a0ae6123d73c0d3648308ee12744831b69f3bb19"
171
255
  }
172
256
  ]
@@ -0,0 +1,179 @@
1
+ {
2
+ "wrapper": "<!DOCTYPE html><html lang=\"ja\"><head><meta charset=\"utf-8\"><meta name=\"lpx-format\" content=\"4\"><style type=\"text/tailwindcss\" data-pt-id=\"theme\">@theme { --color-brand: #1a73e8; }</style>{{HEAD_EXTRA}}</head><body data-pt-id=\"root\" class=\"flex flex-col\">{{BODY}}</body></html>",
3
+ "cases": [
4
+ {
5
+ "name": "01-set-attrs-classes",
6
+ "body": "<section data-pt-id=\"s1\" class=\"py-section-y\">\n<div data-pt-id=\"c1\" class=\"flex flex-col md:flex-row\">\n<h1 data-pt-type=\"text\" data-pt-id=\"t1\" class=\"text-display-1 font-bold\">标题</h1>\n</div>\n</section>",
7
+ "ops": [
8
+ {
9
+ "op": "set",
10
+ "id": "t1",
11
+ "attrs": {
12
+ "data-pt-name": "主标题",
13
+ "data-pt-description": null
14
+ }
15
+ },
16
+ {
17
+ "op": "set",
18
+ "id": "t1",
19
+ "classes": {
20
+ "add": [
21
+ "md:text-4xl",
22
+ "text-center"
23
+ ],
24
+ "remove": [
25
+ "font-bold"
26
+ ]
27
+ }
28
+ },
29
+ {
30
+ "op": "set",
31
+ "id": "c1",
32
+ "classes": {
33
+ "add": [
34
+ "gap-6"
35
+ ]
36
+ }
37
+ }
38
+ ]
39
+ },
40
+ {
41
+ "name": "02-rich-text-and-theme",
42
+ "body": "<section data-pt-id=\"s1\">\n<div data-pt-id=\"c1\">\n<p data-pt-type=\"text\" data-pt-id=\"t1\">原文 <b>粗</b> 与 <a href=\"#\">链接</a></p>\n</div>\n</section>",
43
+ "ops": [
44
+ {
45
+ "op": "set",
46
+ "id": "t1",
47
+ "text": "改过的 <b>粗体</b> 和 <i>斜体</i>"
48
+ },
49
+ {
50
+ "op": "set",
51
+ "id": "theme",
52
+ "text": "@theme { --color-brand: #ff0000; --text-display-1: 3rem; }"
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "name": "03-insert-delete-whitespace",
58
+ "body": "<section data-pt-id=\"s1\">\n<div data-pt-id=\"c1\">\n<p data-pt-type=\"text\" data-pt-id=\"t1\">一</p>\n<p data-pt-type=\"text\" data-pt-id=\"t2\">二</p>\n<p data-pt-type=\"text\" data-pt-id=\"t3\">三</p>\n</div>\n</section>",
59
+ "ops": [
60
+ {
61
+ "op": "delete",
62
+ "id": "t2"
63
+ },
64
+ {
65
+ "op": "insert",
66
+ "parentId": "c1",
67
+ "index": 1,
68
+ "html": "<p data-pt-type=\"text\" data-pt-id=\"n1\" class=\"text-sm\">插入</p>"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "name": "04-sequential-index-semantics",
74
+ "body": "<section data-pt-id=\"s1\"><div data-pt-id=\"c1\"><p data-pt-type=\"text\" data-pt-id=\"t1\">一</p><p data-pt-type=\"text\" data-pt-id=\"t2\">二</p></div></section>",
75
+ "ops": [
76
+ {
77
+ "op": "insert",
78
+ "parentId": "c1",
79
+ "index": 0,
80
+ "html": "<p data-pt-type=\"text\" data-pt-id=\"n1\">A</p>"
81
+ },
82
+ {
83
+ "op": "insert",
84
+ "parentId": "c1",
85
+ "index": 2,
86
+ "html": "<p data-pt-type=\"text\" data-pt-id=\"n2\">B</p>"
87
+ },
88
+ {
89
+ "op": "move",
90
+ "id": "n1",
91
+ "parentId": "c1",
92
+ "index": 3
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "name": "05-delete-cascade",
98
+ "body": "<section data-pt-id=\"s1\"><div data-pt-id=\"c1\"><p data-pt-type=\"text\" data-pt-id=\"t1\">x</p></div></section><section data-pt-id=\"s2\"><div data-pt-id=\"c2\"><p data-pt-type=\"text\" data-pt-id=\"t2\">y</p></div></section>",
99
+ "ops": [
100
+ {
101
+ "op": "delete",
102
+ "id": "t1"
103
+ },
104
+ {
105
+ "op": "delete",
106
+ "id": "c2"
107
+ }
108
+ ]
109
+ },
110
+ {
111
+ "name": "06-replace-keeps-id",
112
+ "body": "<section data-pt-id=\"s1\"><div data-pt-id=\"c1\"><h1 data-pt-type=\"text\" data-pt-id=\"t1\" class=\"text-display-1\">旧</h1></div></section>",
113
+ "ops": [
114
+ {
115
+ "op": "replace",
116
+ "id": "t1",
117
+ "html": "<h2 data-pt-type=\"text\" data-pt-id=\"t1\" class=\"text-2xl font-bold\">新<span>内联</span></h2>"
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ "name": "07-opaque-table-text-edit",
123
+ "body": "<section data-pt-id=\"s1\"><div data-pt-id=\"c1\"><table data-pt-id=\"tb1\" data-pt-opaque=\"text\"><tbody><tr><th data-pt-id=\"h1\">表头</th><td data-pt-id=\"d1\">单元格</td></tr></tbody></table></div></section>",
124
+ "ops": [
125
+ {
126
+ "op": "set",
127
+ "id": "d1",
128
+ "text": "改过的单元格"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "name": "08-picture-and-placeholder",
134
+ "body": "<section data-pt-id=\"s1\"><div data-pt-id=\"c1\">\n<picture data-pt-type=\"media\" data-pt-id=\"m1\"><source media=\"(min-width:768px)\" srcset=\"pc.jpg\"><img src=\"sp.jpg\" alt=\"\" class=\"w-full aspect-[4/3]\"></picture>\n<img data-pt-type=\"media\" data-pt-id=\"m2\" data-pt-placeholder data-pt-image-prompt=\"日式护肤特写\" src=\"\" class=\"w-full aspect-[4/3]\">\n</div></section>",
135
+ "ops": [
136
+ {
137
+ "op": "set",
138
+ "id": "m2",
139
+ "attrs": {
140
+ "src": "hero.jpg",
141
+ "alt": "日式护肤特写",
142
+ "data-pt-placeholder": null,
143
+ "data-pt-image-prompt": null
144
+ }
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "name": "09-move-across-containers",
150
+ "body": "<section data-pt-id=\"s1\">\n<div data-pt-id=\"c1\">\n<p data-pt-type=\"text\" data-pt-id=\"t1\">一</p>\n<p data-pt-type=\"text\" data-pt-id=\"t2\">二</p>\n</div>\n<div data-pt-id=\"c2\">\n<p data-pt-type=\"text\" data-pt-id=\"t3\">三</p>\n</div>\n</section>",
151
+ "ops": [
152
+ {
153
+ "op": "move",
154
+ "id": "t1",
155
+ "parentId": "c2",
156
+ "index": 0
157
+ },
158
+ {
159
+ "op": "move",
160
+ "id": "t3",
161
+ "parentId": "c1",
162
+ "index": 1
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "name": "10-insert-section-into-root",
168
+ "body": "<section data-pt-id=\"s1\"><div data-pt-id=\"c1\"><p data-pt-type=\"text\" data-pt-id=\"t1\">x</p></div></section>",
169
+ "ops": [
170
+ {
171
+ "op": "insert",
172
+ "parentId": "root",
173
+ "index": 1,
174
+ "html": "<section data-pt-id=\"s2\" class=\"py-section-y\"><div data-pt-id=\"c2\" class=\"flex\"><a data-pt-type=\"button\" data-pt-id=\"b1\" href=\"#\" class=\"bg-brand text-white\">CTA</a></div></section>"
175
+ }
176
+ ]
177
+ }
178
+ ]
179
+ }