@lace-cloud/canvas 0.29.0 → 0.30.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/{AccordionSection-J3ALHB5M.css → AccordionSection-5X2XWUYY.css} +9 -2
- package/dist/BadgeRow-KVODWDQK.css +23 -0
- package/dist/{ContextMenu-C7SLX23S.css → ContextMenu-S3JIZMET.css} +11 -0
- package/dist/{DiagnosticsPanel-T6VDHH4A.css → DiagnosticsPanel-MSK72CGM.css} +3 -1
- package/dist/{GroupNode-QWSLBFCH.css → GroupNode-FXLQCVAE.css} +0 -38
- package/dist/{ModuleConfigPanel-ZMWRMN5N.css → ModuleConfigPanel-DW3RSOEL.css} +6 -0
- package/dist/{ModuleNode-RRZ37SFM.css → ModuleNode-PPAN7NLP.css} +15 -37
- package/dist/{chunk-ASG36ZXQ.mjs → chunk-A3ATETIA.mjs} +172 -25
- package/dist/chunk-A3ATETIA.mjs.map +1 -0
- package/dist/engine/index.cjs +161 -23
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.mts +2 -2
- package/dist/engine/index.d.ts +2 -2
- package/dist/engine/index.mjs +5 -1
- package/dist/index.cjs +1787 -1590
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +15 -23
- package/dist/index.d.ts +15 -23
- package/dist/index.mjs +1385 -1325
- package/dist/index.mjs.map +1 -1
- package/dist/{panels-shared-5JFNYXQ7.css → panels-shared-3HUQC7TC.css} +20 -2
- package/dist/{registry-CuZ4kEQJ.d.mts → registry-C8fUGD44.d.mts} +50 -20
- package/dist/{registry-CuZ4kEQJ.d.ts → registry-C8fUGD44.d.ts} +50 -20
- package/package.json +3 -3
- package/dist/chunk-ASG36ZXQ.mjs.map +0 -1
package/dist/engine/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(engine_exports, {
|
|
|
29
29
|
CommandUnobservedError: () => CommandUnobservedError,
|
|
30
30
|
ConnectError: () => ConnectError,
|
|
31
31
|
EMPTY_REPORT_FOLD: () => EMPTY_REPORT_FOLD,
|
|
32
|
+
GENERATE_STAGES: () => GENERATE_STAGES,
|
|
32
33
|
InputMode: () => InputMode,
|
|
33
34
|
Reason: () => Reason,
|
|
34
35
|
SCHEMAS: () => SCHEMAS,
|
|
@@ -46,6 +47,7 @@ __export(engine_exports, {
|
|
|
46
47
|
diagnosticsOfDocument: () => diagnosticsOfDocument,
|
|
47
48
|
failureSays: () => failureSays,
|
|
48
49
|
foldReport: () => foldReport,
|
|
50
|
+
generatedTree: () => generatedTree,
|
|
49
51
|
isBoundPath: () => isBoundPath,
|
|
50
52
|
liveSlots: () => liveSlots,
|
|
51
53
|
openEngineCommands: () => openEngineCommands,
|
|
@@ -4492,13 +4494,19 @@ var SessionGenerateRequest = {
|
|
|
4492
4494
|
}
|
|
4493
4495
|
};
|
|
4494
4496
|
function createBaseSessionGenerateResponse() {
|
|
4495
|
-
return { files_written: [], validate_json: "", revision: 0 };
|
|
4497
|
+
return { files_written: [], files_changed: [], files_removed: [], validate_json: "", revision: 0 };
|
|
4496
4498
|
}
|
|
4497
4499
|
var SessionGenerateResponse = {
|
|
4498
4500
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4499
4501
|
for (const v of message.files_written) {
|
|
4500
4502
|
writer.uint32(10).string(v);
|
|
4501
4503
|
}
|
|
4504
|
+
for (const v of message.files_changed) {
|
|
4505
|
+
writer.uint32(50).string(v);
|
|
4506
|
+
}
|
|
4507
|
+
for (const v of message.files_removed) {
|
|
4508
|
+
writer.uint32(58).string(v);
|
|
4509
|
+
}
|
|
4502
4510
|
if (message.validate_json !== "") {
|
|
4503
4511
|
writer.uint32(34).string(message.validate_json);
|
|
4504
4512
|
}
|
|
@@ -4521,6 +4529,20 @@ var SessionGenerateResponse = {
|
|
|
4521
4529
|
message.files_written.push(reader.string());
|
|
4522
4530
|
continue;
|
|
4523
4531
|
}
|
|
4532
|
+
case 6: {
|
|
4533
|
+
if (tag !== 50) {
|
|
4534
|
+
break;
|
|
4535
|
+
}
|
|
4536
|
+
message.files_changed.push(reader.string());
|
|
4537
|
+
continue;
|
|
4538
|
+
}
|
|
4539
|
+
case 7: {
|
|
4540
|
+
if (tag !== 58) {
|
|
4541
|
+
break;
|
|
4542
|
+
}
|
|
4543
|
+
message.files_removed.push(reader.string());
|
|
4544
|
+
continue;
|
|
4545
|
+
}
|
|
4524
4546
|
case 4: {
|
|
4525
4547
|
if (tag !== 34) {
|
|
4526
4548
|
break;
|
|
@@ -4546,6 +4568,8 @@ var SessionGenerateResponse = {
|
|
|
4546
4568
|
fromJSON(object) {
|
|
4547
4569
|
return {
|
|
4548
4570
|
files_written: globalThis.Array.isArray(object?.filesWritten) ? object.filesWritten.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.files_written) ? object.files_written.map((e) => globalThis.String(e)) : [],
|
|
4571
|
+
files_changed: globalThis.Array.isArray(object?.filesChanged) ? object.filesChanged.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.files_changed) ? object.files_changed.map((e) => globalThis.String(e)) : [],
|
|
4572
|
+
files_removed: globalThis.Array.isArray(object?.filesRemoved) ? object.filesRemoved.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.files_removed) ? object.files_removed.map((e) => globalThis.String(e)) : [],
|
|
4549
4573
|
validate_json: isSet3(object.validateJson) ? globalThis.String(object.validateJson) : isSet3(object.validate_json) ? globalThis.String(object.validate_json) : "",
|
|
4550
4574
|
revision: isSet3(object.revision) ? globalThis.Number(object.revision) : 0
|
|
4551
4575
|
};
|
|
@@ -4555,6 +4579,12 @@ var SessionGenerateResponse = {
|
|
|
4555
4579
|
if (message.files_written?.length) {
|
|
4556
4580
|
obj.filesWritten = message.files_written;
|
|
4557
4581
|
}
|
|
4582
|
+
if (message.files_changed?.length) {
|
|
4583
|
+
obj.filesChanged = message.files_changed;
|
|
4584
|
+
}
|
|
4585
|
+
if (message.files_removed?.length) {
|
|
4586
|
+
obj.filesRemoved = message.files_removed;
|
|
4587
|
+
}
|
|
4558
4588
|
if (message.validate_json !== "") {
|
|
4559
4589
|
obj.validateJson = message.validate_json;
|
|
4560
4590
|
}
|
|
@@ -4569,6 +4599,8 @@ var SessionGenerateResponse = {
|
|
|
4569
4599
|
fromPartial(object) {
|
|
4570
4600
|
const message = createBaseSessionGenerateResponse();
|
|
4571
4601
|
message.files_written = object.files_written?.map((e) => e) || [];
|
|
4602
|
+
message.files_changed = object.files_changed?.map((e) => e) || [];
|
|
4603
|
+
message.files_removed = object.files_removed?.map((e) => e) || [];
|
|
4572
4604
|
message.validate_json = object.validate_json ?? "";
|
|
4573
4605
|
message.revision = object.revision ?? 0;
|
|
4574
4606
|
return message;
|
|
@@ -8489,13 +8521,19 @@ var GenerateProgress = {
|
|
|
8489
8521
|
}
|
|
8490
8522
|
};
|
|
8491
8523
|
function createBaseGenerateSuccess() {
|
|
8492
|
-
return { files_written: [], validate_json: "", generate_id: "" };
|
|
8524
|
+
return { files_written: [], files_changed: [], files_removed: [], validate_json: "", generate_id: "" };
|
|
8493
8525
|
}
|
|
8494
8526
|
var GenerateSuccess = {
|
|
8495
8527
|
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
8496
8528
|
for (const v of message.files_written) {
|
|
8497
8529
|
writer.uint32(10).string(v);
|
|
8498
8530
|
}
|
|
8531
|
+
for (const v of message.files_changed) {
|
|
8532
|
+
writer.uint32(42).string(v);
|
|
8533
|
+
}
|
|
8534
|
+
for (const v of message.files_removed) {
|
|
8535
|
+
writer.uint32(50).string(v);
|
|
8536
|
+
}
|
|
8499
8537
|
if (message.validate_json !== "") {
|
|
8500
8538
|
writer.uint32(26).string(message.validate_json);
|
|
8501
8539
|
}
|
|
@@ -8518,6 +8556,20 @@ var GenerateSuccess = {
|
|
|
8518
8556
|
message.files_written.push(reader.string());
|
|
8519
8557
|
continue;
|
|
8520
8558
|
}
|
|
8559
|
+
case 5: {
|
|
8560
|
+
if (tag !== 42) {
|
|
8561
|
+
break;
|
|
8562
|
+
}
|
|
8563
|
+
message.files_changed.push(reader.string());
|
|
8564
|
+
continue;
|
|
8565
|
+
}
|
|
8566
|
+
case 6: {
|
|
8567
|
+
if (tag !== 50) {
|
|
8568
|
+
break;
|
|
8569
|
+
}
|
|
8570
|
+
message.files_removed.push(reader.string());
|
|
8571
|
+
continue;
|
|
8572
|
+
}
|
|
8521
8573
|
case 3: {
|
|
8522
8574
|
if (tag !== 26) {
|
|
8523
8575
|
break;
|
|
@@ -8543,6 +8595,8 @@ var GenerateSuccess = {
|
|
|
8543
8595
|
fromJSON(object) {
|
|
8544
8596
|
return {
|
|
8545
8597
|
files_written: globalThis.Array.isArray(object?.filesWritten) ? object.filesWritten.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.files_written) ? object.files_written.map((e) => globalThis.String(e)) : [],
|
|
8598
|
+
files_changed: globalThis.Array.isArray(object?.filesChanged) ? object.filesChanged.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.files_changed) ? object.files_changed.map((e) => globalThis.String(e)) : [],
|
|
8599
|
+
files_removed: globalThis.Array.isArray(object?.filesRemoved) ? object.filesRemoved.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.files_removed) ? object.files_removed.map((e) => globalThis.String(e)) : [],
|
|
8546
8600
|
validate_json: isSet3(object.validateJson) ? globalThis.String(object.validateJson) : isSet3(object.validate_json) ? globalThis.String(object.validate_json) : "",
|
|
8547
8601
|
generate_id: isSet3(object.generateId) ? globalThis.String(object.generateId) : isSet3(object.generate_id) ? globalThis.String(object.generate_id) : ""
|
|
8548
8602
|
};
|
|
@@ -8552,6 +8606,12 @@ var GenerateSuccess = {
|
|
|
8552
8606
|
if (message.files_written?.length) {
|
|
8553
8607
|
obj.filesWritten = message.files_written;
|
|
8554
8608
|
}
|
|
8609
|
+
if (message.files_changed?.length) {
|
|
8610
|
+
obj.filesChanged = message.files_changed;
|
|
8611
|
+
}
|
|
8612
|
+
if (message.files_removed?.length) {
|
|
8613
|
+
obj.filesRemoved = message.files_removed;
|
|
8614
|
+
}
|
|
8555
8615
|
if (message.validate_json !== "") {
|
|
8556
8616
|
obj.validateJson = message.validate_json;
|
|
8557
8617
|
}
|
|
@@ -8566,6 +8626,8 @@ var GenerateSuccess = {
|
|
|
8566
8626
|
fromPartial(object) {
|
|
8567
8627
|
const message = createBaseGenerateSuccess();
|
|
8568
8628
|
message.files_written = object.files_written?.map((e) => e) || [];
|
|
8629
|
+
message.files_changed = object.files_changed?.map((e) => e) || [];
|
|
8630
|
+
message.files_removed = object.files_removed?.map((e) => e) || [];
|
|
8569
8631
|
message.validate_json = object.validate_json ?? "";
|
|
8570
8632
|
message.generate_id = object.generate_id ?? "";
|
|
8571
8633
|
return message;
|
|
@@ -10518,6 +10580,22 @@ function isSet3(value) {
|
|
|
10518
10580
|
|
|
10519
10581
|
// src/ports.ts
|
|
10520
10582
|
var import_proto = require("@lace-cloud/proto");
|
|
10583
|
+
var GENERATE_STAGES = ["generating", "validating"];
|
|
10584
|
+
function isGenerateStage(stage) {
|
|
10585
|
+
return GENERATE_STAGES.some((known) => known === stage);
|
|
10586
|
+
}
|
|
10587
|
+
function generatedTree({
|
|
10588
|
+
written,
|
|
10589
|
+
changed,
|
|
10590
|
+
removed
|
|
10591
|
+
}) {
|
|
10592
|
+
return {
|
|
10593
|
+
changed,
|
|
10594
|
+
removed,
|
|
10595
|
+
unchanged: written.length - changed.length,
|
|
10596
|
+
treeChanged: changed.length > 0 || removed.length > 0
|
|
10597
|
+
};
|
|
10598
|
+
}
|
|
10521
10599
|
var ApplyUnobservedError = class extends Error {
|
|
10522
10600
|
constructor(end) {
|
|
10523
10601
|
super(`unobserved: the source stopped (${end.kind}) before the frame that carries the write`);
|
|
@@ -12987,6 +13065,7 @@ async function openEngineSession(caller, target, options = {}) {
|
|
|
12987
13065
|
const progressListeners = /* @__PURE__ */ new Set();
|
|
12988
13066
|
const ownGenerates = /* @__PURE__ */ new Set();
|
|
12989
13067
|
let sessionGenerating = initialState.generating;
|
|
13068
|
+
let stage = "generating";
|
|
12990
13069
|
let currentSource = null;
|
|
12991
13070
|
let ended = null;
|
|
12992
13071
|
let deliveredRevision = initialState.revision;
|
|
@@ -12996,6 +13075,7 @@ async function openEngineSession(caller, target, options = {}) {
|
|
|
12996
13075
|
const published = state.bundle ?? import_proto2.EMPTY_BUNDLE;
|
|
12997
13076
|
const bundle = currentSource && deepEqual(currentSource.bundle, published) ? currentSource.bundle : published;
|
|
12998
13077
|
sessionGenerating = state.generating;
|
|
13078
|
+
if (!running()) stage = "generating";
|
|
12999
13079
|
currentSource = {
|
|
13000
13080
|
bundle,
|
|
13001
13081
|
canUndo: state.can_undo,
|
|
@@ -13017,16 +13097,27 @@ async function openEngineSession(caller, target, options = {}) {
|
|
|
13017
13097
|
}
|
|
13018
13098
|
}
|
|
13019
13099
|
adopt(initialState);
|
|
13020
|
-
function
|
|
13100
|
+
function running() {
|
|
13021
13101
|
return sessionGenerating || ownGenerates.size > 0;
|
|
13022
13102
|
}
|
|
13103
|
+
function generating() {
|
|
13104
|
+
return running() && stage;
|
|
13105
|
+
}
|
|
13106
|
+
function republishGenerating() {
|
|
13107
|
+
if (!currentSource || currentSource.generating === generating()) return;
|
|
13108
|
+
currentSource = { ...currentSource, generating: generating() };
|
|
13109
|
+
for (const listener of sourceListeners) deliver(listener, currentSource);
|
|
13110
|
+
}
|
|
13023
13111
|
function track(id, on) {
|
|
13024
|
-
const was = generating();
|
|
13025
13112
|
if (on) ownGenerates.add(id);
|
|
13026
13113
|
else ownGenerates.delete(id);
|
|
13027
|
-
if (!
|
|
13028
|
-
|
|
13029
|
-
|
|
13114
|
+
if (!running()) stage = "generating";
|
|
13115
|
+
republishGenerating();
|
|
13116
|
+
}
|
|
13117
|
+
function reached(next) {
|
|
13118
|
+
if (!running() || !isGenerateStage(next)) return;
|
|
13119
|
+
stage = next;
|
|
13120
|
+
republishGenerating();
|
|
13030
13121
|
}
|
|
13031
13122
|
function observed(revision) {
|
|
13032
13123
|
if (deliveredRevision >= revision) return Promise.resolve();
|
|
@@ -13072,6 +13163,7 @@ async function openEngineSession(caller, target, options = {}) {
|
|
|
13072
13163
|
continue;
|
|
13073
13164
|
}
|
|
13074
13165
|
if (event.generate_progress) {
|
|
13166
|
+
reached(event.generate_progress.stage);
|
|
13075
13167
|
for (const listener of progressListeners) listener(event.generate_progress);
|
|
13076
13168
|
}
|
|
13077
13169
|
}
|
|
@@ -13140,9 +13232,8 @@ async function openEngineSession(caller, target, options = {}) {
|
|
|
13140
13232
|
track(generateId, true);
|
|
13141
13233
|
const onProgress = (progress) => {
|
|
13142
13234
|
if (progress.generate_id !== generateId) return;
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
queue.push({ type: "progress", stage });
|
|
13235
|
+
if (isGenerateStage(progress.stage)) {
|
|
13236
|
+
queue.push({ type: "progress", stage: progress.stage });
|
|
13146
13237
|
}
|
|
13147
13238
|
};
|
|
13148
13239
|
progressListeners.add(onProgress);
|
|
@@ -13261,6 +13352,8 @@ function generated(response) {
|
|
|
13261
13352
|
return {
|
|
13262
13353
|
type: "success",
|
|
13263
13354
|
written: response.files_written,
|
|
13355
|
+
changed: response.files_changed,
|
|
13356
|
+
removed: response.files_removed,
|
|
13264
13357
|
validate: parseBound("module validate", JSON.parse(response.validate_json))
|
|
13265
13358
|
};
|
|
13266
13359
|
}
|
|
@@ -13710,6 +13803,10 @@ function didNotValidate(v) {
|
|
|
13710
13803
|
const why = whyNotValid(v);
|
|
13711
13804
|
return why === void 0 ? "The tree did not validate: fix it before you commit it." : `The tree did not validate: ${why}. Fix it before you commit it.`;
|
|
13712
13805
|
}
|
|
13806
|
+
function lockFailed(e) {
|
|
13807
|
+
return e.changed && e.lock === null;
|
|
13808
|
+
}
|
|
13809
|
+
var DID_NOT_LOCK = "The tree's providers did not lock: run `lace module lock` once the cause is fixed, before you commit it.";
|
|
13713
13810
|
function beside(v) {
|
|
13714
13811
|
return v.failure ? [v.failure] : [];
|
|
13715
13812
|
}
|
|
@@ -13805,11 +13902,15 @@ function importNotice(e) {
|
|
|
13805
13902
|
if (e.validate.exitClass !== "ok") {
|
|
13806
13903
|
return ["warn", `${imported} ${didNotValidate(e.validate)}`, ...beside(e.validate)];
|
|
13807
13904
|
}
|
|
13808
|
-
|
|
13809
|
-
|
|
13905
|
+
if (lockFailed(e)) return ["warn", `${imported} ${DID_NOT_LOCK}`];
|
|
13906
|
+
const adopts = e.importBlocks > 0;
|
|
13907
|
+
const next = adopts ? `, commit it, then apply ${slug} to adopt them` : " and commit it";
|
|
13908
|
+
const review = e.changed ? ` Review the change in git${next}.` : "";
|
|
13909
|
+
if (e.importResiduals.length === 0) return ["info", `${imported}${review}`];
|
|
13910
|
+
const unadopted = adopts ? "Not adopted" : "No resource was adopted";
|
|
13810
13911
|
return [
|
|
13811
13912
|
"warn",
|
|
13812
|
-
`${imported}${
|
|
13913
|
+
`${imported}${review} ${unadopted}: ${residualAddresses(e.importResiduals)}; supply their import ids before applying, or the apply creates them anew.`
|
|
13813
13914
|
];
|
|
13814
13915
|
}
|
|
13815
13916
|
var importResult = {
|
|
@@ -13841,8 +13942,11 @@ function validateNotice(v) {
|
|
|
13841
13942
|
}
|
|
13842
13943
|
function convertNotice(e) {
|
|
13843
13944
|
const converted = e.changed ? `Converted \u2014 ${e.written.length} file(s) written` : "Already lace-style \u2014 nothing to write";
|
|
13844
|
-
if (e.validate.exitClass
|
|
13845
|
-
|
|
13945
|
+
if (e.validate.exitClass !== "ok") {
|
|
13946
|
+
return ["warn", `${converted}. ${didNotValidate(e.validate)}`, ...beside(e.validate)];
|
|
13947
|
+
}
|
|
13948
|
+
if (lockFailed(e)) return ["warn", `${converted}. ${DID_NOT_LOCK}`];
|
|
13949
|
+
return ["info", converted];
|
|
13846
13950
|
}
|
|
13847
13951
|
var validate = defineCommand({
|
|
13848
13952
|
kind: "command",
|
|
@@ -14011,6 +14115,16 @@ var CORE_COMMAND_ACTIONS = [
|
|
|
14011
14115
|
...MODULE_COMMAND_ACTIONS
|
|
14012
14116
|
];
|
|
14013
14117
|
|
|
14118
|
+
// src/core/entry-scope.ts
|
|
14119
|
+
function entryScopeIds(view) {
|
|
14120
|
+
const nested = new Set(view.groups.flatMap((g) => g.node_ids));
|
|
14121
|
+
return [...view.nodes, ...view.groups].map((n) => n.id).filter((id) => !nested.has(id));
|
|
14122
|
+
}
|
|
14123
|
+
function inEntryScope(view, ids) {
|
|
14124
|
+
const entry = new Set(entryScopeIds(view));
|
|
14125
|
+
return ids.filter((id) => entry.has(id));
|
|
14126
|
+
}
|
|
14127
|
+
|
|
14014
14128
|
// src/registry.ts
|
|
14015
14129
|
var CONTEXT_NEEDS = {
|
|
14016
14130
|
root: "an authoring root",
|
|
@@ -14024,7 +14138,10 @@ var CONTEXT_NEEDS = {
|
|
|
14024
14138
|
sourceRefused: "the source-refused lock",
|
|
14025
14139
|
needsConversion: "a tree out of lace shape",
|
|
14026
14140
|
"selection.node": "a selected node",
|
|
14027
|
-
"selection.
|
|
14141
|
+
"selection.several": "two selected nodes or more",
|
|
14142
|
+
"selection.entryScope": "a selected top-level node or group",
|
|
14143
|
+
"selection.edge": "one selected connection",
|
|
14144
|
+
"selection.edges": "selected connections",
|
|
14028
14145
|
diagnostics: "diagnostics to show",
|
|
14029
14146
|
settingsOpen: "the settings panel open",
|
|
14030
14147
|
generateIdle: "no Generate running",
|
|
@@ -14050,6 +14167,10 @@ function runsOn(action, ctx, target) {
|
|
|
14050
14167
|
if (required.includes("root")) return `root:${ctx.root}`;
|
|
14051
14168
|
return "";
|
|
14052
14169
|
}
|
|
14170
|
+
function wiresAlone(ctx) {
|
|
14171
|
+
const selection = ctx.selection;
|
|
14172
|
+
return selection && selection.nodes.length === 0 ? selection.edges.length : 0;
|
|
14173
|
+
}
|
|
14053
14174
|
function keySatisfied(ctx, key) {
|
|
14054
14175
|
if (key === "editable") return ctx.editable === true;
|
|
14055
14176
|
if (key === "saved") return ctx.view?.unsaved === false;
|
|
@@ -14059,13 +14180,16 @@ function keySatisfied(ctx, key) {
|
|
|
14059
14180
|
if (key === "sourceRefused") return ctx.sourceRefused === true;
|
|
14060
14181
|
if (key === "needsConversion")
|
|
14061
14182
|
return ctx.sourceRefused === true && holdsLaceShapeRefusal(ctx.diagnostics ?? []);
|
|
14062
|
-
if (key === "selection.node")
|
|
14063
|
-
|
|
14064
|
-
if (key === "selection.
|
|
14183
|
+
if (key === "selection.node") return (ctx.selection?.nodes.length ?? 0) > 0;
|
|
14184
|
+
if (key === "selection.several") return (ctx.selection?.nodes.length ?? 0) > 1;
|
|
14185
|
+
if (key === "selection.entryScope")
|
|
14186
|
+
return ctx.view !== void 0 && ctx.selection !== void 0 && inEntryScope(ctx.view, ctx.selection.nodes).length > 0;
|
|
14187
|
+
if (key === "selection.edge") return wiresAlone(ctx) === 1;
|
|
14188
|
+
if (key === "selection.edges") return wiresAlone(ctx) > 0;
|
|
14065
14189
|
if (key === "diagnostics") return ctx.diagnostics !== void 0 && ctx.diagnostics.length > 0;
|
|
14066
14190
|
if (key === "settingsOpen") return ctx.settingsOpen === true;
|
|
14067
14191
|
if (key === "generateIdle") return ctx.generating === false;
|
|
14068
|
-
if (key === "generating") return ctx.generating
|
|
14192
|
+
if (key === "generating") return ctx.generating !== void 0 && ctx.generating !== false;
|
|
14069
14193
|
if (key === "ungenerated") return ctx.view?.ungenerated === true;
|
|
14070
14194
|
if (key === "undoable") return ctx.view?.can_undo === true;
|
|
14071
14195
|
if (key === "redoable") return ctx.view?.can_redo === true;
|
|
@@ -14150,6 +14274,7 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14150
14274
|
const notifyControllers = /* @__PURE__ */ new Map();
|
|
14151
14275
|
let edits = 0;
|
|
14152
14276
|
const editingListeners = /* @__PURE__ */ new Set();
|
|
14277
|
+
const tickListeners = /* @__PURE__ */ new Set();
|
|
14153
14278
|
async function asEdit(edit) {
|
|
14154
14279
|
edits += 1;
|
|
14155
14280
|
if (edits === 1) for (const listener of editingListeners) listener(true);
|
|
@@ -14221,7 +14346,10 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14221
14346
|
},
|
|
14222
14347
|
fail: (error) => run ? store.fail(run.resultKind, token, error) : false,
|
|
14223
14348
|
detach: (kind, tok) => store.detach(kind, tok),
|
|
14224
|
-
tick: () =>
|
|
14349
|
+
tick: () => {
|
|
14350
|
+
store.bumpTick();
|
|
14351
|
+
if (run) for (const listener of tickListeners) listener(run);
|
|
14352
|
+
},
|
|
14225
14353
|
settled: onSettle
|
|
14226
14354
|
};
|
|
14227
14355
|
}
|
|
@@ -14352,8 +14480,9 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14352
14480
|
const hostSpec = binding.confirm?.(ctx);
|
|
14353
14481
|
if (hostSpec && !await askConfirm(hostSpec)) return;
|
|
14354
14482
|
const token = {};
|
|
14355
|
-
|
|
14356
|
-
|
|
14483
|
+
const rt = runtimeFor(token, readOverOf(ctx), cwdOf(action, ctx));
|
|
14484
|
+
await binding.run(rt, ctx, target);
|
|
14485
|
+
if (binding.invalidates) rt.tick();
|
|
14357
14486
|
}
|
|
14358
14487
|
return {
|
|
14359
14488
|
async run(action, ...rest) {
|
|
@@ -14400,6 +14529,12 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14400
14529
|
editingListeners.delete(listener);
|
|
14401
14530
|
};
|
|
14402
14531
|
},
|
|
14532
|
+
onDidTick(listener) {
|
|
14533
|
+
tickListeners.add(listener);
|
|
14534
|
+
return () => {
|
|
14535
|
+
tickListeners.delete(listener);
|
|
14536
|
+
};
|
|
14537
|
+
},
|
|
14403
14538
|
busy(action, ctx, target) {
|
|
14404
14539
|
return busyOf(action, ctx, target);
|
|
14405
14540
|
},
|
|
@@ -14419,6 +14554,7 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
14419
14554
|
store.detach("notify", token);
|
|
14420
14555
|
}
|
|
14421
14556
|
notifyControllers.clear();
|
|
14557
|
+
tickListeners.clear();
|
|
14422
14558
|
}
|
|
14423
14559
|
};
|
|
14424
14560
|
}
|
|
@@ -14520,6 +14656,7 @@ function autosave(source, save, policy, report) {
|
|
|
14520
14656
|
CommandUnobservedError,
|
|
14521
14657
|
ConnectError,
|
|
14522
14658
|
EMPTY_REPORT_FOLD,
|
|
14659
|
+
GENERATE_STAGES,
|
|
14523
14660
|
InputMode,
|
|
14524
14661
|
Reason,
|
|
14525
14662
|
SCHEMAS,
|
|
@@ -14537,6 +14674,7 @@ function autosave(source, save, policy, report) {
|
|
|
14537
14674
|
diagnosticsOfDocument,
|
|
14538
14675
|
failureSays,
|
|
14539
14676
|
foldReport,
|
|
14677
|
+
generatedTree,
|
|
14540
14678
|
isBoundPath,
|
|
14541
14679
|
liveSlots,
|
|
14542
14680
|
openEngineCommands,
|