lecodes-cli 0.18.1 → 0.19.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.
@@ -52,6 +52,15 @@ export type EditorApi = {
52
52
  raycast(screenX: number, screenY: number): EditorRayHit | null
53
53
  /** Group every doc edit inside `fn` into ONE undo step. */
54
54
  transact(fn: () => void): void
55
+ /** Read one def prop of a node as document data (`asset()` refs come as `{ $asset: "./x" }`);
56
+ * undefined when the node or key doesn't exist. */
57
+ getProp(path: string, key: string): unknown
58
+ /** Write a BINARY asset file for a node (a terrain's `.terrain`, a baked mask…). `ref` = the
59
+ * node's existing def-relative `asset()` ref to overwrite, or null to create `./<name>` at the
60
+ * project root (a free name is picked on collisions). Resolves to the ref to store in the node's
61
+ * def (`{ $asset: ref }` via `setProp`), null when the host can't write files. Not a doc edit —
62
+ * it is not undoable; keep the doc pointing at the file. */
63
+ writeAsset(path: string, ref: string | null, name: string, bytes: Uint8Array): Promise<string | null>
55
64
  }
56
65
 
57
66
  export type EditorWindowFn = (ui: InspectorUI, editor: EditorApi) => void
@@ -65,6 +74,15 @@ export type EditorToolHooks = {
65
74
  /** A viewport click while the tool is active — `hit` is the raycast result under the pointer.
66
75
  * Viewport clicks route to the tool while it is active. */
67
76
  onViewportClick?(hit: EditorRayHit, editor: EditorApi): void
77
+ /** Drag tools (brushes): a primary-button drag in the viewport routes here instead of orbiting
78
+ * the camera — start / every pointer move (with the hit under it, null while off-world) /
79
+ * release. A tool with `onDragStart` gets NO `onViewportClick` for the same gesture. */
80
+ onDragStart?(hit: EditorRayHit, editor: EditorApi): void
81
+ onDrag?(hit: EditorRayHit | null, editor: EditorApi): void
82
+ onDragEnd?(editor: EditorApi): void
83
+ /** The pointer moved over the viewport with no button down (throttled to the frame) — draw a
84
+ * brush cursor through `Gizmos`; null when nothing is under it. */
85
+ onHover?(hit: EditorRayHit | null, editor: EditorApi): void
68
86
  }
69
87
 
70
88
  /** @internal The registry the scene-editor harness reads (windows/tools in registration order). */
@@ -26,6 +26,10 @@ export type Color = number | string | null
26
26
  export type BaseStyle = {
27
27
  opacity?: number | `${number}`,
28
28
  transform?: string | null,
29
+ /** Pivot of `transform` (CSS `transform-origin` subset): one or two values, each a keyword
30
+ * (`left`/`center`/`right`, `top`/`center`/`bottom`), a percentage of the box, or a px length
31
+ * (bare numbers are px). One value sets x, y stays `50%`. Default `"50% 50%"` = the centre. */
32
+ transformOrigin?: string | null,
29
33
  backgroundColor?: Color | null,
30
34
  bgColor?: Color | null,
31
35
  overflow?: "visible" | "hidden",