@lingjingai/script-editor 0.1.18 → 0.1.19

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/INTEGRATION.md CHANGED
@@ -178,7 +178,8 @@ function Host({ script, onEdit }) {
178
178
  ```
179
179
 
180
180
  `buildScriptNav(value): ScriptNav` 返回:
181
- - `worldview` / `episodes[]` / `actors[]` / `locations[]` / `props[]`,`episodes[].scenes[]` 内嵌。
181
+ - `episodes[]` / `actors[]` / `locations[]` / `props[]`,`episodes[].scenes[]` 内嵌。
182
+ (**0.1.19 起**:世界观 & 风格的显示与编辑暂时下线——不再有内联区块,也不再是导航节点;宿主无需在目录里渲染它。`WorldviewEditor` 组件保留但未接线,后续恢复时可直接复用。)
182
183
  - 每个节点都带 **`key`**(= `selectionTargetKey(node.selection)`,拿去和 `selectionTargetKey(当前selection)` 比对即判激活)和 **`selection`**(即用型 `StudioSelection`,**不带 origin**;点击时 `withOrigin(node.selection, "sidebar")` 再喂 `onSelectionChange`)。
183
184
  - 标签字段(`label`/`title`/`meta`/`name`)与内置目录**同 helper 派生**,长相一致。
184
185
 
package/dist/index.d.ts CHANGED
@@ -565,11 +565,6 @@ interface ScriptNavEntity {
565
565
  selection: StudioSelection;
566
566
  }
567
567
  interface ScriptNav {
568
- worldview: {
569
- key: string;
570
- label: string;
571
- selection: StudioSelection;
572
- };
573
568
  episodes: ScriptNavEpisode[];
574
569
  actors: ScriptNavEntity[];
575
570
  locations: ScriptNavEntity[];
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createContext, memo, useState, useMemo, useCallback, Fragment, useRef, useContext, useEffect, useLayoutEffect, useDeferredValue } from 'react';
2
- import { Plus, Trash2, X, Check, Eraser, ArrowUp, ArrowDown, GripVertical, MessageCircle, Film, Brain, BookOpen, Scissors, ArrowUpToLine, Globe, BookText, ChevronRight, FileText, Users, MapPin, Package, Undo2, Redo2, MessageSquareQuote, ArrowLeft, ChevronLeft, Loader2, AlertCircle } from 'lucide-react';
2
+ import { Plus, Trash2, X, Check, Eraser, ArrowUp, ArrowDown, GripVertical, MessageCircle, Film, Brain, BookOpen, Scissors, ArrowUpToLine, BookText, ChevronRight, FileText, Users, MapPin, Package, Undo2, Redo2, MessageSquareQuote, ArrowLeft, ChevronLeft, Loader2, AlertCircle } from 'lucide-react';
3
3
  import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
4
4
  import { Virtuoso } from 'react-virtuoso';
5
5
  import { createPortal } from 'react-dom';
@@ -479,18 +479,6 @@ function StudioToc({
479
479
  const pick = (sel) => onSelect(withOrigin(sel, "sidebar"));
480
480
  const epHighlighted = selection.kind === "episode" || selection.kind === "scene" || selection.kind === "clip";
481
481
  return /* @__PURE__ */ jsxs("nav", { className: "lj-se-toc", children: [
482
- /* @__PURE__ */ jsxs(
483
- "button",
484
- {
485
- type: "button",
486
- className: cn("lj-se-tocitem lj-se-toc-l0", selection.kind === "worldview" && "is-active"),
487
- onClick: () => pick({ kind: "worldview" }),
488
- children: [
489
- /* @__PURE__ */ jsx(Globe, { className: "lj-se-tocitem-icon lj-se-ic-4", strokeWidth: 1.5 }),
490
- /* @__PURE__ */ jsx("span", { className: "lj-se-tocitem-label", children: "\u4E16\u754C\u89C2 & \u98CE\u683C" })
491
- ]
492
- }
493
- ),
494
482
  /* @__PURE__ */ jsx(
495
483
  GroupHeader,
496
484
  {
@@ -2602,82 +2590,6 @@ function SceneEditorImpl({
2602
2590
  ] });
2603
2591
  }
2604
2592
  var SceneEditor = memo(SceneEditorImpl);
2605
- function Stat({ label, value }) {
2606
- return /* @__PURE__ */ jsxs("div", { className: "lj-se-stat", children: [
2607
- /* @__PURE__ */ jsx("span", { className: "lj-se-stat-label", children: label }),
2608
- /* @__PURE__ */ jsx("span", { className: "lj-se-stat-value", children: value })
2609
- ] });
2610
- }
2611
- function WorldviewEditor({
2612
- data,
2613
- disabled = false,
2614
- onEdit
2615
- }) {
2616
- const episodes = data.episodes ?? [];
2617
- const totalScenes = episodes.reduce((sum, ep) => sum + (ep.scenes?.length ?? 0), 0);
2618
- const totalLines = episodes.reduce(
2619
- (sum, ep) => sum + (ep.scenes ?? []).reduce((s, sc) => s + (sc.actions?.length ?? 0), 0),
2620
- 0
2621
- );
2622
- return /* @__PURE__ */ jsxs("div", { className: "lj-se-worldview lj-se-scroll", children: [
2623
- /* @__PURE__ */ jsxs("header", { className: "lj-se-wv-header", children: [
2624
- /* @__PURE__ */ jsx("div", { className: "lj-se-wv-kicker", children: "\u5267\u672C \xB7 \u9876\u5C42" }),
2625
- /* @__PURE__ */ jsx("h2", { className: "lj-se-wv-title", children: "\u4E16\u754C\u89C2 & \u98CE\u683C" }),
2626
- /* @__PURE__ */ jsx("p", { className: "lj-se-wv-sub", children: "\u6539\u52A8\u4F1A\u5F71\u54CD\u4E0B\u6E38\u8D44\u4EA7\u751F\u6210\u7684 prompt\uFF1B\u6539\u5B8C\u540E\u53EF\u8BA9 AI \u540C\u6B65\u66F4\u65B0\u4EBA\u8BBE / \u573A\u666F\u3002" })
2627
- ] }),
2628
- /* @__PURE__ */ jsxs("section", { className: "lj-se-stats", children: [
2629
- /* @__PURE__ */ jsx(Stat, { label: "\u96C6\u6570", value: episodes.length }),
2630
- /* @__PURE__ */ jsx(Stat, { label: "\u573A\u666F", value: totalScenes }),
2631
- /* @__PURE__ */ jsx(Stat, { label: "\u53F0\u8BCD", value: totalLines }),
2632
- /* @__PURE__ */ jsx(Stat, { label: "\u89D2\u8272", value: data.actors?.length ?? 0 }),
2633
- /* @__PURE__ */ jsx(Stat, { label: "\u9053\u5177", value: data.props?.length ?? 0 })
2634
- ] }),
2635
- /* @__PURE__ */ jsxs("div", { className: "lj-se-field", children: [
2636
- /* @__PURE__ */ jsx("div", { className: "lj-se-field-label", children: "\u6807\u9898" }),
2637
- /* @__PURE__ */ jsx("div", { className: "lj-se-field-box", children: /* @__PURE__ */ jsx(
2638
- EditableText,
2639
- {
2640
- value: data.title ?? "",
2641
- disabled,
2642
- placeholder: "\u672A\u547D\u540D\u5267\u672C",
2643
- onSave: (v) => onEdit((p) => ({ ...p, title: v }))
2644
- }
2645
- ) })
2646
- ] }),
2647
- /* @__PURE__ */ jsxs("div", { className: "lj-se-field", children: [
2648
- /* @__PURE__ */ jsxs("div", { className: "lj-se-field-label", children: [
2649
- "\u4E16\u754C\u89C2 ",
2650
- /* @__PURE__ */ jsx("span", { className: "lj-se-field-hint", children: "\u591A\u884C\uFF1BAI \u5199\u5267\u672C\u65F6\u4F1A\u5F15\u7528" })
2651
- ] }),
2652
- /* @__PURE__ */ jsx("div", { className: "lj-se-field-box", children: /* @__PURE__ */ jsx(
2653
- EditableText,
2654
- {
2655
- multiline: true,
2656
- value: data.worldview ?? "",
2657
- disabled,
2658
- placeholder: "\u63CF\u8FF0\u6545\u4E8B\u53D1\u751F\u7684\u4E16\u754C\u3001\u80CC\u666F\u8BBE\u5B9A\u2026",
2659
- onSave: (v) => onEdit((p) => ({ ...p, worldview: v }))
2660
- }
2661
- ) })
2662
- ] }),
2663
- /* @__PURE__ */ jsxs("div", { className: "lj-se-field", children: [
2664
- /* @__PURE__ */ jsxs("div", { className: "lj-se-field-label", children: [
2665
- "\u98CE\u683C ",
2666
- /* @__PURE__ */ jsx("span", { className: "lj-se-field-hint", children: "\u8BED\u8A00\u8C03\u6027 / \u955C\u5934\u8BED\u8A00\u503E\u5411" })
2667
- ] }),
2668
- /* @__PURE__ */ jsx("div", { className: "lj-se-field-box", children: /* @__PURE__ */ jsx(
2669
- EditableText,
2670
- {
2671
- multiline: true,
2672
- value: data.style ?? "",
2673
- disabled,
2674
- placeholder: "\u4F8B\u5982\uFF1A\u5199\u5B9E\u3001\u51B7\u5CFB\u3001\u957F\u955C\u5934\u2026",
2675
- onSave: (v) => onEdit((p) => ({ ...p, style: v }))
2676
- }
2677
- ) })
2678
- ] })
2679
- ] });
2680
- }
2681
2593
 
2682
2594
  // src/stream/flat-items.ts
2683
2595
  var SCENE_KEY = (e, s) => `ep:${e}:sc:${s}`;
@@ -2704,7 +2616,6 @@ function buildFlatStream(data) {
2704
2616
  if (item.kind === "asset-card") assetIndexLookup.set(ASSET_KEY(item.group, item.assetId), items.length);
2705
2617
  items.push(item);
2706
2618
  };
2707
- push({ key: "worldview", kind: "worldview" });
2708
2619
  if (!data) {
2709
2620
  return { items, indexByKey, sceneIndexLookup, sceneIdLookup, assetIndexLookup, paperStartKey: null, paperEndKey: null };
2710
2621
  }
@@ -2751,8 +2662,6 @@ function buildFlatStream(data) {
2751
2662
  }
2752
2663
  function selectionToFlatIndex(stream, sel) {
2753
2664
  switch (sel.kind) {
2754
- case "worldview":
2755
- return stream.indexByKey.get("worldview") ?? null;
2756
2665
  case "episode":
2757
2666
  return stream.indexByKey.get(`ep:${sel.episodeIdx}:header`) ?? null;
2758
2667
  case "scene":
@@ -2779,8 +2688,6 @@ function flatIndexToSelection(stream, idx) {
2779
2688
  const item = stream.items[idx];
2780
2689
  if (!item) return null;
2781
2690
  switch (item.kind) {
2782
- case "worldview":
2783
- return { kind: "worldview" };
2784
2691
  case "episode-header":
2785
2692
  return { kind: "episode", episodeIdx: item.episodeIdx };
2786
2693
  case "scene":
@@ -3402,8 +3309,6 @@ function ScriptStream({
3402
3309
  itemContent: (_index, item) => {
3403
3310
  if (!item) return null;
3404
3311
  switch (item.kind) {
3405
- case "worldview":
3406
- return /* @__PURE__ */ jsx("div", { className: "lj-se-stream-worldview", children: /* @__PURE__ */ jsx(WorldviewEditor, { data: value, disabled, onEdit }) });
3407
3312
  case "episode-header": {
3408
3313
  const episode = value.episodes?.[item.episodeIdx];
3409
3314
  if (!episode) return null;
@@ -4299,7 +4204,6 @@ function buildScriptNav(value) {
4299
4204
  return { ...nav({ kind: "prop", propId: id }), id, name: getPropDisplayName(p) };
4300
4205
  }).filter((e) => e.id);
4301
4206
  return {
4302
- worldview: { ...nav({ kind: "worldview" }), label: "\u4E16\u754C\u89C2 & \u98CE\u683C" },
4303
4207
  episodes,
4304
4208
  actors,
4305
4209
  locations,