@elyx-code/project-logic-tree 0.0.6277 → 0.0.6279
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.js +16 -6
- package/dist/index.umd.cjs +34 -34
- package/dist/tree/state/project/project.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -71087,6 +71087,8 @@ const ie = class ie extends kv {
|
|
|
71087
71087
|
h(this, "initialized", !1);
|
|
71088
71088
|
h(this, "startedInitialization", !1);
|
|
71089
71089
|
h(this, "onCloseChangeSetCallback", null);
|
|
71090
|
+
h(this, "onAddChangeSetCallback", null);
|
|
71091
|
+
h(this, "onDiscardChangeSetCallback", null);
|
|
71090
71092
|
h(this, "onRequestActiveValueCallback", null);
|
|
71091
71093
|
this.initialData = e, this.id = e.id, this.name = e.name, this.description = e.description, this.x = 0, this.y = 0, this.instances[this.id] = this;
|
|
71092
71094
|
try {
|
|
@@ -71156,6 +71158,12 @@ const ie = class ie extends kv {
|
|
|
71156
71158
|
async onCloseChangeSet(e) {
|
|
71157
71159
|
this.onCloseChangeSetCallback = e, await this.closePendingChangeSets();
|
|
71158
71160
|
}
|
|
71161
|
+
onAddChangeSet(e) {
|
|
71162
|
+
this.onAddChangeSetCallback = e;
|
|
71163
|
+
}
|
|
71164
|
+
onDiscardChangeSet(e) {
|
|
71165
|
+
this.onDiscardChangeSetCallback = e;
|
|
71166
|
+
}
|
|
71159
71167
|
async closeChangeSet(e) {
|
|
71160
71168
|
const t = this.history.findIndex((l) => l.id === e.id), i = this.history.slice(0, t), s = i[i.length - 1];
|
|
71161
71169
|
if (!(s != null && s.dirty) && this.onCloseChangeSetCallback) {
|
|
@@ -71191,18 +71199,19 @@ const ie = class ie extends kv {
|
|
|
71191
71199
|
// Adds it in cronological order based on the change-set "timestamp"
|
|
71192
71200
|
// If there is a currently open change-set, it throws an error
|
|
71193
71201
|
addChangeSet(e) {
|
|
71202
|
+
var s, l;
|
|
71194
71203
|
if (!this.history.length)
|
|
71195
71204
|
return this.undoableStackValueIndex = qp(
|
|
71196
71205
|
this.undoableStackValueIndex,
|
|
71197
71206
|
this.history,
|
|
71198
71207
|
e
|
|
71199
|
-
), e;
|
|
71208
|
+
), (s = this.onAddChangeSetCallback) == null || s.call(this, e, this.undoableStackValueIndex), e;
|
|
71200
71209
|
const t = this.history.find(
|
|
71201
|
-
(
|
|
71210
|
+
(o) => o.id === (e == null ? void 0 : e.id)
|
|
71202
71211
|
);
|
|
71203
71212
|
if (t)
|
|
71204
71213
|
return t;
|
|
71205
|
-
const i = this.history.find((
|
|
71214
|
+
const i = this.history.find((o) => o.open);
|
|
71206
71215
|
if (i)
|
|
71207
71216
|
throw console.warn("Previous still open: ", i), console.warn("New change set: ", e), new Error(
|
|
71208
71217
|
`There is already an open change-set with id '${i.id}'.`
|
|
@@ -71211,13 +71220,14 @@ const ie = class ie extends kv {
|
|
|
71211
71220
|
this.undoableStackValueIndex,
|
|
71212
71221
|
this.history,
|
|
71213
71222
|
e
|
|
71214
|
-
), e;
|
|
71223
|
+
), (l = this.onAddChangeSetCallback) == null || l.call(this, e, this.undoableStackValueIndex), e;
|
|
71215
71224
|
}
|
|
71216
71225
|
// Sometimes change-sets get initialized by default but end up not having any changes.
|
|
71217
71226
|
// So we remove them from the state
|
|
71218
71227
|
discardChangeSet(e) {
|
|
71219
|
-
|
|
71220
|
-
|
|
71228
|
+
var i;
|
|
71229
|
+
const t = this.history.findIndex((s) => s.id === (e == null ? void 0 : e.id));
|
|
71230
|
+
return t !== -1 && ((i = this.onDiscardChangeSetCallback) == null || i.call(this, e), this.history.splice(t, 1)), this;
|
|
71221
71231
|
}
|
|
71222
71232
|
async inject(...e) {
|
|
71223
71233
|
return await Promise.all(
|