@dialecte/core 0.4.0 → 0.4.2
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/document/query/get/record/get-record.d.ts +3 -0
- package/dist/document/query/get/record/get-record.d.ts.map +1 -1
- package/dist/document/transaction/create/create.types.d.ts +12 -2
- package/dist/document/transaction/create/create.types.d.ts.map +1 -1
- package/dist/document/transaction/create/index.d.ts +1 -1
- package/dist/document/transaction/create/index.d.ts.map +1 -1
- package/dist/document/transaction/ensure/ensure.d.ts +6 -4
- package/dist/document/transaction/ensure/ensure.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{project-CblzZXzn.js → project-E32sEthh.js} +154 -160
- package/dist/test.js +1 -1
- package/package.json +5 -4
|
@@ -8,6 +8,9 @@ import { AnyDialecteConfig, ElementsOf, TrackedRecord } from '../../../../types'
|
|
|
8
8
|
* Always returns a TrackedRecord — 'unchanged' for clean store reads.
|
|
9
9
|
*
|
|
10
10
|
* Side effect: populates context.recordCache on store hits.
|
|
11
|
+
*
|
|
12
|
+
* @throws {@link DialecteError} `ELEMENT_TAGNAME_MISMATCH` when a record is found by id
|
|
13
|
+
* but its tagName differs from `ref.tagName` (mirrors the staged-lookup path).
|
|
11
14
|
*/
|
|
12
15
|
export declare function getRecord<GenericConfig extends AnyDialecteConfig, GenericElement extends ElementsOf<GenericConfig>>(params: {
|
|
13
16
|
context: Context<GenericConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-record.d.ts","sourceRoot":"","sources":["../../../../../src/document/query/get/record/get-record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-record.d.ts","sourceRoot":"","sources":["../../../../../src/document/query/get/record/get-record.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAa,aAAa,EAAE,MAAM,SAAS,CAAA;AAEtF;;;;;;;;;;;GAWG;AACH,wBAAsB,SAAS,CAC9B,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;CAC/C,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,SAAS,CAAC,CAwDpE"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { AnyDialecteConfig, ElementsOf, ChildrenOf, Namespace, AttributesValueObjectOf, FullAttributeObjectOf } from '../../../types';
|
|
2
|
+
export type ChildAttributesOf<GenericConfig extends AnyDialecteConfig, GenericChildElement extends ElementsOf<GenericConfig>> = AttributesValueObjectOf<GenericConfig, GenericChildElement> | FullAttributeObjectOf<GenericConfig, GenericChildElement>[];
|
|
3
|
+
/**
|
|
4
|
+
* `attributes` is optional when the child element has no required attributes
|
|
5
|
+
* and required as soon as it declares at least one required attribute.
|
|
6
|
+
*/
|
|
7
|
+
type AddChildAttributesParams<GenericConfig extends AnyDialecteConfig, GenericChildElement extends ElementsOf<GenericConfig>> = {} extends AttributesValueObjectOf<GenericConfig, GenericChildElement> ? {
|
|
8
|
+
attributes?: ChildAttributesOf<GenericConfig, GenericChildElement>;
|
|
9
|
+
} : {
|
|
10
|
+
attributes: ChildAttributesOf<GenericConfig, GenericChildElement>;
|
|
11
|
+
};
|
|
2
12
|
export type AddChildParams<GenericConfig extends AnyDialecteConfig, GenericElement extends ElementsOf<GenericConfig>, GenericChildElement extends ChildrenOf<GenericConfig, GenericElement>> = {
|
|
3
13
|
id?: `${string}-${string}-${string}-${string}-${string}`;
|
|
4
14
|
tagName: GenericChildElement;
|
|
5
15
|
namespace?: Namespace;
|
|
6
|
-
attributes: AttributesValueObjectOf<GenericConfig, GenericChildElement> | FullAttributeObjectOf<GenericConfig, GenericChildElement>[];
|
|
7
16
|
value?: string;
|
|
8
|
-
}
|
|
17
|
+
} & AddChildAttributesParams<GenericConfig, GenericChildElement>;
|
|
18
|
+
export {};
|
|
9
19
|
//# sourceMappingURL=create.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.types.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/create/create.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,cAAc,CACzB,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAChD,mBAAmB,SAAS,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,IAClE;IACH,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;IACxD,OAAO,EAAE,mBAAmB,CAAA;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,
|
|
1
|
+
{"version":3,"file":"create.types.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/create/create.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,iBAAiB,CAC5B,aAAa,SAAS,iBAAiB,EACvC,mBAAmB,SAAS,UAAU,CAAC,aAAa,CAAC,IAEnD,uBAAuB,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAC3D,qBAAqB,CAAC,aAAa,EAAE,mBAAmB,CAAC,EAAE,CAAA;AAE9D;;;GAGG;AACH,KAAK,wBAAwB,CAC5B,aAAa,SAAS,iBAAiB,EACvC,mBAAmB,SAAS,UAAU,CAAC,aAAa,CAAC,IAErD,EAAE,SAAS,uBAAuB,CAAC,aAAa,EAAE,mBAAmB,CAAC,GACnE;IAAE,UAAU,CAAC,EAAE,iBAAiB,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAA;CAAE,GACtE;IAAE,UAAU,EAAE,iBAAiB,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAA;CAAE,CAAA;AAEzE,MAAM,MAAM,cAAc,CACzB,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAChD,mBAAmB,SAAS,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,IAClE;IACH,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;IACxD,OAAO,EAAE,mBAAmB,CAAA;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,wBAAwB,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -4,10 +4,12 @@ import { AnyDialecteConfig, ElementsOf, ChildrenOf, RawRecord, TrackedRecord, Tr
|
|
|
4
4
|
/**
|
|
5
5
|
* Get an existing child record or create it under the given parent.
|
|
6
6
|
*
|
|
7
|
-
* Lookup
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Lookup is always scoped to the direct children of `parentRef` (never document-wide),
|
|
8
|
+
* in this order:
|
|
9
|
+
* 1. Non-empty attributes → first sibling matching the attribute filter.
|
|
10
|
+
* 2. No attributes, id present → first sibling with that id.
|
|
11
|
+
* 3. No attributes, no id (singleton) → first existing sibling with that tag name.
|
|
12
|
+
* 4. No match → creates.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* // singleton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/ensure/ensure.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"ensure.d.ts","sourceRoot":"","sources":["../../../../src/document/transaction/ensure/ensure.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,wBAAwB,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAoB,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AACvE,OAAO,KAAK,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,gBAAgB,CACrC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAChD,mBAAmB,SAAS,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,EACpE,MAAM,EAAE;IACT,cAAc,EAAE,aAAa,CAAA;IAC7B,KAAK,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IACvC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3B,SAAS,EAAE,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC7C,MAAM,EAAE,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAA;CAC1E,GAAG,OAAO,CACV,aAAa,CAAC,aAAa,EAAE,mBAAmB,CAAC,GAAG,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC,CACjG,CA6BA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as L, i as R, it as z, j as B, k as V, l as H, lt as U, m as W, n as G, nt as K, o as q, ot as J, p as Y, q as X, r as Z, rt as Q, s as $, st as ee, t as te, tt as ne, u as re, ut as ie, v as ae, w as oe, x as se, y as ce } from "./project-
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, d as N, et as P, f as F, g as I, h as L, i as R, it as z, j as B, k as V, l as H, lt as U, m as W, n as G, nt as K, o as q, ot as J, p as Y, q as X, r as Z, rt as Q, s as $, st as ee, t as te, tt as ne, u as re, ut as ie, v as ae, w as oe, x as se, y as ce } from "./project-E32sEthh.js";
|
|
2
2
|
import { l as le, u as ue } from "./utils-DgKwrT2n.js";
|
|
3
3
|
export { V as AnyQuery, i as AnyTransaction, N as BLOBS_SCHEMA, F as BLOB_DATA_SCHEMA, Y as CHANGELOG_SCHEMA, W as DOCUMENTS_SCHEMA, re as DexieStore, oe as Document, ue as ERROR_CATALOG, H as InMemoryStore, L as META_SCHEMA, p as ParseSession, te as Project, h as Query, I as TABLE_BLOBS, D as TABLE_BLOB_PREFIX, ae as TABLE_CHANGELOG, ce as TABLE_DOCUMENTS, A as TABLE_META, se as TABLE_RECORD_PREFIX, f as TEMP_IDB_ID_ATTRIBUTE_NAME, a as Transaction, C as applyOmit, x as applyOrder, u as applyUnwrap, ie as bindExtensions, y as blobTableName, R as buildDocumentState, g as buildXmlDocument, S as collectSnapshotRecords, o as downloadFile, q as exportBlob, $ as exportDocument, K as findAncestors, P as findByAttributes, e as findDescendants, v as formatXml, E as getAttribute, _ as getAttributeFullObject, T as getAttributes, w as getAttributesFullObject, z as getChild, Q as getChildren, ee as getRecord, J as getRecords, k as getRecordsByTagName, t as getSnapshot, c as getTree, Z as importDocument, M as indexStagedDeletesByParent, G as initEmptyDocument, m as inspectXml, s as isOmitted, b as isTransactionContext, ne as matchesAttributeFilter, U as overlayAllStaged, d as parseOmit, B as parseXmlFile, O as reconcileDocumentState, r as recordTableName, n as recordsToTree, j as resolveStore, X as shouldStopTraversal, le as throwDialecteError, l as xmlDocumentToString };
|
|
@@ -124,7 +124,7 @@ function te(e) {
|
|
|
124
124
|
deleted: a
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function T(e) {
|
|
128
128
|
let t = /* @__PURE__ */ new Set();
|
|
129
129
|
for (let n of e) n.status === "created" && t.add(n.newRecord.id);
|
|
130
130
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -144,42 +144,45 @@ function ne(e) {
|
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region src/document/query/get/record/get-record.ts
|
|
147
|
-
async function
|
|
148
|
-
let { context:
|
|
149
|
-
if (
|
|
147
|
+
async function E(e) {
|
|
148
|
+
let { context: n, ref: r } = e;
|
|
149
|
+
if (n.stagedOperations.length > 0) {
|
|
150
150
|
let e = ee({
|
|
151
|
-
stagedOperations:
|
|
152
|
-
tagName:
|
|
153
|
-
id:
|
|
151
|
+
stagedOperations: n.stagedOperations,
|
|
152
|
+
tagName: r.tagName,
|
|
153
|
+
id: r.id
|
|
154
154
|
});
|
|
155
155
|
if (e?.status === "deleted") return;
|
|
156
156
|
if (e) return e;
|
|
157
157
|
}
|
|
158
|
-
let
|
|
159
|
-
if (
|
|
160
|
-
let e = `__singleton_${
|
|
161
|
-
|
|
158
|
+
let i;
|
|
159
|
+
if (r.id === void 0) {
|
|
160
|
+
let e = `__singleton_${r.tagName}`, t = Lt(n) ? n.recordCache.get(e) : void 0;
|
|
161
|
+
t ? i = t : (i = (await n.store.getByTagNameInDocument(r.tagName, n.documentId))[0], i && Lt(n) && (n.recordCache.set(i.id, i), n.recordCache.set(e, i)));
|
|
162
162
|
} else {
|
|
163
|
-
let e = Lt(
|
|
164
|
-
e ?
|
|
163
|
+
let e = Lt(n) ? n.recordCache.get(r.id) : void 0;
|
|
164
|
+
e ? i = e : (i = await n.store.get(r.id, n.documentId), i && Lt(n) && n.recordCache.set(r.id, i));
|
|
165
165
|
}
|
|
166
|
-
if (
|
|
167
|
-
|
|
166
|
+
if (i) return i.tagName !== r.tagName && t("ELEMENT_TAGNAME_MISMATCH", {
|
|
167
|
+
detail: `Expected tagName '${r.tagName}', got '${i.tagName}' for id '${r.id}'`,
|
|
168
|
+
ref: r
|
|
169
|
+
}), {
|
|
170
|
+
...i,
|
|
168
171
|
status: "unchanged"
|
|
169
172
|
};
|
|
170
173
|
}
|
|
171
174
|
//#endregion
|
|
172
175
|
//#region src/document/query/get/record/get-records.ts
|
|
173
|
-
async function
|
|
176
|
+
async function ne(e) {
|
|
174
177
|
let { context: t, refs: n } = e;
|
|
175
|
-
return Promise.all(n.map((e) =>
|
|
178
|
+
return Promise.all(n.map((e) => E({
|
|
176
179
|
context: t,
|
|
177
180
|
ref: e
|
|
178
181
|
})));
|
|
179
182
|
}
|
|
180
183
|
//#endregion
|
|
181
184
|
//#region src/document/query/get/record/get-records-by-tagname.ts
|
|
182
|
-
async function
|
|
185
|
+
async function re(e) {
|
|
183
186
|
let { context: t, tagName: n } = e, r = await t.store.getByTagNameInDocument(n, t.documentId);
|
|
184
187
|
for (let e of r) Lt(t) && t.recordCache.set(e.id, e);
|
|
185
188
|
return w({
|
|
@@ -190,14 +193,14 @@ async function ie(e) {
|
|
|
190
193
|
}
|
|
191
194
|
//#endregion
|
|
192
195
|
//#region src/document/query/get/record/get-child.ts
|
|
193
|
-
async function
|
|
194
|
-
let { context: t, ref: n, tagName: r } = e, i = await
|
|
196
|
+
async function ie(e) {
|
|
197
|
+
let { context: t, ref: n, tagName: r } = e, i = await E({
|
|
195
198
|
context: t,
|
|
196
199
|
ref: n
|
|
197
200
|
});
|
|
198
201
|
if (!i) return;
|
|
199
202
|
let a = i.children.find((e) => e.tagName === r);
|
|
200
|
-
if (a) return
|
|
203
|
+
if (a) return E({
|
|
201
204
|
context: t,
|
|
202
205
|
ref: a
|
|
203
206
|
});
|
|
@@ -205,13 +208,13 @@ async function ae(e) {
|
|
|
205
208
|
if (!o?.length) return;
|
|
206
209
|
let s = i.children.filter((e) => o.includes(e.tagName));
|
|
207
210
|
for (let e of s) {
|
|
208
|
-
let n = await
|
|
211
|
+
let n = await E({
|
|
209
212
|
context: t,
|
|
210
213
|
ref: e
|
|
211
214
|
});
|
|
212
215
|
if (!n) continue;
|
|
213
216
|
let i = n.children.find((e) => e.tagName === r);
|
|
214
|
-
if (i) return
|
|
217
|
+
if (i) return E({
|
|
215
218
|
context: t,
|
|
216
219
|
ref: i
|
|
217
220
|
});
|
|
@@ -219,8 +222,8 @@ async function ae(e) {
|
|
|
219
222
|
}
|
|
220
223
|
//#endregion
|
|
221
224
|
//#region src/document/query/get/record/get-children.ts
|
|
222
|
-
async function
|
|
223
|
-
let { context: t, ref: n, tagName: r } = e, i = await
|
|
225
|
+
async function D(e) {
|
|
226
|
+
let { context: t, ref: n, tagName: r } = e, i = await E({
|
|
224
227
|
context: t,
|
|
225
228
|
ref: n
|
|
226
229
|
});
|
|
@@ -229,7 +232,7 @@ async function E(e) {
|
|
|
229
232
|
tagName: r,
|
|
230
233
|
id: e.id
|
|
231
234
|
}));
|
|
232
|
-
if (a.length) return (await
|
|
235
|
+
if (a.length) return (await ne({
|
|
233
236
|
context: t,
|
|
234
237
|
refs: a
|
|
235
238
|
})).filter((e) => e !== void 0);
|
|
@@ -237,27 +240,27 @@ async function E(e) {
|
|
|
237
240
|
if (!o?.length) return [];
|
|
238
241
|
let s = i.children.filter((e) => o.includes(e.tagName));
|
|
239
242
|
if (!s.length) return [];
|
|
240
|
-
let c = (await
|
|
243
|
+
let c = (await ne({
|
|
241
244
|
context: t,
|
|
242
245
|
refs: s
|
|
243
246
|
})).filter((e) => e !== void 0).flatMap((e) => e.children.filter((e) => e.tagName === r)).map((e) => ({
|
|
244
247
|
tagName: r,
|
|
245
248
|
id: e.id
|
|
246
249
|
}));
|
|
247
|
-
return c.length ? (await
|
|
250
|
+
return c.length ? (await ne({
|
|
248
251
|
context: t,
|
|
249
252
|
refs: c
|
|
250
253
|
})).filter((e) => e !== void 0) : [];
|
|
251
254
|
}
|
|
252
255
|
//#endregion
|
|
253
256
|
//#region src/document/query/find/ancestor/find-ancestor.ts
|
|
254
|
-
async function
|
|
255
|
-
let { context: t, ref: n, options: r } = e, i = r?.depth ?? Infinity, a = r?.stopAtTagName, o = r?.order ?? "bottom-up", s = [], c = await
|
|
257
|
+
async function O(e) {
|
|
258
|
+
let { context: t, ref: n, options: r } = e, i = r?.depth ?? Infinity, a = r?.stopAtTagName, o = r?.order ?? "bottom-up", s = [], c = await E({
|
|
256
259
|
context: t,
|
|
257
260
|
ref: n
|
|
258
261
|
});
|
|
259
262
|
for (; c?.parent && s.length < i;) {
|
|
260
|
-
let e = c.parent, n = await
|
|
263
|
+
let e = c.parent, n = await E({
|
|
261
264
|
context: t,
|
|
262
265
|
ref: e
|
|
263
266
|
});
|
|
@@ -268,8 +271,8 @@ async function D(e) {
|
|
|
268
271
|
}
|
|
269
272
|
//#endregion
|
|
270
273
|
//#region src/document/query/find/by-attribute/find-by-attributes.ts
|
|
271
|
-
async function
|
|
272
|
-
let { context: t, tagName: n, attributes: r } = e, i = await
|
|
274
|
+
async function ae(e) {
|
|
275
|
+
let { context: t, tagName: n, attributes: r } = e, i = await re({
|
|
273
276
|
context: t,
|
|
274
277
|
tagName: n
|
|
275
278
|
}), a = [];
|
|
@@ -297,7 +300,7 @@ function k(e) {
|
|
|
297
300
|
async function oe(e) {
|
|
298
301
|
let { context: t, ref: n, options: r } = e, { collect: i, omit: a } = r, o = A(a), s = se(i), c = /* @__PURE__ */ new Map();
|
|
299
302
|
for (let e of s.allTags) c.set(e, /* @__PURE__ */ new Map());
|
|
300
|
-
let l = await
|
|
303
|
+
let l = await E({
|
|
301
304
|
context: t,
|
|
302
305
|
ref: n
|
|
303
306
|
});
|
|
@@ -412,7 +415,7 @@ async function ue(e) {
|
|
|
412
415
|
let { context: t, rootId: n, collectSpec: r, omitSpec: i, collected: a } = e;
|
|
413
416
|
for (let e of r.targets) {
|
|
414
417
|
if (i.unconditional.has(e.tagName)) continue;
|
|
415
|
-
let r = await
|
|
418
|
+
let r = await re({
|
|
416
419
|
context: t,
|
|
417
420
|
tagName: e.tagName
|
|
418
421
|
});
|
|
@@ -444,7 +447,7 @@ async function fe(e) {
|
|
|
444
447
|
for (; a;) {
|
|
445
448
|
if (!a.parent || i.unconditional.has(a.parent.tagName)) return !1;
|
|
446
449
|
if (a.parent.id === r) return !0;
|
|
447
|
-
let e = await
|
|
450
|
+
let e = await E({
|
|
448
451
|
context: t,
|
|
449
452
|
ref: f(a.parent)
|
|
450
453
|
});
|
|
@@ -510,7 +513,7 @@ async function me(e) {
|
|
|
510
513
|
let { context: t, record: n, omitSpec: r } = e;
|
|
511
514
|
if (!n.children?.length) return [];
|
|
512
515
|
let i = n.children.filter((e) => !r.unconditional.has(e.tagName));
|
|
513
|
-
return i.length ? (await Promise.all(i.map((e) =>
|
|
516
|
+
return i.length ? (await Promise.all(i.map((e) => E({
|
|
514
517
|
context: t,
|
|
515
518
|
ref: f(e)
|
|
516
519
|
})))).filter((e) => e !== void 0 && !j({
|
|
@@ -527,14 +530,14 @@ function he(e) {
|
|
|
527
530
|
//#region src/document/query/get/attribute/get-attribute.ts
|
|
528
531
|
async function N(e) {
|
|
529
532
|
let { context: t, ref: n, name: r } = e;
|
|
530
|
-
return ((await
|
|
533
|
+
return ((await E({
|
|
531
534
|
context: t,
|
|
532
535
|
ref: n
|
|
533
536
|
}))?.attributes ?? []).find((e) => e.name === r)?.value ?? "";
|
|
534
537
|
}
|
|
535
538
|
async function ge(e) {
|
|
536
539
|
let { context: t, ref: n, name: r } = e;
|
|
537
|
-
return ((await
|
|
540
|
+
return ((await E({
|
|
538
541
|
context: t,
|
|
539
542
|
ref: n
|
|
540
543
|
}))?.attributes ?? []).find((e) => e.name === r);
|
|
@@ -543,14 +546,14 @@ async function ge(e) {
|
|
|
543
546
|
//#region src/document/query/get/attribute/get-attributes.ts
|
|
544
547
|
async function _e(e) {
|
|
545
548
|
let { context: t, ref: n } = e;
|
|
546
|
-
return ((await
|
|
549
|
+
return ((await E({
|
|
547
550
|
context: t,
|
|
548
551
|
ref: n
|
|
549
552
|
}))?.attributes ?? []).reduce((e, t) => (e[t.name] = t.value ?? "", e), {});
|
|
550
553
|
}
|
|
551
554
|
async function ve(e) {
|
|
552
555
|
let { context: t, ref: n } = e;
|
|
553
|
-
return (await
|
|
556
|
+
return (await E({
|
|
554
557
|
context: t,
|
|
555
558
|
ref: n
|
|
556
559
|
}))?.attributes ?? [];
|
|
@@ -655,7 +658,7 @@ function P(e) {
|
|
|
655
658
|
//#endregion
|
|
656
659
|
//#region src/document/query/get/tree/get-tree.ts
|
|
657
660
|
async function we(e) {
|
|
658
|
-
let { context: t, ref: n, options: r = {}, dialecteConfig: a } = e, { select: o, omit: s, unwrap: c } = r, l = await
|
|
661
|
+
let { context: t, ref: n, options: r = {}, dialecteConfig: a } = e, { select: o, omit: s, unwrap: c } = r, l = await E({
|
|
659
662
|
context: t,
|
|
660
663
|
ref: n
|
|
661
664
|
});
|
|
@@ -722,7 +725,7 @@ async function Ee(e) {
|
|
|
722
725
|
transparentElements: o
|
|
723
726
|
}));
|
|
724
727
|
return c.length ? Ae({
|
|
725
|
-
children: (await Promise.all(c.map((e) =>
|
|
728
|
+
children: (await Promise.all(c.map((e) => E({
|
|
726
729
|
context: t,
|
|
727
730
|
ref: f(e)
|
|
728
731
|
})))).filter((e) => e !== void 0).filter((e) => !xe({
|
|
@@ -841,17 +844,17 @@ async function Pe(e) {
|
|
|
841
844
|
context: t,
|
|
842
845
|
includeDeleted: o
|
|
843
846
|
});
|
|
844
|
-
let s = e.siblings ?? !1, c = s === !0 || typeof s == "object" && !!s, l = typeof s == "object" && !!s && s.expand === !0, u = n ?? { tagName: t.dialecteConfig.rootElementName }, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = o ?
|
|
847
|
+
let s = e.siblings ?? !1, c = s === !0 || typeof s == "object" && !!s, l = typeof s == "object" && !!s && s.expand === !0, u = n ?? { tagName: t.dialecteConfig.rootElementName }, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = o ? T(t.stagedOperations) : void 0, h = (e) => {
|
|
845
848
|
if (m) for (let t of m.get(e) ?? []) p.has(t.id) || (p.set(t.id, t), h(t.id));
|
|
846
849
|
}, g = async (e, n) => {
|
|
847
850
|
if (d.set(e.id, e), h(e.id), !(a !== void 0 && n >= a)) for (let r of e.children) {
|
|
848
|
-
let e = await
|
|
851
|
+
let e = await E({
|
|
849
852
|
context: t,
|
|
850
853
|
ref: f(r)
|
|
851
854
|
});
|
|
852
855
|
e && await g(e, n + 1);
|
|
853
856
|
}
|
|
854
|
-
}, _ = await
|
|
857
|
+
}, _ = await E({
|
|
855
858
|
context: t,
|
|
856
859
|
ref: u
|
|
857
860
|
});
|
|
@@ -863,7 +866,7 @@ async function Pe(e) {
|
|
|
863
866
|
await g(_, 0);
|
|
864
867
|
let y = Math.max(r, +!!c);
|
|
865
868
|
if (y > 0) {
|
|
866
|
-
let e = await
|
|
869
|
+
let e = await O({
|
|
867
870
|
context: t,
|
|
868
871
|
ref: u,
|
|
869
872
|
options: {
|
|
@@ -878,7 +881,7 @@ async function Pe(e) {
|
|
|
878
881
|
let r = n[e], i = n[e + 1];
|
|
879
882
|
for (let e of i.children) {
|
|
880
883
|
if (e.id === r.id) continue;
|
|
881
|
-
let n = await
|
|
884
|
+
let n = await E({
|
|
882
885
|
context: t,
|
|
883
886
|
ref: f(e)
|
|
884
887
|
});
|
|
@@ -1429,7 +1432,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1429
1432
|
function n(t, r) {
|
|
1430
1433
|
if (!(this instanceof n)) return new n(t, r);
|
|
1431
1434
|
var a = this;
|
|
1432
|
-
i(a), a.q = a.c = "", a.bufferCheckPosition = e.MAX_BUFFER_LENGTH, a.encoding = null, a.opt = r || {}, a.opt.lowercase = a.opt.lowercase || a.opt.lowercasetags, a.looseCase = a.opt.lowercase ? "toLowerCase" : "toUpperCase", a.opt.maxEntityCount = a.opt.maxEntityCount || 512, a.opt.maxEntityDepth = a.opt.maxEntityDepth || 4, a.entityCount = a.entityDepth = 0, a.tags = [], a.closed = a.closedRoot = a.sawRoot = !1, a.tag = a.error = null, a.strict = !!t, a.noscript = !!(t || a.opt.noscript), a.state = w.BEGIN, a.strictEntities = a.opt.strictEntities, a.ENTITIES = a.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), a.attribList = [], a.opt.xmlns && (a.ns = Object.create(h)), a.opt.unquotedAttributeValues === void 0 && (a.opt.unquotedAttributeValues = !t), a.trackPosition = a.opt.position !== !1, a.trackPosition && (a.position = a.line = a.column = 0),
|
|
1435
|
+
i(a), a.q = a.c = "", a.bufferCheckPosition = e.MAX_BUFFER_LENGTH, a.encoding = null, a.opt = r || {}, a.opt.lowercase = a.opt.lowercase || a.opt.lowercasetags, a.looseCase = a.opt.lowercase ? "toLowerCase" : "toUpperCase", a.opt.maxEntityCount = a.opt.maxEntityCount || 512, a.opt.maxEntityDepth = a.opt.maxEntityDepth || 4, a.entityCount = a.entityDepth = 0, a.tags = [], a.closed = a.closedRoot = a.sawRoot = !1, a.tag = a.error = null, a.strict = !!t, a.noscript = !!(t || a.opt.noscript), a.state = w.BEGIN, a.strictEntities = a.opt.strictEntities, a.ENTITIES = a.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), a.attribList = [], a.opt.xmlns && (a.ns = Object.create(h)), a.opt.unquotedAttributeValues === void 0 && (a.opt.unquotedAttributeValues = !t), a.trackPosition = a.opt.position !== !1, a.trackPosition && (a.position = a.line = a.column = 0), T(a, "onready");
|
|
1433
1436
|
}
|
|
1434
1437
|
Object.create || (Object.create = function(e) {
|
|
1435
1438
|
function t() {}
|
|
@@ -1444,13 +1447,13 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1444
1447
|
var s = n[t[a]].length;
|
|
1445
1448
|
if (s > r) switch (t[a]) {
|
|
1446
1449
|
case "textNode":
|
|
1447
|
-
|
|
1450
|
+
O(n);
|
|
1448
1451
|
break;
|
|
1449
1452
|
case "cdata":
|
|
1450
|
-
|
|
1453
|
+
D(n, "oncdata", n.cdata), n.cdata = "";
|
|
1451
1454
|
break;
|
|
1452
1455
|
case "script":
|
|
1453
|
-
|
|
1456
|
+
D(n, "onscript", n.script), n.script = "";
|
|
1454
1457
|
break;
|
|
1455
1458
|
default: k(n, "Max buffer length exceeded: " + t[a]);
|
|
1456
1459
|
}
|
|
@@ -1462,7 +1465,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1462
1465
|
for (var n = 0, r = t.length; n < r; n++) e[t[n]] = "";
|
|
1463
1466
|
}
|
|
1464
1467
|
function a(e) {
|
|
1465
|
-
|
|
1468
|
+
O(e), e.cdata !== "" && (D(e, "oncdata", e.cdata), e.cdata = ""), e.script !== "" && (D(e, "onscript", e.script), e.script = "");
|
|
1466
1469
|
}
|
|
1467
1470
|
n.prototype = {
|
|
1468
1471
|
end: function() {
|
|
@@ -1873,40 +1876,40 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1873
1876
|
e.ENTITIES[t] = r;
|
|
1874
1877
|
}), e.STATE) e.STATE[e.STATE[te]] = te;
|
|
1875
1878
|
w = e.STATE;
|
|
1876
|
-
function
|
|
1879
|
+
function T(e, t, n) {
|
|
1877
1880
|
e[t] && e[t](n);
|
|
1878
1881
|
}
|
|
1879
|
-
function
|
|
1882
|
+
function E(e) {
|
|
1880
1883
|
var t = e && e.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);
|
|
1881
1884
|
return t ? t[2] : null;
|
|
1882
1885
|
}
|
|
1883
|
-
function
|
|
1886
|
+
function ne(e) {
|
|
1884
1887
|
return e ? e.toLowerCase().replace(/[^a-z0-9]/g, "") : null;
|
|
1885
1888
|
}
|
|
1886
|
-
function
|
|
1887
|
-
let n =
|
|
1889
|
+
function re(e, t) {
|
|
1890
|
+
let n = ne(e), r = ne(t);
|
|
1888
1891
|
return !n || !r ? !0 : r === "utf16" ? n === "utf16le" || n === "utf16be" : n === r;
|
|
1889
1892
|
}
|
|
1890
|
-
function
|
|
1893
|
+
function ie(e, t) {
|
|
1891
1894
|
if (!(!e.strict || !e.encoding || !t || t.name !== "xml")) {
|
|
1892
|
-
var n =
|
|
1893
|
-
n && !
|
|
1895
|
+
var n = E(t.body);
|
|
1896
|
+
n && !re(e.encoding, n) && A(e, "XML declaration encoding " + n + " does not match detected stream encoding " + e.encoding.toUpperCase());
|
|
1894
1897
|
}
|
|
1895
1898
|
}
|
|
1896
|
-
function
|
|
1897
|
-
e.textNode &&
|
|
1899
|
+
function D(e, t, n) {
|
|
1900
|
+
e.textNode && O(e), T(e, t, n);
|
|
1898
1901
|
}
|
|
1899
|
-
function
|
|
1900
|
-
e.textNode =
|
|
1902
|
+
function O(e) {
|
|
1903
|
+
e.textNode = ae(e.opt, e.textNode), e.textNode && T(e, "ontext", e.textNode), e.textNode = "";
|
|
1901
1904
|
}
|
|
1902
|
-
function
|
|
1905
|
+
function ae(e, t) {
|
|
1903
1906
|
return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t;
|
|
1904
1907
|
}
|
|
1905
1908
|
function k(e, t) {
|
|
1906
|
-
return
|
|
1909
|
+
return O(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = Error(t), e.error = t, T(e, "onerror", t), e;
|
|
1907
1910
|
}
|
|
1908
1911
|
function oe(e) {
|
|
1909
|
-
return e.sawRoot && !e.closedRoot && A(e, "Unclosed root tag"), e.state !== w.BEGIN && e.state !== w.BEGIN_WHITESPACE && e.state !== w.TEXT && k(e, "Unexpected end"),
|
|
1912
|
+
return e.sawRoot && !e.closedRoot && A(e, "Unclosed root tag"), e.state !== w.BEGIN && e.state !== w.BEGIN_WHITESPACE && e.state !== w.TEXT && k(e, "Unexpected end"), O(e), e.c = "", e.closed = !0, T(e, "onend"), n.call(e, e.strict, e.opt), e;
|
|
1910
1913
|
}
|
|
1911
1914
|
function A(e, t) {
|
|
1912
1915
|
if (typeof e != "object" || !(e instanceof n)) throw Error("bad call to strictFail");
|
|
@@ -1918,7 +1921,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1918
1921
|
name: e.tagName,
|
|
1919
1922
|
attributes: {}
|
|
1920
1923
|
};
|
|
1921
|
-
e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0,
|
|
1924
|
+
e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, D(e, "onopentagstart", n);
|
|
1922
1925
|
}
|
|
1923
1926
|
function se(e, t) {
|
|
1924
1927
|
var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), r = n[0], i = n[1];
|
|
@@ -1941,7 +1944,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1941
1944
|
i.ns === a.ns && (i.ns = Object.create(a.ns)), i.ns[r] = e.attribValue;
|
|
1942
1945
|
}
|
|
1943
1946
|
e.attribList.push([e.attribName, e.attribValue]);
|
|
1944
|
-
} else e.tag.attributes[e.attribName] = e.attribValue,
|
|
1947
|
+
} else e.tag.attributes[e.attribName] = e.attribValue, D(e, "onattribute", {
|
|
1945
1948
|
name: e.attribName,
|
|
1946
1949
|
value: e.attribValue
|
|
1947
1950
|
});
|
|
@@ -1953,7 +1956,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1953
1956
|
n.prefix = r.prefix, n.local = r.local, n.uri = n.ns[r.prefix] || "", n.prefix && !n.uri && (A(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = r.prefix);
|
|
1954
1957
|
var i = e.tags[e.tags.length - 1] || e;
|
|
1955
1958
|
n.ns && i.ns !== n.ns && Object.keys(n.ns).forEach(function(t) {
|
|
1956
|
-
|
|
1959
|
+
D(e, "onopennamespace", {
|
|
1957
1960
|
prefix: t,
|
|
1958
1961
|
uri: n.ns[t]
|
|
1959
1962
|
});
|
|
@@ -1966,11 +1969,11 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1966
1969
|
local: f,
|
|
1967
1970
|
uri: p
|
|
1968
1971
|
};
|
|
1969
|
-
d && d !== "xmlns" && !p && (A(e, "Unbound namespace prefix: " + JSON.stringify(d)), m.uri = d), e.tag.attributes[c] = m,
|
|
1972
|
+
d && d !== "xmlns" && !p && (A(e, "Unbound namespace prefix: " + JSON.stringify(d)), m.uri = d), e.tag.attributes[c] = m, D(e, "onattribute", m);
|
|
1970
1973
|
}
|
|
1971
1974
|
e.attribList.length = 0;
|
|
1972
1975
|
}
|
|
1973
|
-
e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag),
|
|
1976
|
+
e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), D(e, "onopentag", e.tag), t || (!e.noscript && e.tagName.toLowerCase() === "script" ? e.state = w.SCRIPT : e.state = w.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
|
|
1974
1977
|
}
|
|
1975
1978
|
function ue(e) {
|
|
1976
1979
|
if (!e.tagName) {
|
|
@@ -1982,7 +1985,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1982
1985
|
e.script += "</" + e.tagName + ">", e.tagName = "", e.state = w.SCRIPT;
|
|
1983
1986
|
return;
|
|
1984
1987
|
}
|
|
1985
|
-
|
|
1988
|
+
D(e, "onscript", e.script), e.script = "";
|
|
1986
1989
|
}
|
|
1987
1990
|
var t = e.tags.length, n = e.tagName;
|
|
1988
1991
|
e.strict || (n = n[e.looseCase]());
|
|
@@ -1994,13 +1997,13 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
1994
1997
|
e.tagName = n;
|
|
1995
1998
|
for (var i = e.tags.length; i-- > t;) {
|
|
1996
1999
|
var a = e.tag = e.tags.pop();
|
|
1997
|
-
e.tagName = e.tag.name,
|
|
2000
|
+
e.tagName = e.tag.name, D(e, "onclosetag", e.tagName);
|
|
1998
2001
|
var o = {};
|
|
1999
2002
|
for (var s in a.ns) o[s] = a.ns[s];
|
|
2000
2003
|
var c = e.tags[e.tags.length - 1] || e;
|
|
2001
2004
|
e.opt.xmlns && a.ns !== c.ns && Object.keys(a.ns).forEach(function(t) {
|
|
2002
2005
|
var n = a.ns[t];
|
|
2003
|
-
|
|
2006
|
+
D(e, "onclosenamespace", {
|
|
2004
2007
|
prefix: t,
|
|
2005
2008
|
uri: n
|
|
2006
2009
|
});
|
|
@@ -2064,13 +2067,13 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
2064
2067
|
n.state = w.COMMENT, n.comment = "", n.sgmlDecl = "";
|
|
2065
2068
|
continue;
|
|
2066
2069
|
}
|
|
2067
|
-
n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = w.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === d ? (
|
|
2070
|
+
n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = w.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === d ? (D(n, "onopencdata"), n.state = w.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + a).toUpperCase() === f ? (n.state = w.DOCTYPE, (n.doctype || n.sawRoot) && A(n, "Inappropriately located doctype declaration"), n.doctype = "", n.sgmlDecl = "") : a === ">" ? (D(n, "onsgmldeclaration", n.sgmlDecl), n.sgmlDecl = "", n.state = w.TEXT) : (x(a) && (n.state = w.SGML_DECL_QUOTED), n.sgmlDecl += a);
|
|
2068
2071
|
continue;
|
|
2069
2072
|
case w.SGML_DECL_QUOTED:
|
|
2070
2073
|
a === n.q && (n.state = w.SGML_DECL, n.q = ""), n.sgmlDecl += a;
|
|
2071
2074
|
continue;
|
|
2072
2075
|
case w.DOCTYPE:
|
|
2073
|
-
a === ">" ? (n.state = w.TEXT,
|
|
2076
|
+
a === ">" ? (n.state = w.TEXT, D(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += a, a === "[" ? n.state = w.DOCTYPE_DTD : x(a) && (n.state = w.DOCTYPE_QUOTED, n.q = a));
|
|
2074
2077
|
continue;
|
|
2075
2078
|
case w.DOCTYPE_QUOTED:
|
|
2076
2079
|
n.doctype += a, a === n.q && (n.q = "", n.state = w.DOCTYPE);
|
|
@@ -2085,7 +2088,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
2085
2088
|
a === "-" ? n.state = w.COMMENT_ENDING : n.comment += a;
|
|
2086
2089
|
continue;
|
|
2087
2090
|
case w.COMMENT_ENDING:
|
|
2088
|
-
a === "-" ? (n.state = w.COMMENT_ENDED, n.comment =
|
|
2091
|
+
a === "-" ? (n.state = w.COMMENT_ENDED, n.comment = ae(n.opt, n.comment), n.comment && D(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + a, n.state = w.COMMENT);
|
|
2089
2092
|
continue;
|
|
2090
2093
|
case w.COMMENT_ENDED:
|
|
2091
2094
|
a === ">" ? n.doctype && n.doctype !== !0 ? n.state = w.DOCTYPE_DTD : n.state = w.TEXT : (A(n, "Malformed comment"), n.comment += "--" + a, n.state = w.COMMENT);
|
|
@@ -2098,7 +2101,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
2098
2101
|
a === "]" ? n.state = w.CDATA_ENDING_2 : (n.cdata += "]" + a, n.state = w.CDATA);
|
|
2099
2102
|
continue;
|
|
2100
2103
|
case w.CDATA_ENDING_2:
|
|
2101
|
-
a === ">" ? (n.cdata &&
|
|
2104
|
+
a === ">" ? (n.cdata && D(n, "oncdata", n.cdata), D(n, "onclosecdata"), n.cdata = "", n.state = w.TEXT) : a === "]" ? n.cdata += "]" : (n.cdata += "]]" + a, n.state = w.CDATA);
|
|
2102
2105
|
continue;
|
|
2103
2106
|
case w.PROC_INST:
|
|
2104
2107
|
a === "?" ? n.state = w.PROC_INST_ENDING : b(a) ? n.state = w.PROC_INST_BODY : n.procInstName += a;
|
|
@@ -2113,7 +2116,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
2113
2116
|
name: n.procInstName,
|
|
2114
2117
|
body: n.procInstBody
|
|
2115
2118
|
};
|
|
2116
|
-
|
|
2119
|
+
ie(n, e), D(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state = w.TEXT;
|
|
2117
2120
|
} else n.procInstBody += "?" + a, n.state = w.PROC_INST_BODY;
|
|
2118
2121
|
continue;
|
|
2119
2122
|
case w.OPEN_TAG:
|
|
@@ -2132,7 +2135,7 @@ var Xe = /* @__PURE__ */ b(((e, t) => {
|
|
|
2132
2135
|
case w.ATTRIB_NAME_SAW_WHITE:
|
|
2133
2136
|
if (a === "=") n.state = w.ATTRIB_VALUE;
|
|
2134
2137
|
else if (b(a)) continue;
|
|
2135
|
-
else A(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "",
|
|
2138
|
+
else A(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", D(n, "onattribute", {
|
|
2136
2139
|
name: n.attribName,
|
|
2137
2140
|
value: ""
|
|
2138
2141
|
}), n.attribName = "", a === ">" ? le(n) : C(g, a) ? (n.attribName = a, n.state = w.ATTRIB_NAME) : (A(n, "Invalid attribute name"), n.state = w.ATTRIB);
|
|
@@ -2563,33 +2566,33 @@ var St = class {
|
|
|
2563
2566
|
this.getContext = e, this.dialecteConfig = t;
|
|
2564
2567
|
}
|
|
2565
2568
|
async getRecord(e) {
|
|
2566
|
-
return
|
|
2569
|
+
return E({
|
|
2567
2570
|
context: this.getContext(),
|
|
2568
2571
|
ref: e
|
|
2569
2572
|
});
|
|
2570
2573
|
}
|
|
2571
2574
|
async getRecords(e) {
|
|
2572
|
-
return
|
|
2575
|
+
return ne({
|
|
2573
2576
|
context: this.getContext(),
|
|
2574
2577
|
refs: e
|
|
2575
2578
|
});
|
|
2576
2579
|
}
|
|
2577
2580
|
async getChild(e, t) {
|
|
2578
|
-
return
|
|
2581
|
+
return ie({
|
|
2579
2582
|
context: this.getContext(),
|
|
2580
2583
|
ref: f(e),
|
|
2581
2584
|
tagName: t
|
|
2582
2585
|
});
|
|
2583
2586
|
}
|
|
2584
2587
|
async getChildren(e, t) {
|
|
2585
|
-
return
|
|
2588
|
+
return D({
|
|
2586
2589
|
context: this.getContext(),
|
|
2587
2590
|
ref: f(e),
|
|
2588
2591
|
tagName: t
|
|
2589
2592
|
});
|
|
2590
2593
|
}
|
|
2591
2594
|
async getRecordsByTagName(e) {
|
|
2592
|
-
return
|
|
2595
|
+
return re({
|
|
2593
2596
|
context: this.getContext(),
|
|
2594
2597
|
tagName: e
|
|
2595
2598
|
});
|
|
@@ -2641,13 +2644,13 @@ var St = class {
|
|
|
2641
2644
|
});
|
|
2642
2645
|
}
|
|
2643
2646
|
async findAncestors(e) {
|
|
2644
|
-
return e ?
|
|
2647
|
+
return e ? O({
|
|
2645
2648
|
context: this.getContext(),
|
|
2646
2649
|
ref: f(e)
|
|
2647
2650
|
}) : [];
|
|
2648
2651
|
}
|
|
2649
2652
|
async findByAttributes(e) {
|
|
2650
|
-
return
|
|
2653
|
+
return ae({
|
|
2651
2654
|
context: this.getContext(),
|
|
2652
2655
|
tagName: e.tagName,
|
|
2653
2656
|
attributes: e.attributes
|
|
@@ -2676,7 +2679,7 @@ var St = class {
|
|
|
2676
2679
|
return this.store.name;
|
|
2677
2680
|
}
|
|
2678
2681
|
async getRoot() {
|
|
2679
|
-
let e = await
|
|
2682
|
+
let e = await E({
|
|
2680
2683
|
context: this.context,
|
|
2681
2684
|
ref: { tagName: this.dialecteConfig.rootElementName }
|
|
2682
2685
|
});
|
|
@@ -2686,34 +2689,34 @@ var St = class {
|
|
|
2686
2689
|
}), e;
|
|
2687
2690
|
}
|
|
2688
2691
|
async getRecord(e) {
|
|
2689
|
-
return
|
|
2692
|
+
return E({
|
|
2690
2693
|
context: this.context,
|
|
2691
2694
|
ref: f(e)
|
|
2692
2695
|
});
|
|
2693
2696
|
}
|
|
2694
2697
|
async getRecords(e) {
|
|
2695
2698
|
let t = e.map((e) => f(e));
|
|
2696
|
-
return
|
|
2699
|
+
return ne({
|
|
2697
2700
|
context: this.context,
|
|
2698
2701
|
refs: t
|
|
2699
2702
|
});
|
|
2700
2703
|
}
|
|
2701
2704
|
async getChild(e, t) {
|
|
2702
|
-
if (e) return
|
|
2705
|
+
if (e) return ie({
|
|
2703
2706
|
context: this.context,
|
|
2704
2707
|
ref: f(e),
|
|
2705
2708
|
tagName: t
|
|
2706
2709
|
});
|
|
2707
2710
|
}
|
|
2708
2711
|
async getChildren(e, t) {
|
|
2709
|
-
return e ?
|
|
2712
|
+
return e ? D({
|
|
2710
2713
|
context: this.context,
|
|
2711
2714
|
ref: f(e),
|
|
2712
2715
|
tagName: t
|
|
2713
2716
|
}) : [];
|
|
2714
2717
|
}
|
|
2715
2718
|
async getRecordsByTagName(e) {
|
|
2716
|
-
return
|
|
2719
|
+
return re({
|
|
2717
2720
|
context: this.context,
|
|
2718
2721
|
tagName: e
|
|
2719
2722
|
});
|
|
@@ -2735,7 +2738,7 @@ var St = class {
|
|
|
2735
2738
|
});
|
|
2736
2739
|
}
|
|
2737
2740
|
async findAncestors(e, t) {
|
|
2738
|
-
return e ?
|
|
2741
|
+
return e ? O({
|
|
2739
2742
|
context: this.context,
|
|
2740
2743
|
ref: f(e),
|
|
2741
2744
|
options: t
|
|
@@ -2780,7 +2783,7 @@ var St = class {
|
|
|
2780
2783
|
});
|
|
2781
2784
|
}
|
|
2782
2785
|
async findByAttributes(e) {
|
|
2783
|
-
return
|
|
2786
|
+
return ae({
|
|
2784
2787
|
context: this.context,
|
|
2785
2788
|
...e
|
|
2786
2789
|
});
|
|
@@ -2843,7 +2846,7 @@ function wt(e) {
|
|
|
2843
2846
|
//#endregion
|
|
2844
2847
|
//#region src/document/transaction/create/create.ts
|
|
2845
2848
|
async function H(e) {
|
|
2846
|
-
let { dialecteConfig: t, hooks: n, context: r, query: a, parentRef: o, params: s } = e, { id: c, tagName: u, attributes: d, namespace: f, value: p } = s, m = await
|
|
2849
|
+
let { dialecteConfig: t, hooks: n, context: r, query: a, parentRef: o, params: s } = e, { id: c, tagName: u, attributes: d, namespace: f, value: p } = s, m = await E({
|
|
2847
2850
|
context: r,
|
|
2848
2851
|
ref: o
|
|
2849
2852
|
});
|
|
@@ -2956,7 +2959,7 @@ async function Et(e) {
|
|
|
2956
2959
|
//#endregion
|
|
2957
2960
|
//#region src/document/transaction/delete/delete.ts
|
|
2958
2961
|
async function Dt(e) {
|
|
2959
|
-
let { hooks: t, context: n, query: r, ref: a } = e, o = await
|
|
2962
|
+
let { hooks: t, context: n, query: r, ref: a } = e, o = await E({
|
|
2960
2963
|
context: n,
|
|
2961
2964
|
ref: a
|
|
2962
2965
|
});
|
|
@@ -2981,7 +2984,7 @@ async function Dt(e) {
|
|
|
2981
2984
|
status: "deleted",
|
|
2982
2985
|
record: o
|
|
2983
2986
|
});
|
|
2984
|
-
let s = await
|
|
2987
|
+
let s = await E({
|
|
2985
2988
|
context: n,
|
|
2986
2989
|
ref: f(o.parent)
|
|
2987
2990
|
});
|
|
@@ -3003,7 +3006,7 @@ async function Dt(e) {
|
|
|
3003
3006
|
async function Ot(e) {
|
|
3004
3007
|
let { context: t, record: n } = e;
|
|
3005
3008
|
for (let e of n.children) {
|
|
3006
|
-
let n = await
|
|
3009
|
+
let n = await E({
|
|
3007
3010
|
context: t,
|
|
3008
3011
|
ref: f(e)
|
|
3009
3012
|
});
|
|
@@ -3020,25 +3023,15 @@ async function Ot(e) {
|
|
|
3020
3023
|
//#endregion
|
|
3021
3024
|
//#region src/document/transaction/ensure/ensure.ts
|
|
3022
3025
|
async function kt(e) {
|
|
3023
|
-
let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, params: o } = e, s = At(o.attributes)
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
}
|
|
3032
|
-
let e = await T({
|
|
3033
|
-
context: r,
|
|
3034
|
-
ref: {
|
|
3035
|
-
tagName: o.tagName,
|
|
3036
|
-
id: o.id
|
|
3037
|
-
}
|
|
3038
|
-
});
|
|
3039
|
-
if (e) return e;
|
|
3040
|
-
}
|
|
3041
|
-
return H({
|
|
3026
|
+
let { dialecteConfig: t, hooks: n, context: r, query: i, parentRef: a, params: o } = e, s = At(o.attributes), c = await D({
|
|
3027
|
+
context: r,
|
|
3028
|
+
ref: a,
|
|
3029
|
+
tagName: o.tagName
|
|
3030
|
+
});
|
|
3031
|
+
return (s ? c.find((e) => k({
|
|
3032
|
+
record: e,
|
|
3033
|
+
attributeFilter: s
|
|
3034
|
+
})) : o.id === void 0 ? c[0] : c.find((e) => e.id === o.id)) || H({
|
|
3042
3035
|
dialecteConfig: t,
|
|
3043
3036
|
hooks: n,
|
|
3044
3037
|
context: r,
|
|
@@ -3048,13 +3041,14 @@ async function kt(e) {
|
|
|
3048
3041
|
});
|
|
3049
3042
|
}
|
|
3050
3043
|
function At(e) {
|
|
3044
|
+
if (!e) return;
|
|
3051
3045
|
let t = Array.isArray(e) ? Object.fromEntries(e.map((e) => [e.name, e.value])) : e;
|
|
3052
3046
|
return Object.values(t).some((e) => e !== void 0 && e !== "") ? t : void 0;
|
|
3053
3047
|
}
|
|
3054
3048
|
//#endregion
|
|
3055
3049
|
//#region src/document/transaction/update/update.ts
|
|
3056
3050
|
async function jt(e) {
|
|
3057
|
-
let { dialecteConfig: t, hooks: n, context: r, query: a, ref: o, params: s } = e, { attributes: c, value: d } = s, f = await
|
|
3051
|
+
let { dialecteConfig: t, hooks: n, context: r, query: a, ref: o, params: s } = e, { attributes: c, value: d } = s, f = await E({
|
|
3058
3052
|
context: r,
|
|
3059
3053
|
ref: o
|
|
3060
3054
|
});
|
|
@@ -3587,43 +3581,43 @@ var Y = {
|
|
|
3587
3581
|
return r[e];
|
|
3588
3582
|
}), te = new Set(w.map(function(e) {
|
|
3589
3583
|
return r[e];
|
|
3590
|
-
})),
|
|
3591
|
-
function
|
|
3592
|
-
return
|
|
3584
|
+
})), T = null;
|
|
3585
|
+
function E(e) {
|
|
3586
|
+
return T = /* @__PURE__ */ new WeakMap(), e = function e(t) {
|
|
3593
3587
|
if (!t || typeof t != "object") return t;
|
|
3594
|
-
var n =
|
|
3588
|
+
var n = T.get(t);
|
|
3595
3589
|
if (n) return n;
|
|
3596
3590
|
if (a(t)) {
|
|
3597
|
-
n = [],
|
|
3591
|
+
n = [], T.set(t, n);
|
|
3598
3592
|
for (var r = 0, i = t.length; r < i; ++r) n.push(e(t[r]));
|
|
3599
3593
|
} else if (te.has(t.constructor)) n = t;
|
|
3600
3594
|
else {
|
|
3601
3595
|
var o, c = s(t);
|
|
3602
|
-
for (o in n = c === Object.prototype ? {} : Object.create(c),
|
|
3596
|
+
for (o in n = c === Object.prototype ? {} : Object.create(c), T.set(t, n), t) l(t, o) && (n[o] = e(t[o]));
|
|
3603
3597
|
}
|
|
3604
3598
|
return n;
|
|
3605
|
-
}(e),
|
|
3599
|
+
}(e), T = null, e;
|
|
3606
3600
|
}
|
|
3607
|
-
var
|
|
3608
|
-
function
|
|
3609
|
-
return
|
|
3601
|
+
var ne = {}.toString;
|
|
3602
|
+
function re(e) {
|
|
3603
|
+
return ne.call(e).slice(8, -1);
|
|
3610
3604
|
}
|
|
3611
|
-
var
|
|
3605
|
+
var ie = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", D = typeof ie == "symbol" ? function(e) {
|
|
3612
3606
|
var t;
|
|
3613
|
-
return e != null && (t = e[
|
|
3607
|
+
return e != null && (t = e[ie]) && t.apply(e);
|
|
3614
3608
|
} : function() {
|
|
3615
3609
|
return null;
|
|
3616
3610
|
};
|
|
3617
|
-
function
|
|
3611
|
+
function O(e, t) {
|
|
3618
3612
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
3619
3613
|
}
|
|
3620
|
-
var
|
|
3614
|
+
var ae = {};
|
|
3621
3615
|
function k(e) {
|
|
3622
3616
|
var t, n, r, i;
|
|
3623
3617
|
if (arguments.length === 1) {
|
|
3624
3618
|
if (a(e)) return e.slice();
|
|
3625
|
-
if (this ===
|
|
3626
|
-
if (i =
|
|
3619
|
+
if (this === ae && typeof e == "string") return [e];
|
|
3620
|
+
if (i = D(e)) {
|
|
3627
3621
|
for (n = []; !(r = i.next()).done;) n.push(r.value);
|
|
3628
3622
|
return n;
|
|
3629
3623
|
}
|
|
@@ -4175,7 +4169,7 @@ var Y = {
|
|
|
4175
4169
|
return typeof e != "string" || /\./.test(e) ? function(e) {
|
|
4176
4170
|
return e;
|
|
4177
4171
|
} : function(t) {
|
|
4178
|
-
return t[e] === void 0 && e in t && delete (t =
|
|
4172
|
+
return t[e] === void 0 && e in t && delete (t = E(t))[e], t;
|
|
4179
4173
|
};
|
|
4180
4174
|
}
|
|
4181
4175
|
function xt() {
|
|
@@ -4206,7 +4200,7 @@ var Y = {
|
|
|
4206
4200
|
}
|
|
4207
4201
|
function St(e) {
|
|
4208
4202
|
var t = typeof e;
|
|
4209
|
-
return t == "object" ? ArrayBuffer.isView(e) ? "binary" : (e =
|
|
4203
|
+
return t == "object" ? ArrayBuffer.isView(e) ? "binary" : (e = re(e), e === "ArrayBuffer" ? "binary" : e) : t;
|
|
4210
4204
|
}
|
|
4211
4205
|
function Ct(e) {
|
|
4212
4206
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
@@ -4911,7 +4905,7 @@ var Y = {
|
|
|
4911
4905
|
var g = [], v = [], y = u ? [] : null, b = _ ? m : [];
|
|
4912
4906
|
if (!_) for (var x = 0; x < l; ++x) {
|
|
4913
4907
|
var S = h[x], C = {
|
|
4914
|
-
value:
|
|
4908
|
+
value: E(S),
|
|
4915
4909
|
primKey: t[o + x]
|
|
4916
4910
|
};
|
|
4917
4911
|
!1 !== s.call(C, C.value, C) && (C.value == null ? b.push(t[o + x]) : u || B(d(S), d(C.value)) === 0 ? (v.push(C.value), u && y.push(t[o + x])) : (b.push(t[o + x]), g.push(C.value)));
|
|
@@ -5123,19 +5117,19 @@ var Y = {
|
|
|
5123
5117
|
return e === t[0];
|
|
5124
5118
|
}, [e], "");
|
|
5125
5119
|
}, J.prototype.anyOfIgnoreCase = function() {
|
|
5126
|
-
var e = k.apply(
|
|
5120
|
+
var e = k.apply(ae, arguments);
|
|
5127
5121
|
return e.length === 0 ? G(this) : Bt(this, function(e, t) {
|
|
5128
5122
|
return t.indexOf(e) !== -1;
|
|
5129
5123
|
}, e, "");
|
|
5130
5124
|
}, J.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
5131
|
-
var e = k.apply(
|
|
5125
|
+
var e = k.apply(ae, arguments);
|
|
5132
5126
|
return e.length === 0 ? G(this) : Bt(this, function(e, t) {
|
|
5133
5127
|
return t.some(function(t) {
|
|
5134
5128
|
return e.indexOf(t) === 0;
|
|
5135
5129
|
});
|
|
5136
5130
|
}, e, dt);
|
|
5137
5131
|
}, J.prototype.anyOf = function() {
|
|
5138
|
-
var e = this, t = k.apply(
|
|
5132
|
+
var e = this, t = k.apply(ae, arguments), n = this._cmp;
|
|
5139
5133
|
try {
|
|
5140
5134
|
t.sort(n);
|
|
5141
5135
|
} catch {
|
|
@@ -5161,7 +5155,7 @@ var Y = {
|
|
|
5161
5155
|
includeUppers: !1
|
|
5162
5156
|
});
|
|
5163
5157
|
}, J.prototype.noneOf = function() {
|
|
5164
|
-
var e = k.apply(
|
|
5158
|
+
var e = k.apply(ae, arguments);
|
|
5165
5159
|
if (e.length === 0) return new this.Collection(this);
|
|
5166
5160
|
try {
|
|
5167
5161
|
e.sort(this._ascending);
|
|
@@ -5219,7 +5213,7 @@ var Y = {
|
|
|
5219
5213
|
}), !1);
|
|
5220
5214
|
}), e;
|
|
5221
5215
|
}, J.prototype.startsWithAnyOf = function() {
|
|
5222
|
-
var e = k.apply(
|
|
5216
|
+
var e = k.apply(ae, arguments);
|
|
5223
5217
|
return e.every(function(e) {
|
|
5224
5218
|
return typeof e == "string";
|
|
5225
5219
|
}) ? e.length === 0 ? G(this) : this.inAnyRange(e.map(function(e) {
|
|
@@ -5961,7 +5955,7 @@ var Y = {
|
|
|
5961
5955
|
var t = Tn(this).next(e).value;
|
|
5962
5956
|
return t && B(t.from, e) <= 0 && 0 <= B(t.to, e);
|
|
5963
5957
|
}
|
|
5964
|
-
})[
|
|
5958
|
+
})[ie] = function() {
|
|
5965
5959
|
return Tn(this);
|
|
5966
5960
|
}, j));
|
|
5967
5961
|
var An = {}, jn = {}, Mn = !1;
|
|
@@ -6187,7 +6181,7 @@ var Y = {
|
|
|
6187
6181
|
function Bn(e, t, n, r) {
|
|
6188
6182
|
return n ||= {}, r ||= "", i(e).forEach(function(i) {
|
|
6189
6183
|
var a, o, s;
|
|
6190
|
-
l(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s =
|
|
6184
|
+
l(t, i) ? (a = e[i], o = t[i], typeof a == "object" && typeof o == "object" && a && o ? (s = re(a)) === re(o) ? s === "Object" ? Bn(a, o, n, r + i + ".") : a !== o && (n[r + i] = t[i]) : n[r + i] = t[i] : a !== o && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
6191
6185
|
}), i(t).forEach(function(i) {
|
|
6192
6186
|
l(e, i) || (n[r + i] = t[i]);
|
|
6193
6187
|
}), n;
|
|
@@ -6295,7 +6289,7 @@ var Y = {
|
|
|
6295
6289
|
function Un(e, t, n) {
|
|
6296
6290
|
try {
|
|
6297
6291
|
if (!t || t.keys.length < e.length) return null;
|
|
6298
|
-
for (var r = [], i = 0, a = 0; i < t.keys.length && a < e.length; ++i) B(t.keys[i], e[a]) === 0 && (r.push(n ?
|
|
6292
|
+
for (var r = [], i = 0, a = 0; i < t.keys.length && a < e.length; ++i) B(t.keys[i], e[a]) === 0 && (r.push(n ? E(t.values[i]) : t.values[i]), ++a);
|
|
6299
6293
|
return r.length === e.length ? r : null;
|
|
6300
6294
|
} catch {
|
|
6301
6295
|
return null;
|
|
@@ -6314,7 +6308,7 @@ var Y = {
|
|
|
6314
6308
|
return t ? I.resolve(t) : r.getMany(e).then(function(t) {
|
|
6315
6309
|
return e.trans._cache = {
|
|
6316
6310
|
keys: e.keys,
|
|
6317
|
-
values: e.cache === "clone" ?
|
|
6311
|
+
values: e.cache === "clone" ? E(t) : t
|
|
6318
6312
|
}, t;
|
|
6319
6313
|
});
|
|
6320
6314
|
},
|
|
@@ -6538,7 +6532,7 @@ var Y = {
|
|
|
6538
6532
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
6539
6533
|
var r, i;
|
|
6540
6534
|
e.subscribers.delete(n), e.subscribers.size === 0 && (r = e, i = t, setTimeout(function() {
|
|
6541
|
-
r.subscribers.size === 0 &&
|
|
6535
|
+
r.subscribers.size === 0 && O(i, r);
|
|
6542
6536
|
}, 3e3));
|
|
6543
6537
|
});
|
|
6544
6538
|
}
|
|
@@ -6560,16 +6554,16 @@ var Y = {
|
|
|
6560
6554
|
var f = e.table(u), p = d.optimisticOps.filter(function(e) {
|
|
6561
6555
|
return e.trans === s;
|
|
6562
6556
|
});
|
|
6563
|
-
if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) kn((x = _[g]).obsSet, s.mutatedParts) && (
|
|
6557
|
+
if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) kn((x = _[g]).obsSet, s.mutatedParts) && (O(b, x), x.subscribers.forEach(function(e) {
|
|
6564
6558
|
return o.add(e);
|
|
6565
6559
|
}));
|
|
6566
6560
|
else if (0 < p.length) {
|
|
6567
6561
|
d.optimisticOps = d.optimisticOps.filter(function(e) {
|
|
6568
6562
|
return e.trans !== s;
|
|
6569
6563
|
});
|
|
6570
|
-
for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, ee = (b = y[v]).slice(); C < ee.length; C++) (x = ee[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Xn(x.res, x.req, p, f, x, S), x.dirty ? (
|
|
6564
|
+
for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, ee = (b = y[v]).slice(); C < ee.length; C++) (x = ee[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Xn(x.res, x.req, p, f, x, S), x.dirty ? (O(b, x), x.subscribers.forEach(function(e) {
|
|
6571
6565
|
return o.add(e);
|
|
6572
|
-
})) : S !== x.res && (x.res = S, x.promise = I.resolve({ result: S }))) : (x.dirty &&
|
|
6566
|
+
})) : S !== x.res && (x.res = S, x.promise = I.resolve({ result: S }))) : (x.dirty && O(b, x), x.subscribers.forEach(function(e) {
|
|
6573
6567
|
return o.add(e);
|
|
6574
6568
|
})));
|
|
6575
6569
|
}
|
|
@@ -6592,13 +6586,13 @@ var Y = {
|
|
|
6592
6586
|
return s ? (o = i.mutate(e), e.type !== "add" && e.type !== "put" || !(50 <= e.values.length || Vn(a, e).some(function(e) {
|
|
6593
6587
|
return e == null;
|
|
6594
6588
|
})) ? (s.optimisticOps.push(e), e.mutatedParts && Nn(e.mutatedParts), o.then(function(t) {
|
|
6595
|
-
0 < t.numFailures && (
|
|
6589
|
+
0 < t.numFailures && (O(s.optimisticOps, e), (t = Jn(0, e, t)) && s.optimisticOps.push(t), e.mutatedParts && Nn(e.mutatedParts));
|
|
6596
6590
|
}), o.catch(function() {
|
|
6597
|
-
|
|
6591
|
+
O(s.optimisticOps, e), e.mutatedParts && Nn(e.mutatedParts);
|
|
6598
6592
|
})) : o.then(function(n) {
|
|
6599
6593
|
var r = Jn(0, t(t({}, e), { values: e.values.map(function(e, r) {
|
|
6600
6594
|
var i;
|
|
6601
|
-
return n.failures[r] ? e : (e = (i = a.keyPath) != null && i.includes(".") ?
|
|
6595
|
+
return n.failures[r] ? e : (e = (i = a.keyPath) != null && i.includes(".") ? E(e) : t({}, e), x(e, a.keyPath, n.results[r]), e);
|
|
6602
6596
|
}) }), n);
|
|
6603
6597
|
s.optimisticOps.push(r), queueMicrotask(function() {
|
|
6604
6598
|
return e.mutatedParts && Nn(e.mutatedParts);
|
|
@@ -6656,10 +6650,10 @@ var Y = {
|
|
|
6656
6650
|
if (l && (l.res = n), t) {
|
|
6657
6651
|
for (var r = 0, i = n.length; r < i; ++r) Object.freeze(n[r]);
|
|
6658
6652
|
Object.freeze(n);
|
|
6659
|
-
} else e.result =
|
|
6653
|
+
} else e.result = E(n);
|
|
6660
6654
|
return e;
|
|
6661
6655
|
}).catch(function(e) {
|
|
6662
|
-
return d && l &&
|
|
6656
|
+
return d && l && O(d, l), Promise.reject(e);
|
|
6663
6657
|
}), l = {
|
|
6664
6658
|
obsSet: e.obsSet,
|
|
6665
6659
|
promise: a,
|
|
@@ -7176,7 +7170,7 @@ var Y = {
|
|
|
7176
7170
|
});
|
|
7177
7171
|
},
|
|
7178
7172
|
shallowClone: S,
|
|
7179
|
-
deepClone:
|
|
7173
|
+
deepClone: E,
|
|
7180
7174
|
getObjectDiff: Bn,
|
|
7181
7175
|
cmp: B,
|
|
7182
7176
|
asap: y,
|
|
@@ -8114,4 +8108,4 @@ var vn = class {
|
|
|
8114
8108
|
}
|
|
8115
8109
|
};
|
|
8116
8110
|
//#endregion
|
|
8117
|
-
export { oe as $, bt as A, Ie as B, K as C, Pt as D, U as E, He as F, xe as G, we as H, Ve as I, ye as J, be as K, Be as L, et as M, Qe as N, Ct as O, Ue as P, ge as Q, ze as R, J as S, Lt as T, P as U, Pe as V, Ce as W, ve as X, _e as Y, N as Z, Vt as _, hn as a,
|
|
8111
|
+
export { oe as $, bt as A, Ie as B, K as C, Pt as D, U as E, He as F, xe as G, we as H, Ve as I, ye as J, be as K, Be as L, et as M, Qe as N, Ct as O, Ue as P, ge as Q, ze as R, J as S, Lt as T, P as U, Pe as V, Ce as W, ve as X, _e as Y, N as Z, Vt as _, hn as a, re as at, G as b, dn as c, T as ct, Wt as d, S as dt, ae as et, Gt as f, q as g, Ut as h, mn as i, ie as it, ht as j, St as k, un as l, te as lt, Y as m, _n as n, O as nt, pn as o, ne as ot, Ht as p, Se as q, gn as r, D as rt, fn as s, E as st, vn as t, k as tt, sn as u, C as ut, W as v, Rt as w, Bt as x, zt as y, Re as z };
|
package/dist/test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dt as e, t, u as n, z as r } from "./project-
|
|
1
|
+
import { dt as e, t, u as n, z as r } from "./project-E32sEthh.js";
|
|
2
2
|
import { DIALECTE_NAMESPACES as i, standardizeRecord as a, toTrackedRecord as o, toTreeRecord as s } from "./helpers.js";
|
|
3
3
|
import { expect as c, it as l } from "vitest";
|
|
4
4
|
//#region src/test/assert-xml/xpath-parser.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialecte/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Dialecte - Core functionality for Dialecte SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -62,10 +62,11 @@
|
|
|
62
62
|
"xml-formatter": "^3.6.7"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@dialecte/cli": "0.0.
|
|
65
|
+
"@dialecte/cli": "0.0.2",
|
|
66
66
|
"@tsconfig/node24": "^24.0.4",
|
|
67
67
|
"@types/node": "^24.12.4",
|
|
68
68
|
"@types/sax": "^1.2.7",
|
|
69
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
69
70
|
"@vitest/browser-playwright": "^4.1.8",
|
|
70
71
|
"@xmldom/xmldom": "^0.8.11",
|
|
71
72
|
"husky": "^9.1.7",
|
|
@@ -75,8 +76,8 @@
|
|
|
75
76
|
"oxlint": "^1.68.0",
|
|
76
77
|
"oxlint-tsgolint": "^0.23.0",
|
|
77
78
|
"playwright": "^1.60.0",
|
|
78
|
-
"tsx": "^4.
|
|
79
|
-
"typescript": "
|
|
79
|
+
"tsx": "^4.23.0",
|
|
80
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
80
81
|
"vite": "^8.0.16",
|
|
81
82
|
"vite-plugin-dts": "^5.0.2",
|
|
82
83
|
"vitepress": "^2.0.0-alpha.17",
|