@ptengine/lp-editor-core 1.0.0-alpha.3 → 1.0.0-alpha.5

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.
@@ -0,0 +1,550 @@
1
+ {
2
+ "types": [
3
+ "carousel",
4
+ "faq",
5
+ "tabs",
6
+ "form",
7
+ "sticky-cta"
8
+ ],
9
+ "cases": [
10
+ {
11
+ "name": "carousel-empty",
12
+ "type": "carousel",
13
+ "id": "c1",
14
+ "settings": {}
15
+ },
16
+ {
17
+ "name": "carousel-hero",
18
+ "type": "carousel",
19
+ "id": "c1",
20
+ "settings": {
21
+ "layout": "hero",
22
+ "interval": 4000,
23
+ "_blocks": [
24
+ {
25
+ "type": "slide",
26
+ "settings": {
27
+ "image": "https://cdn.test/a.jpg",
28
+ "title": "标题 A",
29
+ "subtitle": "副标题",
30
+ "buttonText": "了解更多",
31
+ "buttonUrl": "/a"
32
+ }
33
+ },
34
+ {
35
+ "type": "slide",
36
+ "settings": {
37
+ "title": "Slide B"
38
+ }
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "name": "carousel-image",
45
+ "type": "carousel",
46
+ "id": "c1",
47
+ "settings": {
48
+ "layout": "image",
49
+ "_blocks": [
50
+ {
51
+ "type": "slide",
52
+ "settings": {
53
+ "image": "https://cdn.test/a.jpg",
54
+ "title": "alt 文案"
55
+ }
56
+ },
57
+ {
58
+ "type": "slide",
59
+ "settings": {
60
+ "image": "https://cdn.test/b.jpg"
61
+ }
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "carousel-no-controls",
68
+ "type": "carousel",
69
+ "id": "c1",
70
+ "settings": {
71
+ "showDots": false,
72
+ "showArrows": false,
73
+ "autoplay": false,
74
+ "_blocks": [
75
+ {
76
+ "type": "slide",
77
+ "settings": {
78
+ "title": "A"
79
+ }
80
+ },
81
+ {
82
+ "type": "slide",
83
+ "settings": {
84
+ "title": "B"
85
+ }
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "name": "faq-empty",
92
+ "type": "faq",
93
+ "id": "c1",
94
+ "settings": {}
95
+ },
96
+ {
97
+ "name": "faq-accordion-chevron",
98
+ "type": "faq",
99
+ "id": "c1",
100
+ "settings": {
101
+ "title": "常见问题",
102
+ "_blocks": [
103
+ {
104
+ "type": "item",
105
+ "settings": {
106
+ "question": "能退货吗?",
107
+ "answer": "<p>7 天内可退。</p>",
108
+ "defaultOpen": true
109
+ }
110
+ },
111
+ {
112
+ "type": "item",
113
+ "settings": {
114
+ "question": "怎么发货?",
115
+ "answer": "次日达。"
116
+ }
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ {
122
+ "name": "faq-accordion-plus",
123
+ "type": "faq",
124
+ "id": "c1",
125
+ "settings": {
126
+ "iconStyle": "plus",
127
+ "_blocks": [
128
+ {
129
+ "type": "item",
130
+ "settings": {
131
+ "question": "Q1",
132
+ "answer": "A1"
133
+ }
134
+ },
135
+ {
136
+ "type": "item",
137
+ "settings": {
138
+ "question": "Q2",
139
+ "answer": "A2"
140
+ }
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ {
146
+ "name": "faq-list",
147
+ "type": "faq",
148
+ "id": "c1",
149
+ "settings": {
150
+ "style": "list",
151
+ "title": "FAQ",
152
+ "_blocks": [
153
+ {
154
+ "type": "item",
155
+ "settings": {
156
+ "question": "Q1",
157
+ "answer": "<b>A1</b>"
158
+ }
159
+ }
160
+ ]
161
+ }
162
+ },
163
+ {
164
+ "name": "tabs-empty",
165
+ "type": "tabs",
166
+ "id": "c1",
167
+ "settings": {}
168
+ },
169
+ {
170
+ "name": "tabs-underline",
171
+ "type": "tabs",
172
+ "id": "c1",
173
+ "settings": {
174
+ "title": "产品",
175
+ "_blocks": [
176
+ {
177
+ "type": "tab",
178
+ "settings": {
179
+ "title": "特性",
180
+ "content": "<p>c1</p>",
181
+ "icon": "★"
182
+ }
183
+ },
184
+ {
185
+ "type": "tab",
186
+ "settings": {
187
+ "title": "价格",
188
+ "content": "<p>c2</p>"
189
+ }
190
+ }
191
+ ]
192
+ }
193
+ },
194
+ {
195
+ "name": "tabs-pill",
196
+ "type": "tabs",
197
+ "id": "c1",
198
+ "settings": {
199
+ "tabStyle": "pill",
200
+ "_blocks": [
201
+ {
202
+ "type": "tab",
203
+ "settings": {
204
+ "title": "A",
205
+ "content": "a"
206
+ }
207
+ },
208
+ {
209
+ "type": "tab",
210
+ "settings": {
211
+ "title": "B",
212
+ "content": "b"
213
+ }
214
+ }
215
+ ]
216
+ }
217
+ },
218
+ {
219
+ "name": "tabs-boxed-default1",
220
+ "type": "tabs",
221
+ "id": "c1",
222
+ "settings": {
223
+ "tabStyle": "boxed",
224
+ "defaultTab": 1,
225
+ "_blocks": [
226
+ {
227
+ "type": "tab",
228
+ "settings": {
229
+ "title": "A",
230
+ "content": "a"
231
+ }
232
+ },
233
+ {
234
+ "type": "tab",
235
+ "settings": {
236
+ "title": "B",
237
+ "content": "b"
238
+ }
239
+ }
240
+ ]
241
+ }
242
+ },
243
+ {
244
+ "name": "form-empty",
245
+ "type": "form",
246
+ "id": "c1",
247
+ "settings": {}
248
+ },
249
+ {
250
+ "name": "form-icon-none",
251
+ "type": "form",
252
+ "id": "c1",
253
+ "settings": {
254
+ "submitText": "提交"
255
+ }
256
+ },
257
+ {
258
+ "name": "form-icon-email",
259
+ "type": "form",
260
+ "id": "c1",
261
+ "settings": {
262
+ "submitIcon": "email",
263
+ "submitText": "订阅"
264
+ }
265
+ },
266
+ {
267
+ "name": "form-icon-arrow",
268
+ "type": "form",
269
+ "id": "c1",
270
+ "settings": {
271
+ "submitIcon": "arrow",
272
+ "submitText": "下一步"
273
+ }
274
+ },
275
+ {
276
+ "name": "form-icon-check",
277
+ "type": "form",
278
+ "id": "c1",
279
+ "settings": {
280
+ "submitIcon": "check",
281
+ "submitText": "确认"
282
+ }
283
+ },
284
+ {
285
+ "name": "form-all-field-types",
286
+ "type": "form",
287
+ "id": "c1",
288
+ "settings": {
289
+ "_blocks": [
290
+ {
291
+ "type": "field",
292
+ "settings": {
293
+ "label": "字段 text",
294
+ "name": "f_text",
295
+ "fieldType": "text",
296
+ "placeholder": "请输入text",
297
+ "options": [
298
+ "甲",
299
+ "乙"
300
+ ]
301
+ }
302
+ },
303
+ {
304
+ "type": "field",
305
+ "settings": {
306
+ "label": "字段 email",
307
+ "name": "f_email",
308
+ "fieldType": "email",
309
+ "placeholder": "请输入email",
310
+ "options": [
311
+ "甲",
312
+ "乙"
313
+ ]
314
+ }
315
+ },
316
+ {
317
+ "type": "field",
318
+ "settings": {
319
+ "label": "字段 tel",
320
+ "name": "f_tel",
321
+ "fieldType": "tel",
322
+ "placeholder": "请输入tel",
323
+ "options": [
324
+ "甲",
325
+ "乙"
326
+ ]
327
+ }
328
+ },
329
+ {
330
+ "type": "field",
331
+ "settings": {
332
+ "label": "字段 number",
333
+ "name": "f_number",
334
+ "fieldType": "number",
335
+ "placeholder": "请输入number",
336
+ "options": [
337
+ "甲",
338
+ "乙"
339
+ ]
340
+ }
341
+ },
342
+ {
343
+ "type": "field",
344
+ "settings": {
345
+ "label": "字段 textarea",
346
+ "name": "f_textarea",
347
+ "fieldType": "textarea",
348
+ "placeholder": "请输入textarea",
349
+ "options": [
350
+ "甲",
351
+ "乙"
352
+ ]
353
+ }
354
+ },
355
+ {
356
+ "type": "field",
357
+ "settings": {
358
+ "label": "字段 select",
359
+ "name": "f_select",
360
+ "fieldType": "select",
361
+ "placeholder": "请输入select",
362
+ "options": [
363
+ "甲",
364
+ "乙"
365
+ ]
366
+ }
367
+ },
368
+ {
369
+ "type": "field",
370
+ "settings": {
371
+ "label": "字段 checkbox",
372
+ "name": "f_checkbox",
373
+ "fieldType": "checkbox",
374
+ "placeholder": "请输入checkbox",
375
+ "options": [
376
+ "甲",
377
+ "乙"
378
+ ]
379
+ }
380
+ },
381
+ {
382
+ "type": "field",
383
+ "settings": {
384
+ "label": "字段 radio",
385
+ "name": "f_radio",
386
+ "fieldType": "radio",
387
+ "placeholder": "请输入radio",
388
+ "options": [
389
+ "甲",
390
+ "乙"
391
+ ]
392
+ }
393
+ },
394
+ {
395
+ "type": "field",
396
+ "settings": {
397
+ "label": "字段 date",
398
+ "name": "f_date",
399
+ "fieldType": "date",
400
+ "placeholder": "请输入date",
401
+ "options": [
402
+ "甲",
403
+ "乙"
404
+ ]
405
+ }
406
+ },
407
+ {
408
+ "type": "field",
409
+ "settings": {
410
+ "label": "字段 label",
411
+ "name": "f_label",
412
+ "fieldType": "label",
413
+ "placeholder": "请输入label",
414
+ "options": [
415
+ "甲",
416
+ "乙"
417
+ ]
418
+ }
419
+ },
420
+ {
421
+ "type": "field",
422
+ "settings": {
423
+ "label": "字段 step",
424
+ "name": "f_step",
425
+ "fieldType": "step",
426
+ "placeholder": "请输入step",
427
+ "options": [
428
+ "甲",
429
+ "乙"
430
+ ]
431
+ }
432
+ }
433
+ ]
434
+ }
435
+ },
436
+ {
437
+ "name": "form-inline-badge-half",
438
+ "type": "form",
439
+ "id": "c1",
440
+ "settings": {
441
+ "labelPosition": "inline",
442
+ "requiredStyle": "badge",
443
+ "requiredBadgeText": "必須",
444
+ "_blocks": [
445
+ {
446
+ "type": "field",
447
+ "settings": {
448
+ "label": "姓名",
449
+ "name": "name",
450
+ "required": true,
451
+ "width": "half"
452
+ }
453
+ },
454
+ {
455
+ "type": "field",
456
+ "settings": {
457
+ "label": "邮箱",
458
+ "name": "email",
459
+ "fieldType": "email",
460
+ "width": "full"
461
+ }
462
+ }
463
+ ]
464
+ }
465
+ },
466
+ {
467
+ "name": "form-multistep",
468
+ "type": "form",
469
+ "id": "c1",
470
+ "settings": {
471
+ "multiStep": true,
472
+ "footerText": "隐私政策见 <a href=\"/p\">这里</a>",
473
+ "successMessage": "已收到",
474
+ "_blocks": [
475
+ {
476
+ "type": "field",
477
+ "settings": {
478
+ "label": "姓名",
479
+ "name": "name"
480
+ }
481
+ },
482
+ {
483
+ "type": "field",
484
+ "settings": {
485
+ "label": "第二步",
486
+ "fieldType": "step"
487
+ }
488
+ },
489
+ {
490
+ "type": "field",
491
+ "settings": {
492
+ "label": "邮箱",
493
+ "name": "email",
494
+ "fieldType": "email",
495
+ "required": true
496
+ }
497
+ }
498
+ ]
499
+ }
500
+ },
501
+ {
502
+ "name": "form-action",
503
+ "type": "form",
504
+ "id": "c1",
505
+ "settings": {
506
+ "formName": "lead",
507
+ "formAction": "https://example.test/submit",
508
+ "_blocks": [
509
+ {
510
+ "type": "field",
511
+ "settings": {
512
+ "label": "邮箱",
513
+ "name": "email",
514
+ "fieldType": "email"
515
+ }
516
+ }
517
+ ]
518
+ }
519
+ },
520
+ {
521
+ "name": "sticky-empty",
522
+ "type": "sticky-cta",
523
+ "id": "c1",
524
+ "settings": {}
525
+ },
526
+ {
527
+ "name": "sticky-mobile-center",
528
+ "type": "sticky-cta",
529
+ "id": "c1",
530
+ "settings": {
531
+ "text": "限时 8 折",
532
+ "buttonText": "立即购买",
533
+ "buttonUrl": "/buy"
534
+ }
535
+ },
536
+ {
537
+ "name": "sticky-all-between",
538
+ "type": "sticky-cta",
539
+ "id": "c1",
540
+ "settings": {
541
+ "showOn": "all",
542
+ "align": "between",
543
+ "showAfter": 600,
544
+ "text": "还剩 3 件",
545
+ "buttonText": "去看看",
546
+ "buttonUrl": "/p"
547
+ }
548
+ }
549
+ ]
550
+ }
@@ -135,7 +135,7 @@
135
135
  <section data-pt-id="s9" data-pt-name="FAQ" class="py-section-y px-4">
136
136
  <div data-pt-id="c20" class="mx-auto flex max-w-[750px] flex-col gap-4">
137
137
  <h2 data-pt-type="text" data-pt-id="t29" class="text-center text-display-2 font-bold">よくあるご質問</h2>
138
- <div data-pt-id="k1" data-pt-component="faq" data-pt-component-settings='{"items":[{"q":"敏感肌でも使えますか","a":"パッチテスト済みですが、心配な方は twarzy でお試しください。"},{"q":"石けんだけで落ちますか","a":"はい、通常の洗顔料で落とせます。"},{"q":"化粧下地として使えますか","a":"はい、スキンケアの最後にお使いください。"},{"q":"1本でどのくらい持ちますか","a":"顔全体で約2か月分です。"},{"q":"子どもにも使えますか","a":"3歳以上のお子さまにお使いいただけます。"}]}'></div>
138
+ <div data-pt-id="k1" data-pt-component="faq" data-pt-component-settings='{"_blocks":[{"type":"item","settings":{"question":"敏感肌でも使えますか","answer":"パッチテスト済みですが、心配な方は twarzy でお試しください。"}},{"type":"item","settings":{"question":"石けんだけで落ちますか","answer":"はい、通常の洗顔料で落とせます。"}},{"type":"item","settings":{"question":"化粧下地として使えますか","answer":"はい、スキンケアの最後にお使いください。"}},{"type":"item","settings":{"question":"1本でどのくらい持ちますか","answer":"顔全体で約2か月分です。"}},{"type":"item","settings":{"question":"子どもにも使えますか","answer":"3歳以上のお子さまにお使いいただけます。"}}]}'></div>
139
139
  </div>
140
140
  </section>
141
141
 
@@ -179,7 +179,7 @@
179
179
 
180
180
  <section data-pt-id="s7" data-pt-name="吸底 CTA" class="py-section-y px-4">
181
181
  <div data-pt-id="c28" class="mx-auto flex max-w-[1200px] flex-col gap-4">
182
- <div data-pt-id="k1" data-pt-component="sticky-cta" data-pt-component-settings='{"label":"この商品をみる","href":"#shop","showAfter":600,"hideOnPc":false,"align":"center"}'></div>
182
+ <div data-pt-id="k1" data-pt-component="sticky-cta" data-pt-component-settings='{"buttonText":"この商品をみる","buttonUrl":"#shop","showAfter":600,"showOn":"all","align":"center"}'></div>
183
183
  <p data-pt-type="text" data-pt-id="t35" data-pt-hide="pc" class="text-center text-xs text-muted">送料無料・30日間返品保証</p>
184
184
  </div>
185
185
  </section>
@@ -8,7 +8,7 @@
8
8
  <p data-pt-type="text" data-pt-id="t4" class="text-sm text-ink">Offer closes in</p>
9
9
  <div data-pt-id="k1" data-pt-component="countdown" data-pt-component-settings='{"style":"plain","units":["minutes","seconds"],"durationSeconds":115}'></div>
10
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>
11
+ <div data-pt-id="k2" data-pt-component="form" data-pt-component-settings='{"submitText":"Claim Now","_blocks":[{"type":"field","settings":{"name":"email","fieldType":"email","placeholder":"Enter an email to subscribe","required":true}}]}'></div>
12
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
13
  </div>
14
14
  </div>
@@ -4,6 +4,6 @@
4
4
  <div data-pt-id="c1" class="flex flex-1 flex-col justify-center gap-4 p-8">
5
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
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>
7
+ <div data-pt-id="k1" data-pt-component="form" data-pt-component-settings='{"submitText":"Download Now","_blocks":[{"type":"field","settings":{"name":"email","fieldType":"email","placeholder":"Enter an email to subscribe","required":true}}]}'></div>
8
8
  </div>
9
9
  </div>
@@ -3,6 +3,6 @@
3
3
  <div data-pt-id="c1" class="flex flex-col items-center gap-4 border-2 border-white p-6">
4
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
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>
6
+ <div data-pt-id="k1" data-pt-component="form" data-pt-component-settings='{"submitText":"Get My Coupons","_blocks":[{"type":"field","settings":{"name":"email","fieldType":"email","placeholder":"Enter Your Email to Subscribe","required":true}}]}'></div>
7
7
  </div>
8
8
  </div>
@@ -28,9 +28,9 @@
28
28
  core 里因此**没有「弹窗档」这回事** —— 包裹之后它与落地页走同一套规则。
29
29
  往返由 `popup-wrapped/` 下的 golden 与随包发布的复算脚本一起锁住。
30
30
  - **组件在源里只有声明式空壳**:`data-pt-component` + `data-pt-component-settings`,
31
- 没有一个子元素。core 的渲染器只出语义化 markup + settings、一行脚本都不出,
32
- **行为归宿主的运行时** —— 谁提供它(落地页的 lp-sdk / 弹窗宿主的 SDK)是宿主
33
- 的事,core 不认识它们。
31
+ 没有一个子元素。展开由 core 的渲染器负责,产出 `{ html, css, js }` 三件;
32
+ **js 那件由拼装方决定用不用** —— 落地页成品与画布要它,弹窗宿主丢弃它
33
+ (行为归 Engage SDK)。core 出的是自包含的通用行为,不认识任何宿主运行时。
34
34
 
35
35
  每份各带自己的 `@theme`(品牌色差异很大),这同时把「按主题 hash 分缓存条目」
36
36
  与「tailwind-merge 按 @theme 派生」两条路径都压上了真实数据。