@lingjingai/script-editor 0.2.0 → 0.3.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.
- package/dist/index.d.ts +58 -3
- package/dist/index.js +114 -28
- package/dist/index.js.map +1 -1
- package/dist/style.css +60 -7
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -39,6 +39,14 @@
|
|
|
39
39
|
--lj-se-actor-cue-7: oklch(0.46 0.18 335);
|
|
40
40
|
--lj-se-actor-cue-8: oklch(0.30 0.04 270);
|
|
41
41
|
|
|
42
|
+
/* content column width (host-overridable; e.g. set to a larger px, or 100% to
|
|
43
|
+
fill the container). Applies to script segments AND asset cards alike. */
|
|
44
|
+
--lj-se-content-width: 820px;
|
|
45
|
+
/* range highlight (host-overridable) + timestamp gutter width/color */
|
|
46
|
+
--lj-se-hl-bg: oklch(0.9 0.15 95 / 0.5);
|
|
47
|
+
--lj-se-ts-fg: var(--lj-se-muted-fg);
|
|
48
|
+
--lj-se-ts-width: 52px;
|
|
49
|
+
|
|
42
50
|
display: flex;
|
|
43
51
|
min-height: 0;
|
|
44
52
|
height: 100%;
|
|
@@ -177,6 +185,13 @@
|
|
|
177
185
|
}
|
|
178
186
|
.lj-se-paper-seg.is-sole { border-radius: 8px; box-shadow: var(--lj-se-paper-shadow); }
|
|
179
187
|
|
|
188
|
+
/* Plain segment: paper surface OFF (paper={false}). Same layout box as
|
|
189
|
+
lj-se-paper-seg but flat — no parchment texture, borders, or shadow, and it
|
|
190
|
+
inherits the ambient fg/bg instead of the paper palette. Edge modifiers
|
|
191
|
+
(is-start/is-end/is-sole/is-mid) are accepted but visually inert. */
|
|
192
|
+
.lj-se-plain-seg { position: relative; background: transparent; color: inherit; isolation: isolate; }
|
|
193
|
+
.lj-se-plain-seg > * { position: relative; z-index: 1; }
|
|
194
|
+
|
|
180
195
|
/* ── click-to-edit primitive ──────────────────────────────────────────── */
|
|
181
196
|
.lj-se-editable {
|
|
182
197
|
cursor: text;
|
|
@@ -339,6 +354,8 @@
|
|
|
339
354
|
.lj-se-toc-l0 { padding-left: 8px; padding-right: 8px; font-size: 13px; font-weight: 500; }
|
|
340
355
|
.lj-se-toc-l1 { padding-left: 20px; padding-right: 8px; font-size: 13px; font-weight: 500; }
|
|
341
356
|
.lj-se-toc-l2 { padding-left: 36px; padding-right: 8px; font-size: 12px; color: color-mix(in oklab, var(--lj-se-fg) 65%, transparent); }
|
|
357
|
+
/* 背景资产行:折叠区内缩进一级(比背景折叠头 20px 更深)。 */
|
|
358
|
+
.lj-se-toc-bg { padding-left: 36px; padding-right: 8px; font-size: 13px; font-weight: 500; color: color-mix(in oklab, var(--lj-se-fg) 75%, transparent); }
|
|
342
359
|
.lj-se-tocitem-icon { flex-shrink: 0; }
|
|
343
360
|
.lj-se-tocitem-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
344
361
|
.lj-se-tocitem-meta { flex-shrink: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--lj-se-muted-fg); }
|
|
@@ -438,6 +455,35 @@
|
|
|
438
455
|
.lj-se-actiondiff-accept { color: oklch(0.5 0.15 150); }
|
|
439
456
|
.lj-se-actiondiff-accept:hover { background: color-mix(in oklab, oklch(0.62 0.15 150) 16%, transparent); }
|
|
440
457
|
|
|
458
|
+
/* ── range highlight (host-controlled, per action; same wrapper-class layer as
|
|
459
|
+
diff tints so the two can stack) ──────────────────────────────────────── */
|
|
460
|
+
.lj-se-action-slot.lj-se-hl > .lj-se-row { background: var(--lj-se-hl-bg); border-radius: 6px; }
|
|
461
|
+
|
|
462
|
+
/* ── timestamp: a small MM:SS chip pinned to the row's TOP-RIGHT corner. Sits
|
|
463
|
+
in the row's reserved right padding, away from the left drag handle, so it
|
|
464
|
+
never collides with edit affordances. Subtle by default; host-overridable via
|
|
465
|
+
--lj-se-ts-fg. ──────────────────────────────────────────────────────────── */
|
|
466
|
+
.lj-se-ts {
|
|
467
|
+
position: absolute; right: 8px; top: 4px; z-index: 2;
|
|
468
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
469
|
+
font-size: 10.5px; line-height: 1; letter-spacing: 0.02em;
|
|
470
|
+
color: var(--lj-se-ts-fg); opacity: 0.6;
|
|
471
|
+
padding: 2px 5px; border-radius: 4px;
|
|
472
|
+
background: color-mix(in oklab, var(--lj-se-paper-fg) 6%, transparent);
|
|
473
|
+
user-select: none; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums;
|
|
474
|
+
}
|
|
475
|
+
/* Asian (compact inline) rows are short & left-aligned, so a right-corner chip
|
|
476
|
+
floats far from the text. Move the timestamp to a left gutter hugging the
|
|
477
|
+
line, and indent the row to make room. The drag handle lives OUTSIDE the row
|
|
478
|
+
(left:-34px), so a row-internal left gutter never collides with it. */
|
|
479
|
+
.lj-se-actions.has-ts .lj-se-action-slot:has(.lj-se-row--asian) > .lj-se-ts {
|
|
480
|
+
left: 4px; right: auto; top: 50%; transform: translateY(-50%);
|
|
481
|
+
padding: 1px 4px; background: transparent; opacity: 0.5;
|
|
482
|
+
}
|
|
483
|
+
.lj-se-actions.has-ts .lj-se-action-slot:has(.lj-se-row--asian) > .lj-se-row--asian {
|
|
484
|
+
padding-left: 52px;
|
|
485
|
+
}
|
|
486
|
+
|
|
441
487
|
/* ── Worldview view ──────────────────────────────────────────────────── */
|
|
442
488
|
.lj-se-worldview { height: 100%; overflow-y: auto; padding: 24px; }
|
|
443
489
|
.lj-se-worldview, .lj-se-entity { max-width: 760px; margin: 0 auto; width: 100%; }
|
|
@@ -477,10 +523,15 @@
|
|
|
477
523
|
.lj-se-stream { height: 100%; }
|
|
478
524
|
.lj-se-stream-empty { padding: 48px; text-align: center; color: var(--lj-se-muted-fg); }
|
|
479
525
|
.lj-se-stream-row { display: flex; justify-content: center; padding: 0 24px; }
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
526
|
+
/* Layout box (width / centering / inner padding / segment margins) is shared by
|
|
527
|
+
BOTH surfaces — it's independent of the parchment look. Paper adds the texture
|
|
528
|
+
& border/shadow on top; plain keeps the same box, flat. Keeping these on both
|
|
529
|
+
avoids the "no-paper" content spilling to the edge / misaligning across segs. */
|
|
530
|
+
.lj-se-stream-row .lj-se-paper-seg,
|
|
531
|
+
.lj-se-stream-row .lj-se-plain-seg { width: 100%; max-width: var(--lj-se-content-width); padding: 8px 48px; }
|
|
532
|
+
.lj-se-paper-seg.is-start, .lj-se-plain-seg.is-start { margin-top: 16px; padding-top: 32px; }
|
|
533
|
+
.lj-se-paper-seg.is-end, .lj-se-plain-seg.is-end { margin-bottom: 16px; padding-bottom: 40px; }
|
|
534
|
+
.lj-se-paper-seg.is-sole, .lj-se-plain-seg.is-sole { margin: 16px 0; padding-top: 32px; padding-bottom: 40px; }
|
|
484
535
|
.lj-se-paper-seg.is-changed { box-shadow: inset 3px 0 0 0 oklch(0.7 0.16 70); }
|
|
485
536
|
.lj-se-ep-banner { display: flex; align-items: baseline; gap: 12px; justify-content: center; padding: 16px 24px 6px; background: var(--lj-se-bg); }
|
|
486
537
|
.lj-se-ep-banner-title { font-weight: 700; font-size: 15px; }
|
|
@@ -632,12 +683,12 @@
|
|
|
632
683
|
|
|
633
684
|
/* ── Asset group header ──────────────────────────────────────────────── */
|
|
634
685
|
.lj-se-assetgroup-head { display: flex; justify-content: center; padding: 24px 24px 8px; }
|
|
635
|
-
.lj-se-assetgroup-title { width: 100%; max-width:
|
|
686
|
+
.lj-se-assetgroup-title { width: 100%; max-width: var(--lj-se-content-width); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--lj-se-fg); border-bottom: 1px solid var(--lj-se-border); padding-bottom: 6px; }
|
|
636
687
|
|
|
637
688
|
/* ── Asset card ──────────────────────────────────────────────────────── */
|
|
638
689
|
.lj-se-assetcard-row { display: flex; justify-content: center; padding: 6px 24px; }
|
|
639
|
-
.lj-se-assetcard { width: 100%; max-width:
|
|
640
|
-
.lj-se-assetcard-missing { width: 100%; max-width:
|
|
690
|
+
.lj-se-assetcard { width: 100%; max-width: var(--lj-se-content-width); position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--lj-se-border); background: var(--lj-se-card); box-shadow: 0 1px 2px oklch(0 0 0 / 0.04); padding: 16px 20px; }
|
|
691
|
+
.lj-se-assetcard-missing { width: 100%; max-width: var(--lj-se-content-width); border: 1px dashed var(--lj-se-border); border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--lj-se-muted-fg); }
|
|
641
692
|
.lj-se-assetcard-head { display: flex; align-items: baseline; gap: 8px; }
|
|
642
693
|
.lj-se-assetcard-name { font-size: 18px; font-weight: 600; color: var(--lj-se-fg); }
|
|
643
694
|
.lj-se-assetcard-id { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; color: var(--lj-se-muted-fg); }
|
|
@@ -661,6 +712,8 @@
|
|
|
661
712
|
.lj-se-assetcard-state { border: 1px solid var(--lj-se-border); border-radius: 8px; padding: 8px 10px; background: color-mix(in oklab, var(--lj-se-muted) 30%, transparent); }
|
|
662
713
|
.lj-se-assetcard-state-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
|
|
663
714
|
.lj-se-assetcard-state-name { font-size: 13px; font-weight: 600; }
|
|
715
|
+
/* 状态 id 徽章:紧跟状态名,margin-right:auto 把删除按钮推到右侧。 */
|
|
716
|
+
.lj-se-assetcard-state-id { margin-right: auto; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10.5px; color: var(--lj-se-muted-fg); }
|
|
664
717
|
.lj-se-assetcard-state-desc { display: block; margin-top: 2px; font-size: 12px; color: var(--lj-se-muted-fg); min-height: 1.2em; }
|
|
665
718
|
.lj-se-assetcard-state-del { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 6px; color: var(--lj-se-muted-fg); cursor: pointer; }
|
|
666
719
|
.lj-se-assetcard-state-del:hover { background: color-mix(in oklab, var(--lj-se-destructive) 10%, transparent); color: var(--lj-se-destructive); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/script-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Pure, business-decoupled screenplay (剧本) editor: value:ScriptProject + onEdit(patch); dual-format (standard/asian), virtualized single-stream, click-to-edit; bundled CSS, business injected via adapters.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|