@stonecrop/stonecrop 0.12.3 → 0.12.5
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/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +10 -2
- package/dist/stonecrop.js +119 -115
- package/dist/stonecrop.js.map +1 -1
- package/package.json +4 -4
- package/src/registry.ts +19 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC5B;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAA;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAK;IAE/C;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc,CAAqE;IAE3F;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB,CAAgB;IAE3C;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAExB;;;;OAIG;gBACS,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IASjG;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEpE;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO;IAuB3B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC5B;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAA;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAK;IAE/C;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc,CAAqE;IAE3F;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB,CAAgB;IAE3C;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAExB;;;;OAIG;gBACS,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IASjG;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEpE;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO;IAuB3B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,WAAW,EAAE;IAiHrE;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAkDrB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAoD5D;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI7C;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,eAAe,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAUvF;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,eAAe,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAwBtG;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAgC5B"}
|
package/dist/src/registry.js
CHANGED
|
@@ -140,9 +140,17 @@ export default class Registry {
|
|
|
140
140
|
const link = linksByFieldname.get(field.fieldname);
|
|
141
141
|
if (!link) {
|
|
142
142
|
const doctype = typeof field.options === 'string' ? field.options : undefined;
|
|
143
|
+
if (doctype === undefined) {
|
|
144
|
+
// eslint-disable-next-line no-console
|
|
145
|
+
console.warn(`[Stonecrop] Link field "${field.fieldname}" has no \`options\` or corresponding \`links\` declaration. ` +
|
|
146
|
+
`AFormLink will be created without a \`doctype\` prop, so navigation will not work. ` +
|
|
147
|
+
`Add \`"options": "<doctype-slug>"\` to the field definition.`);
|
|
148
|
+
}
|
|
149
|
+
// Strip any raw `doctype` from the JSON; only `options` is the authoritative source.
|
|
150
|
+
const { doctype: _rawDoctype, ...fieldRest } = field;
|
|
143
151
|
resolvedFields.push({
|
|
144
|
-
...
|
|
145
|
-
component: 'AFormLink',
|
|
152
|
+
...fieldRest,
|
|
153
|
+
component: fieldRest.component || 'AFormLink',
|
|
146
154
|
...(doctype !== undefined ? { doctype } : {}),
|
|
147
155
|
});
|
|
148
156
|
continue;
|
package/dist/stonecrop.js
CHANGED
|
@@ -155,87 +155,87 @@ const Gi = {
|
|
|
155
155
|
}, Qr = "vueuse-storage";
|
|
156
156
|
function Zi(e, t, r, n = {}) {
|
|
157
157
|
var i;
|
|
158
|
-
const { flush: o = "pre", deep: s = !0, listenToStorageChanges: a = !0, writeDefaults: u = !0, mergeDefaults: c = !1, shallow: f, window: h = Nt, eventFilter: l, onError: g = (
|
|
159
|
-
console.error(
|
|
158
|
+
const { flush: o = "pre", deep: s = !0, listenToStorageChanges: a = !0, writeDefaults: u = !0, mergeDefaults: c = !1, shallow: f, window: h = Nt, eventFilter: l, onError: g = (I) => {
|
|
159
|
+
console.error(I);
|
|
160
160
|
}, initOnMounted: p } = n, d = (f ? $n : j)(t), S = G(() => It(e));
|
|
161
161
|
if (!r) try {
|
|
162
162
|
r = Yi("getDefaultStorage", () => Nt?.localStorage)();
|
|
163
|
-
} catch (
|
|
164
|
-
g(
|
|
163
|
+
} catch (I) {
|
|
164
|
+
g(I);
|
|
165
165
|
}
|
|
166
166
|
if (!r) return d;
|
|
167
|
-
const
|
|
167
|
+
const R = It(t), b = Ji(R), w = (i = n.serializer) !== null && i !== void 0 ? i : Gi[b], { pause: K, resume: k } = xi(d, (I) => ae(I), {
|
|
168
168
|
flush: o,
|
|
169
169
|
deep: s,
|
|
170
170
|
eventFilter: l
|
|
171
171
|
});
|
|
172
172
|
Mt(S, () => wt(), { flush: o });
|
|
173
173
|
let $ = !1;
|
|
174
|
-
const H = (
|
|
175
|
-
p && !$ || wt(
|
|
176
|
-
}, J = (
|
|
177
|
-
p && !$ || ce(
|
|
174
|
+
const H = (I) => {
|
|
175
|
+
p && !$ || wt(I);
|
|
176
|
+
}, J = (I) => {
|
|
177
|
+
p && !$ || ce(I);
|
|
178
178
|
};
|
|
179
179
|
h && a && (r instanceof Storage ? Wt(h, "storage", H, { passive: !0 }) : Wt(h, Qr, J)), p ? Ui(() => {
|
|
180
180
|
$ = !0, wt();
|
|
181
181
|
}) : wt();
|
|
182
|
-
function W(
|
|
182
|
+
function W(I, F) {
|
|
183
183
|
if (h) {
|
|
184
184
|
const Q = {
|
|
185
185
|
key: S.value,
|
|
186
|
-
oldValue:
|
|
186
|
+
oldValue: I,
|
|
187
187
|
newValue: F,
|
|
188
188
|
storageArea: r
|
|
189
189
|
};
|
|
190
190
|
h.dispatchEvent(r instanceof Storage ? new StorageEvent("storage", Q) : new CustomEvent(Qr, { detail: Q }));
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
function ae(
|
|
193
|
+
function ae(I) {
|
|
194
194
|
try {
|
|
195
195
|
const F = r.getItem(S.value);
|
|
196
|
-
if (
|
|
196
|
+
if (I == null)
|
|
197
197
|
W(F, null), r.removeItem(S.value);
|
|
198
198
|
else {
|
|
199
|
-
const Q = w.write(
|
|
199
|
+
const Q = w.write(I);
|
|
200
200
|
F !== Q && (r.setItem(S.value, Q), W(F, Q));
|
|
201
201
|
}
|
|
202
202
|
} catch (F) {
|
|
203
203
|
g(F);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
function ue(
|
|
207
|
-
const F =
|
|
206
|
+
function ue(I) {
|
|
207
|
+
const F = I ? I.newValue : r.getItem(S.value);
|
|
208
208
|
if (F == null)
|
|
209
|
-
return u &&
|
|
210
|
-
if (!
|
|
209
|
+
return u && R != null && r.setItem(S.value, w.write(R)), R;
|
|
210
|
+
if (!I && c) {
|
|
211
211
|
const Q = w.read(F);
|
|
212
|
-
return typeof c == "function" ? c(Q,
|
|
213
|
-
...
|
|
212
|
+
return typeof c == "function" ? c(Q, R) : b === "object" && !Array.isArray(Q) ? {
|
|
213
|
+
...R,
|
|
214
214
|
...Q
|
|
215
215
|
} : Q;
|
|
216
216
|
} else return typeof F != "string" ? F : w.read(F);
|
|
217
217
|
}
|
|
218
|
-
function wt(
|
|
219
|
-
if (!(
|
|
220
|
-
if (
|
|
221
|
-
d.value =
|
|
218
|
+
function wt(I) {
|
|
219
|
+
if (!(I && I.storageArea !== r)) {
|
|
220
|
+
if (I && I.key == null) {
|
|
221
|
+
d.value = R;
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
if (!(
|
|
224
|
+
if (!(I && I.key !== S.value)) {
|
|
225
225
|
K();
|
|
226
226
|
try {
|
|
227
227
|
const F = w.write(d.value);
|
|
228
|
-
(
|
|
228
|
+
(I === void 0 || I?.newValue !== F) && (d.value = ue(I));
|
|
229
229
|
} catch (F) {
|
|
230
230
|
g(F);
|
|
231
231
|
} finally {
|
|
232
|
-
|
|
232
|
+
I ? br(k) : k();
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
function ce(
|
|
238
|
-
wt(
|
|
237
|
+
function ce(I) {
|
|
238
|
+
wt(I.detail);
|
|
239
239
|
}
|
|
240
240
|
return d;
|
|
241
241
|
}
|
|
@@ -264,23 +264,23 @@ function to(e = {}) {
|
|
|
264
264
|
["Shift", /* @__PURE__ */ new Set()],
|
|
265
265
|
["Alt", /* @__PURE__ */ new Set()]
|
|
266
266
|
]), h = /* @__PURE__ */ new Set();
|
|
267
|
-
function l(
|
|
268
|
-
|
|
267
|
+
function l(b, w) {
|
|
268
|
+
b in u && (t ? u[b] = w : u[b].value = w);
|
|
269
269
|
}
|
|
270
270
|
function g() {
|
|
271
271
|
s.clear();
|
|
272
|
-
for (const
|
|
272
|
+
for (const b of h) l(b, !1);
|
|
273
273
|
}
|
|
274
|
-
function p(
|
|
275
|
-
if (!(!
|
|
274
|
+
function p(b, w, K) {
|
|
275
|
+
if (!(!b || typeof w.getModifierState != "function")) {
|
|
276
276
|
for (const [k, $] of f) if (w.getModifierState(k)) {
|
|
277
277
|
K.forEach((H) => $.add(H));
|
|
278
278
|
break;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
function d(
|
|
283
|
-
if (
|
|
282
|
+
function d(b, w) {
|
|
283
|
+
if (b) return;
|
|
284
284
|
const K = `${w[0].toUpperCase()}${w.slice(1)}`, k = f.get(K);
|
|
285
285
|
if (!["shift", "alt"].includes(w) || !k) return;
|
|
286
286
|
const $ = Array.from(k), H = $.indexOf(w);
|
|
@@ -288,29 +288,29 @@ function to(e = {}) {
|
|
|
288
288
|
W >= H && (s.delete(J), l(J, !1));
|
|
289
289
|
}), k.clear();
|
|
290
290
|
}
|
|
291
|
-
function S(
|
|
291
|
+
function S(b, w) {
|
|
292
292
|
var K, k;
|
|
293
|
-
const $ = (K =
|
|
293
|
+
const $ = (K = b.key) === null || K === void 0 ? void 0 : K.toLowerCase(), H = [(k = b.code) === null || k === void 0 ? void 0 : k.toLowerCase(), $].filter(Boolean);
|
|
294
294
|
if ($) {
|
|
295
295
|
$ && (w ? s.add($) : s.delete($));
|
|
296
296
|
for (const J of H)
|
|
297
297
|
h.add(J), l(J, w);
|
|
298
|
-
p(w,
|
|
298
|
+
p(w, b, [...s, ...H]), d(w, $), $ === "meta" && !w && (c.forEach((J) => {
|
|
299
299
|
s.delete(J), l(J, !1);
|
|
300
300
|
}), c.clear());
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
Wt(r, "keydown", (
|
|
304
|
-
const
|
|
305
|
-
if (typeof w != "string") return Reflect.get(
|
|
303
|
+
Wt(r, "keydown", (b) => (S(b, !0), o(b)), { passive: i }), Wt(r, "keyup", (b) => (S(b, !1), o(b)), { passive: i }), Wt("blur", g, { passive: i }), Wt("focus", g, { passive: i });
|
|
304
|
+
const R = new Proxy(u, { get(b, w, K) {
|
|
305
|
+
if (typeof w != "string") return Reflect.get(b, w, K);
|
|
306
306
|
if (w = w.toLowerCase(), w in n && (w = n[w]), !(w in u)) if (/[+_-]/.test(w)) {
|
|
307
307
|
const $ = w.split(/[+_-]/g).map((H) => H.trim());
|
|
308
|
-
u[w] = G(() => $.map((H) => It(
|
|
308
|
+
u[w] = G(() => $.map((H) => It(R[H])).every(Boolean));
|
|
309
309
|
} else u[w] = $n(!1);
|
|
310
|
-
const k = Reflect.get(
|
|
310
|
+
const k = Reflect.get(b, w, K);
|
|
311
311
|
return t ? It(k) : k;
|
|
312
312
|
} });
|
|
313
|
-
return
|
|
313
|
+
return R;
|
|
314
314
|
}
|
|
315
315
|
function ir() {
|
|
316
316
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
@@ -429,16 +429,16 @@ const Ie = Li("hst-operation-log", () => {
|
|
|
429
429
|
if (v.type === "batch" && v.descendantOperationIds)
|
|
430
430
|
for (let y = v.descendantOperationIds.length - 1; y >= 0; y--) {
|
|
431
431
|
const x = v.descendantOperationIds[y], it = t.value.find((m) => m.id === x);
|
|
432
|
-
it &&
|
|
432
|
+
it && b(it, _);
|
|
433
433
|
}
|
|
434
434
|
else
|
|
435
|
-
|
|
435
|
+
b(v, _);
|
|
436
436
|
return r.value--, e.value.enableCrossTabSync && ce(v), !0;
|
|
437
437
|
} catch (y) {
|
|
438
438
|
return typeof console < "u" && console.error("Undo failed:", y), !1;
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function R(_) {
|
|
442
442
|
if (!a.value) return !1;
|
|
443
443
|
const v = t.value[r.value + 1];
|
|
444
444
|
try {
|
|
@@ -449,12 +449,12 @@ const Ie = Li("hst-operation-log", () => {
|
|
|
449
449
|
}
|
|
450
450
|
else
|
|
451
451
|
w(v, _);
|
|
452
|
-
return r.value++, e.value.enableCrossTabSync &&
|
|
452
|
+
return r.value++, e.value.enableCrossTabSync && I(v), !0;
|
|
453
453
|
} catch (y) {
|
|
454
454
|
return typeof console < "u" && console.error("Redo failed:", y), !1;
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function b(_, v) {
|
|
458
458
|
(_.type === "set" || _.type === "delete") && v && typeof v.set == "function" && v.set(_.path, _.beforeValue, "undo");
|
|
459
459
|
}
|
|
460
460
|
function w(_, v) {
|
|
@@ -539,7 +539,7 @@ const Ie = Li("hst-operation-log", () => {
|
|
|
539
539
|
};
|
|
540
540
|
W.postMessage(qe(v));
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function I(_) {
|
|
543
543
|
if (!W) return;
|
|
544
544
|
const v = {
|
|
545
545
|
type: "redo",
|
|
@@ -615,7 +615,7 @@ const Ie = Li("hst-operation-log", () => {
|
|
|
615
615
|
commitBatch: p,
|
|
616
616
|
cancelBatch: d,
|
|
617
617
|
undo: S,
|
|
618
|
-
redo:
|
|
618
|
+
redo: R,
|
|
619
619
|
clear: k,
|
|
620
620
|
getOperationsFor: $,
|
|
621
621
|
getSnapshot: K,
|
|
@@ -749,15 +749,15 @@ class _e {
|
|
|
749
749
|
l && t.store && (f = this.captureSnapshot(t));
|
|
750
750
|
for (const S of o)
|
|
751
751
|
try {
|
|
752
|
-
const
|
|
753
|
-
if (a.push(
|
|
752
|
+
const R = await this.executeAction(S, t, r.timeout);
|
|
753
|
+
if (a.push(R), !R.success) {
|
|
754
754
|
u = !0;
|
|
755
755
|
break;
|
|
756
756
|
}
|
|
757
|
-
} catch (
|
|
757
|
+
} catch (R) {
|
|
758
758
|
const w = {
|
|
759
759
|
success: !1,
|
|
760
|
-
error:
|
|
760
|
+
error: R instanceof Error ? R : new Error(String(R)),
|
|
761
761
|
executionTime: 0,
|
|
762
762
|
action: S
|
|
763
763
|
};
|
|
@@ -775,8 +775,8 @@ class _e {
|
|
|
775
775
|
for (const S of p)
|
|
776
776
|
try {
|
|
777
777
|
S.error && this.options.errorHandler(S.error, t, S.action);
|
|
778
|
-
} catch (
|
|
779
|
-
console.error("[FieldTriggers] Error in global error handler:",
|
|
778
|
+
} catch (R) {
|
|
779
|
+
console.error("[FieldTriggers] Error in global error handler:", R);
|
|
780
780
|
}
|
|
781
781
|
return {
|
|
782
782
|
path: t.path,
|
|
@@ -1756,7 +1756,7 @@ function ls(e) {
|
|
|
1756
1756
|
e || (e = {});
|
|
1757
1757
|
const t = e.registry || xe("$registry"), r = xe("$stonecrop"), n = j(), i = j(), o = j({}), s = j(), a = j(), u = j([]), c = j(!1), f = j(null), h = j(), l = G(() => !n.value || !h.value || !e.recordId || e.recordId === "new" ? !0 : n.value.isWorkflowReady(h.value, e.recordId).ready), g = G(() => !n.value || !h.value || !e.recordId || e.recordId === "new" ? [] : n.value.isWorkflowReady(h.value, e.recordId).blockedLinks ?? []), p = r || At._root;
|
|
1758
1758
|
p && (n.value = p), e?.doctype && typeof e.doctype != "string" && (h.value = e.doctype);
|
|
1759
|
-
const d = j([]), S = j(-1),
|
|
1759
|
+
const d = j([]), S = j(-1), R = G(() => n.value?.getOperationLogStore().canUndo ?? !1), b = G(() => n.value?.getOperationLogStore().canRedo ?? !1), w = G(() => n.value?.getOperationLogStore().undoCount ?? 0), K = G(() => n.value?.getOperationLogStore().redoCount ?? 0), k = G(
|
|
1760
1760
|
() => n.value?.getOperationLogStore().undoRedoState ?? {
|
|
1761
1761
|
canUndo: !1,
|
|
1762
1762
|
canRedo: !1,
|
|
@@ -1776,9 +1776,9 @@ function ls(e) {
|
|
|
1776
1776
|
totalOperations: 0,
|
|
1777
1777
|
reversibleOperations: 0,
|
|
1778
1778
|
irreversibleOperations: 0
|
|
1779
|
-
},
|
|
1779
|
+
}, I = (m, E) => {
|
|
1780
1780
|
n.value?.getOperationLogStore().markIrreversible(m, E);
|
|
1781
|
-
}, F = (m, E,
|
|
1781
|
+
}, F = (m, E, O, L = "success", D) => n.value?.getOperationLogStore().logAction(m, E, O, L, D) ?? "", Q = (m) => {
|
|
1782
1782
|
n.value?.getOperationLogStore().configure(m);
|
|
1783
1783
|
};
|
|
1784
1784
|
if (t && n.value)
|
|
@@ -1786,13 +1786,13 @@ function ls(e) {
|
|
|
1786
1786
|
const m = n.value.getOperationLogStore(), E = zn(m);
|
|
1787
1787
|
d.value = E.operations.value, S.value = E.currentIndex.value, Mt(
|
|
1788
1788
|
() => E.operations.value,
|
|
1789
|
-
(
|
|
1790
|
-
d.value =
|
|
1789
|
+
(O) => {
|
|
1790
|
+
d.value = O;
|
|
1791
1791
|
}
|
|
1792
1792
|
), Mt(
|
|
1793
1793
|
() => E.currentIndex.value,
|
|
1794
|
-
(
|
|
1795
|
-
S.value =
|
|
1794
|
+
(O) => {
|
|
1795
|
+
S.value = O;
|
|
1796
1796
|
}
|
|
1797
1797
|
);
|
|
1798
1798
|
} catch {
|
|
@@ -1802,28 +1802,28 @@ function ls(e) {
|
|
|
1802
1802
|
if (!e.doctype && t.router) {
|
|
1803
1803
|
const m = t.router.currentRoute.value;
|
|
1804
1804
|
if (!m.path) return;
|
|
1805
|
-
const E = m.path.split("/").filter((L) => L.length > 0),
|
|
1805
|
+
const E = m.path.split("/").filter((L) => L.length > 0), O = E[1]?.toLowerCase();
|
|
1806
1806
|
if (E.length > 0) {
|
|
1807
1807
|
const L = {
|
|
1808
1808
|
path: m.path,
|
|
1809
1809
|
segments: E
|
|
1810
1810
|
}, D = await t.getMeta?.(L);
|
|
1811
1811
|
if (D) {
|
|
1812
|
-
if (t.addDoctype(D), n.value.setup(D), s.value = D, a.value =
|
|
1813
|
-
const Ct = n.value.getRecordById(D,
|
|
1812
|
+
if (t.addDoctype(D), n.value.setup(D), s.value = D, a.value = O, i.value = n.value.getStore(), t && (u.value = t.resolveSchema(D)), O && O !== "new") {
|
|
1813
|
+
const Ct = n.value.getRecordById(D, O);
|
|
1814
1814
|
if (Ct)
|
|
1815
1815
|
o.value = Ct.get("") || {};
|
|
1816
1816
|
else
|
|
1817
1817
|
try {
|
|
1818
|
-
await n.value.getRecord(D,
|
|
1819
|
-
const Ut = n.value.getRecordById(D,
|
|
1818
|
+
await n.value.getRecord(D, O);
|
|
1819
|
+
const Ut = n.value.getRecordById(D, O);
|
|
1820
1820
|
Ut && (o.value = Ut.get("") || {});
|
|
1821
1821
|
} catch {
|
|
1822
1822
|
o.value = t.initializeRecord(u.value);
|
|
1823
1823
|
}
|
|
1824
1824
|
} else
|
|
1825
1825
|
o.value = t.initializeRecord(u.value);
|
|
1826
|
-
i.value && or(D,
|
|
1826
|
+
i.value && or(D, O || "new", o, i.value), n.value.runAction(D, "load", O ? [O] : void 0);
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
@@ -1832,41 +1832,41 @@ function ls(e) {
|
|
|
1832
1832
|
if (typeof e.doctype == "string") {
|
|
1833
1833
|
const E = e.doctype;
|
|
1834
1834
|
i.value = n.value.getStore(), c.value = !0, f.value = null;
|
|
1835
|
-
let
|
|
1835
|
+
let O;
|
|
1836
1836
|
try {
|
|
1837
|
-
if (
|
|
1837
|
+
if (O = t.getDoctype(E), !O && t.getMeta) {
|
|
1838
1838
|
const L = {
|
|
1839
1839
|
path: `/${E}`,
|
|
1840
1840
|
segments: [E]
|
|
1841
1841
|
};
|
|
1842
|
-
|
|
1842
|
+
O = await t.getMeta(L), O && t.addDoctype(O);
|
|
1843
1843
|
}
|
|
1844
|
-
|
|
1844
|
+
O || (f.value = new Error(`Doctype '${E}' not found in registry and getMeta returned no result`));
|
|
1845
1845
|
} catch (L) {
|
|
1846
1846
|
f.value = L instanceof Error ? L : new Error(String(L));
|
|
1847
1847
|
} finally {
|
|
1848
1848
|
c.value = !1;
|
|
1849
1849
|
}
|
|
1850
|
-
if (h.value =
|
|
1851
|
-
if (u.value = t.resolveSchema(
|
|
1852
|
-
const L = n.value.getRecordById(
|
|
1850
|
+
if (h.value = O, !O) return;
|
|
1851
|
+
if (u.value = t.resolveSchema(O), m && m !== "new") {
|
|
1852
|
+
const L = n.value.getRecordById(O, m);
|
|
1853
1853
|
if (L)
|
|
1854
1854
|
o.value = L.get("") || {};
|
|
1855
1855
|
else
|
|
1856
1856
|
try {
|
|
1857
|
-
await n.value.getRecord(
|
|
1858
|
-
const D = n.value.getRecordById(
|
|
1857
|
+
await n.value.getRecord(O, m);
|
|
1858
|
+
const D = n.value.getRecordById(O, m);
|
|
1859
1859
|
D && (o.value = D.get("") || {});
|
|
1860
1860
|
} catch {
|
|
1861
1861
|
o.value = t.initializeRecord(u.value);
|
|
1862
1862
|
}
|
|
1863
1863
|
} else
|
|
1864
1864
|
o.value = t.initializeRecord(u.value);
|
|
1865
|
-
i.value && or(
|
|
1865
|
+
i.value && or(O, m || "new", o, i.value);
|
|
1866
1866
|
} else if (m && m !== "new") {
|
|
1867
|
-
const E = e.doctype,
|
|
1868
|
-
if (
|
|
1869
|
-
o.value =
|
|
1867
|
+
const E = e.doctype, O = n.value.getRecordById(E, m);
|
|
1868
|
+
if (O)
|
|
1869
|
+
o.value = O.get("") || {};
|
|
1870
1870
|
else
|
|
1871
1871
|
try {
|
|
1872
1872
|
await n.value.getRecord(E, m);
|
|
@@ -1880,19 +1880,19 @@ function ls(e) {
|
|
|
1880
1880
|
}
|
|
1881
1881
|
});
|
|
1882
1882
|
const fe = (m, E) => {
|
|
1883
|
-
const
|
|
1884
|
-
if (!
|
|
1883
|
+
const O = h.value || s.value;
|
|
1884
|
+
if (!O) return "";
|
|
1885
1885
|
const L = E || e.recordId || a.value || "new";
|
|
1886
|
-
return `${
|
|
1886
|
+
return `${O.slug}.${L}.${m}`;
|
|
1887
1887
|
}, xt = (m) => {
|
|
1888
1888
|
const E = h.value || s.value;
|
|
1889
1889
|
if (!(!i.value || !n.value || !E))
|
|
1890
1890
|
try {
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
const Ct =
|
|
1894
|
-
if (i.value.has(`${Ct}.${Ut}`) || n.value.addRecord(E, Ut, { ...o.value }),
|
|
1895
|
-
const Ai = `${Ct}.${Ut}`, er =
|
|
1891
|
+
const O = m.path.split(".");
|
|
1892
|
+
if (O.length >= 2) {
|
|
1893
|
+
const Ct = O[0], Ut = O[1];
|
|
1894
|
+
if (i.value.has(`${Ct}.${Ut}`) || n.value.addRecord(E, Ut, { ...o.value }), O.length > 3) {
|
|
1895
|
+
const Ai = `${Ct}.${Ut}`, er = O.slice(2);
|
|
1896
1896
|
let rr = Ai;
|
|
1897
1897
|
for (let Le = 0; Le < er.length - 1; Le++)
|
|
1898
1898
|
if (rr += `.${er[Le]}`, !i.value.has(rr)) {
|
|
@@ -1912,10 +1912,10 @@ function ls(e) {
|
|
|
1912
1912
|
if (!n.value)
|
|
1913
1913
|
throw new Error("Stonecrop instance not available");
|
|
1914
1914
|
return n.value.initializeNestedData(m, E);
|
|
1915
|
-
}, v = async (m, E,
|
|
1915
|
+
}, v = async (m, E, O, L) => {
|
|
1916
1916
|
if (!n.value)
|
|
1917
1917
|
throw new Error("Stonecrop instance not available");
|
|
1918
|
-
return n.value.fetchNestedData(m, E,
|
|
1918
|
+
return n.value.fetchNestedData(m, E, O, L);
|
|
1919
1919
|
}, y = (m, E) => {
|
|
1920
1920
|
if (!n.value)
|
|
1921
1921
|
throw new Error("Stonecrop instance not available");
|
|
@@ -1933,8 +1933,8 @@ function ls(e) {
|
|
|
1933
1933
|
operations: d,
|
|
1934
1934
|
currentIndex: S,
|
|
1935
1935
|
undoRedoState: k,
|
|
1936
|
-
canUndo:
|
|
1937
|
-
canRedo:
|
|
1936
|
+
canUndo: R,
|
|
1937
|
+
canRedo: b,
|
|
1938
1938
|
undoCount: w,
|
|
1939
1939
|
redoCount: K,
|
|
1940
1940
|
undo: $,
|
|
@@ -1945,7 +1945,7 @@ function ls(e) {
|
|
|
1945
1945
|
clear: ue,
|
|
1946
1946
|
getOperationsFor: wt,
|
|
1947
1947
|
getSnapshot: ce,
|
|
1948
|
-
markIrreversible:
|
|
1948
|
+
markIrreversible: I,
|
|
1949
1949
|
logAction: F,
|
|
1950
1950
|
configure: Q
|
|
1951
1951
|
};
|
|
@@ -2038,10 +2038,10 @@ function Dn(e) {
|
|
|
2038
2038
|
function S(k, $) {
|
|
2039
2039
|
return r.getOperationsFor(k, $);
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2041
|
+
function R() {
|
|
2042
2042
|
return r.getSnapshot();
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function b(k, $) {
|
|
2045
2045
|
r.markIrreversible(k, $);
|
|
2046
2046
|
}
|
|
2047
2047
|
function w(k, $, H, J = "success", W) {
|
|
@@ -2067,8 +2067,8 @@ function Dn(e) {
|
|
|
2067
2067
|
cancelBatch: p,
|
|
2068
2068
|
clear: d,
|
|
2069
2069
|
getOperationsFor: S,
|
|
2070
|
-
getSnapshot:
|
|
2071
|
-
markIrreversible:
|
|
2070
|
+
getSnapshot: R,
|
|
2071
|
+
markIrreversible: b,
|
|
2072
2072
|
logAction: w,
|
|
2073
2073
|
configure: K
|
|
2074
2074
|
};
|
|
@@ -2871,9 +2871,9 @@ function zr(e, t, r, n) {
|
|
|
2871
2871
|
if (h)
|
|
2872
2872
|
return this.cacheResult().__iterate(f, h);
|
|
2873
2873
|
var g = 0, p = !0, d = 0;
|
|
2874
|
-
return e.__iterate(function(S,
|
|
2874
|
+
return e.__iterate(function(S, R) {
|
|
2875
2875
|
if (!(p && (p = g++ < o)))
|
|
2876
|
-
return d++, f(S, n ?
|
|
2876
|
+
return d++, f(S, n ? R : d - 1, l) !== !1 && d !== u;
|
|
2877
2877
|
}), d;
|
|
2878
2878
|
}, c.__iteratorUncached = function(f, h) {
|
|
2879
2879
|
if (u !== 0 && h)
|
|
@@ -3466,8 +3466,8 @@ Jt.prototype.update = function(t, r, n, i, o, s, a) {
|
|
|
3466
3466
|
return g[l ^ 1];
|
|
3467
3467
|
if (h && d && g.length === 1 && gn(d))
|
|
3468
3468
|
return d;
|
|
3469
|
-
var S = t && t === this.ownerID,
|
|
3470
|
-
return S ? (this.bitmap =
|
|
3469
|
+
var S = t && t === this.ownerID, R = h ? d ? f : f ^ c : f | c, b = h ? d ? ci(g, l, d, S) : qo(g, l, S) : Co(g, l, d, S);
|
|
3470
|
+
return S ? (this.bitmap = R, this.nodes = b, this) : new Jt(t, R, b);
|
|
3471
3471
|
};
|
|
3472
3472
|
var we = function(t, r, n) {
|
|
3473
3473
|
this.ownerID = t, this.count = r, this.nodes = n;
|
|
@@ -3992,11 +3992,11 @@ function _n(e, t) {
|
|
|
3992
3992
|
}
|
|
3993
3993
|
if (p === d)
|
|
3994
3994
|
return ye;
|
|
3995
|
-
var
|
|
3995
|
+
var R = t ? --d : p++;
|
|
3996
3996
|
l = s(
|
|
3997
|
-
g && g[
|
|
3997
|
+
g && g[R],
|
|
3998
3998
|
f - T,
|
|
3999
|
-
h + (
|
|
3999
|
+
h + (R << f)
|
|
4000
4000
|
);
|
|
4001
4001
|
}
|
|
4002
4002
|
};
|
|
@@ -4079,8 +4079,8 @@ function Rt(e, t, r) {
|
|
|
4079
4079
|
if (g && l > h && s < o && g.array.length) {
|
|
4080
4080
|
c = Xt(c, n);
|
|
4081
4081
|
for (var d = c, S = u; S > T; S -= T) {
|
|
4082
|
-
var
|
|
4083
|
-
d = d.array[
|
|
4082
|
+
var R = h >>> S & tt;
|
|
4083
|
+
d = d.array[R] = Xt(d.array[R], n);
|
|
4084
4084
|
}
|
|
4085
4085
|
d.array[h >>> T & tt] = g;
|
|
4086
4086
|
}
|
|
@@ -4088,10 +4088,10 @@ function Rt(e, t, r) {
|
|
|
4088
4088
|
s -= l, a -= l, u = T, c = null, p = p && p.removeBefore(n, 0, s);
|
|
4089
4089
|
else if (s > i || l < h) {
|
|
4090
4090
|
for (f = 0; c; ) {
|
|
4091
|
-
var
|
|
4092
|
-
if (
|
|
4091
|
+
var b = s >>> u & tt;
|
|
4092
|
+
if (b !== l >>> u & tt)
|
|
4093
4093
|
break;
|
|
4094
|
-
|
|
4094
|
+
b && (f += (1 << u) * b), u -= T, c = c.array[b];
|
|
4095
4095
|
}
|
|
4096
4096
|
c && s > i && (c = c.removeBefore(n, u, s - f)), c && l < h && (c = c.removeAfter(
|
|
4097
4097
|
n,
|
|
@@ -5570,9 +5570,13 @@ class me {
|
|
|
5570
5570
|
const c = s.get(u.fieldname);
|
|
5571
5571
|
if (!c) {
|
|
5572
5572
|
const S = typeof u.options == "string" ? u.options : void 0;
|
|
5573
|
+
S === void 0 && console.warn(
|
|
5574
|
+
`[Stonecrop] Link field "${u.fieldname}" has no \`options\` or corresponding \`links\` declaration. AFormLink will be created without a \`doctype\` prop, so navigation will not work. Add \`"options": "<doctype-slug>"\` to the field definition.`
|
|
5575
|
+
);
|
|
5576
|
+
const { doctype: R, ...b } = u;
|
|
5573
5577
|
a.push({
|
|
5574
|
-
...
|
|
5575
|
-
component: "AFormLink",
|
|
5578
|
+
...b,
|
|
5579
|
+
component: b.component || "AFormLink",
|
|
5576
5580
|
...S !== void 0 ? { doctype: S } : {}
|
|
5577
5581
|
});
|
|
5578
5582
|
continue;
|