@jxsuite/studio 0.8.0 → 0.10.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.
package/src/state.js CHANGED
@@ -29,6 +29,7 @@
29
29
  * mode: string;
30
30
  * content: { frontmatter: Record<string, any> };
31
31
  * ui: Record<string, any>;
32
+ * canvas: { status: string; scope: any; error: string | null };
32
33
  * }} StudioState
33
34
  */
34
35
 
@@ -234,6 +235,12 @@ export function createState(doc) {
234
235
  gitCommitMessage: "", // commit message input
235
236
  gitLoading: false, // loading indicator during async ops
236
237
  gitError: null, // error message string
238
+ pendingInlineEdit: null, // null | { path, mediaName } — deferred inline edit awaiting canvas readiness
239
+ },
240
+ canvas: {
241
+ status: "idle", // "idle" | "loading" | "ready" | "error"
242
+ scope: null, // $defs scope from runtime buildScope
243
+ error: null, // error message on failure
237
244
  },
238
245
  };
239
246
  }
@@ -272,6 +279,7 @@ export function fromFlat(S) {
272
279
  selection,
273
280
  hover,
274
281
  ui,
282
+ canvas,
275
283
  } = S;
276
284
  return {
277
285
  doc: {
@@ -286,7 +294,7 @@ export function fromFlat(S) {
286
294
  history,
287
295
  historyIndex,
288
296
  },
289
- session: { selection, hover, ui },
297
+ session: { selection, hover, ui, canvas },
290
298
  };
291
299
  }
292
300
 
package/src/store.js CHANGED
@@ -324,6 +324,15 @@ export function updateUi(field, value) {
324
324
  _updateSessionFn({ ui: { [field]: value } });
325
325
  }
326
326
 
327
+ /**
328
+ * Update the canvas async state (status, scope, error).
329
+ *
330
+ * @param {any} patch
331
+ */
332
+ export function updateCanvas(patch) {
333
+ _updateSessionFn({ canvas: patch });
334
+ }
335
+
327
336
  // ─── Subscription system ────────────────────────────────────────────────────
328
337
  // Panels subscribe to state changes and decide when to re-render, rather than
329
338
  // being called unconditionally from _update/_updateSession.