@dialecte/core 0.2.3 → 0.2.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/helpers.js +27 -55
- package/dist/{project-q_8UeLBc.js → index-Bza8g-6Z.js} +1257 -1192
- package/dist/index.js +46 -73
- package/dist/merge-extensions-dj7By9gG.js +172 -0
- package/dist/project/io/export-document.d.ts.map +1 -1
- package/dist/project/project.d.ts +21 -8
- package/dist/project/project.d.ts.map +1 -1
- package/dist/project/types.d.ts +2 -0
- package/dist/project/types.d.ts.map +1 -1
- package/dist/test.js +8 -8
- package/package.json +1 -1
- package/dist/standardizing-FTZoR5RH.js +0 -144
package/dist/index.js
CHANGED
|
@@ -1,75 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { E as oe, t as ne } from "./index-DWV6tSGF.js";
|
|
4
|
-
function m(a) {
|
|
5
|
-
return l(a);
|
|
6
|
-
}
|
|
7
|
-
async function p(a) {
|
|
8
|
-
const { extension: s, xmlDocument: n, filename: r } = a, i = `<?xml version="1.0" encoding="UTF-8"?>
|
|
9
|
-
` + new XMLSerializer().serializeToString(n), c = m(i), o = new Blob([c], { type: "application/xml" });
|
|
10
|
-
if ("showSaveFilePicker" in window)
|
|
11
|
-
try {
|
|
12
|
-
const e = await (await window.showSaveFilePicker({
|
|
13
|
-
suggestedName: r,
|
|
14
|
-
types: [
|
|
15
|
-
{
|
|
16
|
-
description: `${s.replace(/^\./, "").toUpperCase()} Files`,
|
|
17
|
-
accept: { "application/xml": [s] }
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
})).createWritable();
|
|
21
|
-
await e.write(o), await e.close();
|
|
22
|
-
} catch (t) {
|
|
23
|
-
t.name !== "AbortError" && console.error("Save failed:", t);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const t = URL.createObjectURL(o), e = document.createElement("a");
|
|
27
|
-
e.href = t, e.download = r, document.body.appendChild(e), e.click(), e.remove(), URL.revokeObjectURL(t);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import { A as s, a as t, C as r, b as o, D as i, c as n, M as A, d as c, P as E, Q as l, T as u, e as T, f as m, g as D, h as d, i as C, j as _, k as b, l as g, m as M, n as R, o as S, p as B, q as O, r as y, s as L, t as N, u as f, v as p, w as F, y as G, z as H, B as h, E as x, F as I, G as P, H as j, I as X, J as w, K as Q, L as U, N as v } from "./index-Bza8g-6Z.js";
|
|
2
|
+
import { E as q, t as z } from "./index-DWV6tSGF.js";
|
|
30
3
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
4
|
+
s as AnyQuery,
|
|
5
|
+
t as AnyTransaction,
|
|
6
|
+
r as CHANGELOG_SCHEMA,
|
|
7
|
+
o as DOCUMENTS_SCHEMA,
|
|
8
|
+
i as DexieStore,
|
|
9
|
+
n as Document,
|
|
10
|
+
q as ERROR_CATALOG,
|
|
11
|
+
A as META_SCHEMA,
|
|
12
|
+
c as ParseSession,
|
|
13
|
+
E as Project,
|
|
14
|
+
l as Query,
|
|
15
|
+
u as TABLE_CHANGELOG,
|
|
16
|
+
T as TABLE_DOCUMENTS,
|
|
17
|
+
m as TABLE_META,
|
|
18
|
+
D as TABLE_RECORD_PREFIX,
|
|
19
|
+
d as TEMP_IDB_ID_ATTRIBUTE_NAME,
|
|
20
|
+
C as Transaction,
|
|
21
|
+
_ as buildDocumentState,
|
|
22
|
+
b as buildXmlDocument,
|
|
23
|
+
g as downloadFile,
|
|
24
|
+
M as exportDocument,
|
|
25
|
+
R as findAncestors,
|
|
26
|
+
S as findByAttributes,
|
|
27
|
+
B as findDescendants,
|
|
28
|
+
O as formatXml,
|
|
29
|
+
y as getAttribute,
|
|
30
|
+
L as getAttributeFullObject,
|
|
31
|
+
N as getAttributes,
|
|
32
|
+
f as getAttributesFullObject,
|
|
33
|
+
p as getChild,
|
|
34
|
+
F as getChildren,
|
|
35
|
+
G as getRecord,
|
|
36
|
+
H as getRecords,
|
|
37
|
+
h as getRecordsByTagName,
|
|
38
|
+
x as getTree,
|
|
39
|
+
I as importDocument,
|
|
40
|
+
P as initEmptyDocument,
|
|
41
|
+
j as isTransactionContext,
|
|
42
|
+
X as matchesAttributeFilter,
|
|
43
|
+
w as parseXmlFile,
|
|
44
|
+
Q as reconcileDocumentState,
|
|
45
|
+
U as recordTableName,
|
|
46
|
+
v as resolveStore,
|
|
47
|
+
z as throwDialecteError
|
|
75
48
|
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { i as E } from "./index-DWV6tSGF.js";
|
|
2
|
+
const D = "db-id", v = {
|
|
3
|
+
uri: "http://dialecte.dev/XML/DEV",
|
|
4
|
+
prefix: "dev"
|
|
5
|
+
}, $ = `${v.prefix}:${D}`, b = [
|
|
6
|
+
"id",
|
|
7
|
+
"tagName",
|
|
8
|
+
"namespace",
|
|
9
|
+
"attributes",
|
|
10
|
+
"children",
|
|
11
|
+
"parent",
|
|
12
|
+
"value"
|
|
13
|
+
], A = [...b, "status"], S = [...A, "tree"];
|
|
14
|
+
function d(e, t) {
|
|
15
|
+
if (typeof e != "object" || e === null)
|
|
16
|
+
return !1;
|
|
17
|
+
const n = Object.keys(e);
|
|
18
|
+
return t.every((a) => a in e) && n.every((a) => t.includes(a)) && n.length === t.length;
|
|
19
|
+
}
|
|
20
|
+
function I(e) {
|
|
21
|
+
return Array.isArray(e);
|
|
22
|
+
}
|
|
23
|
+
function z(e) {
|
|
24
|
+
return d(e, b);
|
|
25
|
+
}
|
|
26
|
+
function F(e) {
|
|
27
|
+
return d(e, A);
|
|
28
|
+
}
|
|
29
|
+
function K(e) {
|
|
30
|
+
return d(e, S);
|
|
31
|
+
}
|
|
32
|
+
function L(e, t) {
|
|
33
|
+
return e.tagName === t;
|
|
34
|
+
}
|
|
35
|
+
function V(e, t) {
|
|
36
|
+
return e.tagName === t;
|
|
37
|
+
}
|
|
38
|
+
function Y(e, t) {
|
|
39
|
+
return e.tagName === t;
|
|
40
|
+
}
|
|
41
|
+
function w(e, t) {
|
|
42
|
+
return t.elements.includes(e);
|
|
43
|
+
}
|
|
44
|
+
function B(e, t) {
|
|
45
|
+
return e.attributes.some((n) => n.name === t);
|
|
46
|
+
}
|
|
47
|
+
function M(e) {
|
|
48
|
+
return {
|
|
49
|
+
id: e.id,
|
|
50
|
+
tagName: e.tagName,
|
|
51
|
+
namespace: e.namespace,
|
|
52
|
+
attributes: e.attributes,
|
|
53
|
+
value: e.value,
|
|
54
|
+
parent: e.parent,
|
|
55
|
+
children: e.children
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function j(e) {
|
|
59
|
+
const { record: t, status: n } = e, a = n ?? ("status" in t ? t.status : "unchanged");
|
|
60
|
+
return {
|
|
61
|
+
...M(t),
|
|
62
|
+
status: a
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function P(e) {
|
|
66
|
+
const { record: t, status: n, tree: a } = e, r = a ?? ("tree" in t ? t.tree : []);
|
|
67
|
+
return {
|
|
68
|
+
...j({ record: t, status: n }),
|
|
69
|
+
tree: r
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function k(e) {
|
|
73
|
+
const { dialecteConfig: t, tagName: n, attributes: a } = e;
|
|
74
|
+
return I(a) ? a : Object.entries(a).map(
|
|
75
|
+
([r, s]) => ({
|
|
76
|
+
name: r,
|
|
77
|
+
value: s,
|
|
78
|
+
namespace: t.definition[n]?.attributes.details[r]?.namespace || void 0
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function X(e) {
|
|
83
|
+
return E(e, {
|
|
84
|
+
detail: "The record or ref is undefined"
|
|
85
|
+
}), {
|
|
86
|
+
id: e.id,
|
|
87
|
+
tagName: e.tagName
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function G(e) {
|
|
91
|
+
const { dialecteConfig: t, hooks: n, record: a } = e, { id: r, tagName: s, attributes: l, namespace: O, value: g } = a, N = r ?? crypto.randomUUID(), c = l ? k({ tagName: s, attributes: l, dialecteConfig: t }) : [], f = {
|
|
92
|
+
id: N,
|
|
93
|
+
tagName: s,
|
|
94
|
+
attributes: c,
|
|
95
|
+
namespace: O ?? {
|
|
96
|
+
prefix: "prefixNeededForNotSupportedNamespace",
|
|
97
|
+
uri: "uriNeededForNotSupportedNamespace"
|
|
98
|
+
},
|
|
99
|
+
value: g ?? "",
|
|
100
|
+
parent: a.parent ?? null,
|
|
101
|
+
children: a.children ?? []
|
|
102
|
+
};
|
|
103
|
+
if (!t.elements.includes(s)) return f;
|
|
104
|
+
const m = t.definition[s].attributes.sequence, o = t.definition[s].attributes.details, T = m.flatMap((i) => {
|
|
105
|
+
const h = o[i].required, _ = o[i]?.namespace || void 0, p = c.find((C) => C.name === i)?.value ?? (h ? o[i]?.default ?? "" : o[i]?.default);
|
|
106
|
+
return p === void 0 ? [] : [
|
|
107
|
+
{
|
|
108
|
+
name: i,
|
|
109
|
+
value: p,
|
|
110
|
+
namespace: _
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
}), y = c.filter(
|
|
114
|
+
(i) => "namespace" in i && i.namespace != null && !m.includes(i.name)
|
|
115
|
+
);
|
|
116
|
+
let u = {
|
|
117
|
+
...f,
|
|
118
|
+
namespace: t.definition[s].namespace,
|
|
119
|
+
attributes: [...T, ...y]
|
|
120
|
+
};
|
|
121
|
+
return n?.afterStandardizedRecord && (u = n.afterStandardizedRecord({
|
|
122
|
+
record: u
|
|
123
|
+
})), u;
|
|
124
|
+
}
|
|
125
|
+
function R(e, t, n, a) {
|
|
126
|
+
if (!e || !t) return;
|
|
127
|
+
const r = Object.keys(t).filter((s) => s in e);
|
|
128
|
+
E(r.length === 0, {
|
|
129
|
+
key: "EXTENSION_METHOD_COLLISION",
|
|
130
|
+
detail: `Module "${n}" has conflicting ${a} method(s): ${r.map((s) => `"${s}"`).join(", ")}`
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function H(e) {
|
|
134
|
+
const t = {}, n = {}, a = [
|
|
135
|
+
...Object.entries(e.base ?? {}),
|
|
136
|
+
...Object.entries(e.custom ?? {})
|
|
137
|
+
];
|
|
138
|
+
for (const [r, s] of a)
|
|
139
|
+
s.query && (R(
|
|
140
|
+
t[r],
|
|
141
|
+
s.query,
|
|
142
|
+
r,
|
|
143
|
+
"query"
|
|
144
|
+
), t[r] = { ...t[r], ...s.query }), s.transaction && (R(
|
|
145
|
+
n[r],
|
|
146
|
+
s.transaction,
|
|
147
|
+
r,
|
|
148
|
+
"transaction"
|
|
149
|
+
), n[r] = { ...n[r], ...s.transaction });
|
|
150
|
+
return { query: t, transaction: n };
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
$ as C,
|
|
154
|
+
v as D,
|
|
155
|
+
D as a,
|
|
156
|
+
V as b,
|
|
157
|
+
w as c,
|
|
158
|
+
I as d,
|
|
159
|
+
Y as e,
|
|
160
|
+
z as f,
|
|
161
|
+
L as g,
|
|
162
|
+
F as h,
|
|
163
|
+
B as i,
|
|
164
|
+
K as j,
|
|
165
|
+
M as k,
|
|
166
|
+
X as l,
|
|
167
|
+
H as m,
|
|
168
|
+
j as n,
|
|
169
|
+
P as o,
|
|
170
|
+
G as s,
|
|
171
|
+
k as t
|
|
172
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-document.d.ts","sourceRoot":"","sources":["../../../src/project/io/export-document.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE1E;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"export-document.d.ts","sourceRoot":"","sources":["../../../src/project/io/export-document.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE1E;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA8BhG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Document,
|
|
1
|
+
import { Document, ExtensionModules, MergedExtensions, QueryExtensions, Query } from '../document';
|
|
2
2
|
import { InitEmptyDocumentOptions, ImportDocumentOptions, ExportDocumentOptions, ProjectParams, ProjectState, DocumentRecord } from './types';
|
|
3
3
|
import { Store } from '../store';
|
|
4
4
|
import { AnyDialecteConfig, TransactionHooks } from '../types';
|
|
@@ -8,14 +8,14 @@ import { AnyDialecteConfig, TransactionHooks } from '../types';
|
|
|
8
8
|
* Owns the Store, file registry, and configuration.
|
|
9
9
|
* Documents are file-scoped views opened from a Project.
|
|
10
10
|
*/
|
|
11
|
-
export declare class Project<GenericConfig extends AnyDialecteConfig,
|
|
11
|
+
export declare class Project<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericStore extends Store = Store> {
|
|
12
12
|
private _name?;
|
|
13
13
|
private _store?;
|
|
14
14
|
private _channel?;
|
|
15
15
|
private readonly storage;
|
|
16
16
|
private configs;
|
|
17
17
|
private defaultConfigKey;
|
|
18
|
-
private
|
|
18
|
+
private mergedExtensions?;
|
|
19
19
|
private hooks?;
|
|
20
20
|
get name(): string;
|
|
21
21
|
private get store();
|
|
@@ -25,7 +25,10 @@ export declare class Project<GenericConfig extends AnyDialecteConfig, GenericExt
|
|
|
25
25
|
configs: Record<string, GenericConfig>;
|
|
26
26
|
defaultConfigKey?: string;
|
|
27
27
|
storage: ProjectParams<GenericConfig>['storage'];
|
|
28
|
-
|
|
28
|
+
extensions?: {
|
|
29
|
+
base?: GenericModules;
|
|
30
|
+
custom?: GenericModules;
|
|
31
|
+
};
|
|
29
32
|
hooks?: TransactionHooks<GenericConfig>;
|
|
30
33
|
});
|
|
31
34
|
/**
|
|
@@ -51,12 +54,12 @@ export declare class Project<GenericConfig extends AnyDialecteConfig, GenericExt
|
|
|
51
54
|
*/
|
|
52
55
|
removeDocument(documentId: string): Promise<void>;
|
|
53
56
|
/**
|
|
54
|
-
* Import
|
|
57
|
+
* Import one or more Files into the project: register, parse XML, persist records.
|
|
55
58
|
*/
|
|
56
|
-
import(
|
|
59
|
+
import(files: File[], options?: ImportDocumentOptions): Promise<Array<{
|
|
57
60
|
documentId: string;
|
|
58
61
|
recordCount: number;
|
|
59
|
-
}
|
|
62
|
+
}>>;
|
|
60
63
|
/**
|
|
61
64
|
* Export a document as an XMLDocument built from stored records.
|
|
62
65
|
*/
|
|
@@ -69,13 +72,23 @@ export declare class Project<GenericConfig extends AnyDialecteConfig, GenericExt
|
|
|
69
72
|
/**
|
|
70
73
|
* Open a file-scoped Document for querying and mutating a specific file.
|
|
71
74
|
*/
|
|
72
|
-
openDocument(documentId: string): Document<GenericConfig,
|
|
75
|
+
openDocument(documentId: string): Document<GenericConfig, MergedExtensions<GenericModules>>;
|
|
73
76
|
/**
|
|
74
77
|
* Get the config for a specific file.
|
|
75
78
|
*/
|
|
76
79
|
getDocumentConfig(documentId: string): GenericConfig | undefined;
|
|
77
80
|
undo(documentId: string): Promise<void>;
|
|
78
81
|
redo(documentId: string): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Run a query function across all documents, return the first non-undefined result.
|
|
84
|
+
* Iterates documents sequentially; stops at the first match.
|
|
85
|
+
*/
|
|
86
|
+
queryFirst<Result>(queryFunction: (query: Query<GenericConfig> & QueryExtensions<MergedExtensions<GenericModules>>) => Promise<Result | undefined>): Promise<Result | undefined>;
|
|
87
|
+
/**
|
|
88
|
+
* Run a query function across all documents, collect and flatten results.
|
|
89
|
+
* Iterates documents sequentially; merges all non-empty arrays.
|
|
90
|
+
*/
|
|
91
|
+
queryAll<Result>(queryFunction: (query: Query<GenericConfig> & QueryExtensions<MergedExtensions<GenericModules>>) => Promise<Result[]>): Promise<Result[]>;
|
|
79
92
|
/** Expose the underlying database instance. Return type is inferred from the store (Dexie for local storage). */
|
|
80
93
|
getDatabaseInstance(): ReturnType<GenericStore['getDatabaseInstance']>;
|
|
81
94
|
private refreshState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,KAAK,EACX,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC5F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAIlE;;;;;GAKG;AACH,qBAAa,OAAO,CACn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AAc,CAAC,CAAC,KAC3E,OAAO,CAAC,MAAM,EAAE,CAAC,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC;IAYpB,iHAAiH;IACjH,mBAAmB,IAAI,UAAU,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;YAIxD,YAAY;CAI1B"}
|
package/dist/project/types.d.ts
CHANGED
|
@@ -118,6 +118,8 @@ export type ExportDocumentParams = {
|
|
|
118
118
|
export type ExportDocumentOptions = {
|
|
119
119
|
/** Include internal database IDs in exported XML */
|
|
120
120
|
withDatabaseIds?: boolean;
|
|
121
|
+
/** Trigger a browser file download after export */
|
|
122
|
+
withDownload?: boolean;
|
|
121
123
|
};
|
|
122
124
|
export type ExportDocumentResult = {
|
|
123
125
|
xmlDocument: XMLDocument;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAIhF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAA;IACjB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC,CAAA;AAID;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG;IAC9C,QAAQ,EAAE,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CAAA"}
|
package/dist/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect as m, it as p } from "vitest";
|
|
2
|
-
import { x as
|
|
3
|
-
import { D as T, s as g,
|
|
2
|
+
import { x as D, D as w, P as L } from "./index-Bza8g-6Z.js";
|
|
3
|
+
import { D as T, s as g, o as O, n as M } from "./merge-extensions-dj7By9gG.js";
|
|
4
4
|
function v(B) {
|
|
5
5
|
const e = k(B);
|
|
6
6
|
if (e.length === 0)
|
|
@@ -107,7 +107,7 @@ ${C ? x({ xml: C.outerHTML }) : "(none)"}`;
|
|
|
107
107
|
function x(B) {
|
|
108
108
|
const { xml: e } = B;
|
|
109
109
|
try {
|
|
110
|
-
return
|
|
110
|
+
return D(e, { indentation: " ", collapseContent: !0 });
|
|
111
111
|
} catch {
|
|
112
112
|
return e;
|
|
113
113
|
}
|
|
@@ -1574,8 +1574,8 @@ async function E(B) {
|
|
|
1574
1574
|
defaultConfigKey: "default",
|
|
1575
1575
|
storage: { type: "local" },
|
|
1576
1576
|
hooks: a
|
|
1577
|
-
}).open(C), s = await A.import(
|
|
1578
|
-
new File([e], "source.xml", { type: "text/xml" }),
|
|
1577
|
+
}).open(C), [s] = await A.import(
|
|
1578
|
+
[new File([e], "source.xml", { type: "text/xml" })],
|
|
1579
1579
|
{ useCustomRecordsIds: !0 }
|
|
1580
1580
|
), _ = {
|
|
1581
1581
|
documentId: s.documentId,
|
|
@@ -1583,8 +1583,8 @@ async function E(B) {
|
|
|
1583
1583
|
};
|
|
1584
1584
|
let i;
|
|
1585
1585
|
if (t) {
|
|
1586
|
-
const c = await A.import(
|
|
1587
|
-
new File([t], "target.xml", { type: "text/xml" }),
|
|
1586
|
+
const [c] = await A.import(
|
|
1587
|
+
[new File([t], "target.xml", { type: "text/xml" })],
|
|
1588
1588
|
{ useCustomRecordsIds: !0 }
|
|
1589
1589
|
);
|
|
1590
1590
|
i = {
|
|
@@ -1595,7 +1595,7 @@ async function E(B) {
|
|
|
1595
1595
|
return { project: A, source: _, target: i };
|
|
1596
1596
|
}
|
|
1597
1597
|
async function ce(B) {
|
|
1598
|
-
const { databaseName: e, dialecteConfig: t, documentId: r } = B, a = new
|
|
1598
|
+
const { databaseName: e, dialecteConfig: t, documentId: r } = B, a = new w(e, {
|
|
1599
1599
|
recordSchema: t.database.recordSchema
|
|
1600
1600
|
});
|
|
1601
1601
|
return await a.open(), {
|
package/package.json
CHANGED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { i as h } from "./index-DWV6tSGF.js";
|
|
2
|
-
const C = "db-id", O = {
|
|
3
|
-
uri: "http://dialecte.dev/XML/DEV",
|
|
4
|
-
prefix: "dev"
|
|
5
|
-
}, j = `${O.prefix}:${C}`, R = [
|
|
6
|
-
"id",
|
|
7
|
-
"tagName",
|
|
8
|
-
"namespace",
|
|
9
|
-
"attributes",
|
|
10
|
-
"children",
|
|
11
|
-
"parent",
|
|
12
|
-
"value"
|
|
13
|
-
], E = [...R, "status"], S = [...E, "tree"];
|
|
14
|
-
function d(e, t) {
|
|
15
|
-
if (typeof e != "object" || e === null)
|
|
16
|
-
return !1;
|
|
17
|
-
const a = Object.keys(e);
|
|
18
|
-
return t.every((n) => n in e) && a.every((n) => t.includes(n)) && a.length === t.length;
|
|
19
|
-
}
|
|
20
|
-
function y(e) {
|
|
21
|
-
return Array.isArray(e);
|
|
22
|
-
}
|
|
23
|
-
function F(e) {
|
|
24
|
-
return d(e, R);
|
|
25
|
-
}
|
|
26
|
-
function K(e) {
|
|
27
|
-
return d(e, E);
|
|
28
|
-
}
|
|
29
|
-
function V(e) {
|
|
30
|
-
return d(e, S);
|
|
31
|
-
}
|
|
32
|
-
function Y(e, t) {
|
|
33
|
-
return e.tagName === t;
|
|
34
|
-
}
|
|
35
|
-
function w(e, t) {
|
|
36
|
-
return e.tagName === t;
|
|
37
|
-
}
|
|
38
|
-
function B(e, t) {
|
|
39
|
-
return e.tagName === t;
|
|
40
|
-
}
|
|
41
|
-
function L(e, t) {
|
|
42
|
-
return t.elements.includes(e);
|
|
43
|
-
}
|
|
44
|
-
function P(e, t) {
|
|
45
|
-
return e.attributes.some((a) => a.name === t);
|
|
46
|
-
}
|
|
47
|
-
function I(e) {
|
|
48
|
-
return {
|
|
49
|
-
id: e.id,
|
|
50
|
-
tagName: e.tagName,
|
|
51
|
-
namespace: e.namespace,
|
|
52
|
-
attributes: e.attributes,
|
|
53
|
-
value: e.value,
|
|
54
|
-
parent: e.parent,
|
|
55
|
-
children: e.children
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function x(e) {
|
|
59
|
-
const { record: t, status: a } = e, n = a ?? ("status" in t ? t.status : "unchanged");
|
|
60
|
-
return {
|
|
61
|
-
...I(t),
|
|
62
|
-
status: n
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function $(e) {
|
|
66
|
-
const { record: t, status: a, tree: n } = e, i = n ?? ("tree" in t ? t.tree : []);
|
|
67
|
-
return {
|
|
68
|
-
...x({ record: t, status: a }),
|
|
69
|
-
tree: i
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function M(e) {
|
|
73
|
-
const { dialecteConfig: t, tagName: a, attributes: n } = e;
|
|
74
|
-
return y(n) ? n : Object.entries(n).map(
|
|
75
|
-
([i, s]) => ({
|
|
76
|
-
name: i,
|
|
77
|
-
value: s,
|
|
78
|
-
namespace: t.definition[a]?.attributes.details[i]?.namespace || void 0
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
function q(e) {
|
|
83
|
-
return h(e, {
|
|
84
|
-
detail: "The record or ref is undefined"
|
|
85
|
-
}), {
|
|
86
|
-
id: e.id,
|
|
87
|
-
tagName: e.tagName
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function Q(e) {
|
|
91
|
-
const { dialecteConfig: t, hooks: a, record: n } = e, { id: i, tagName: s, attributes: l, namespace: b, value: A } = n, T = i ?? crypto.randomUUID(), o = l ? M({ tagName: s, attributes: l, dialecteConfig: t }) : [], f = {
|
|
92
|
-
id: T,
|
|
93
|
-
tagName: s,
|
|
94
|
-
attributes: o,
|
|
95
|
-
namespace: b ?? {
|
|
96
|
-
prefix: "prefixNeededForNotSupportedNamespace",
|
|
97
|
-
uri: "uriNeededForNotSupportedNamespace"
|
|
98
|
-
},
|
|
99
|
-
value: A ?? "",
|
|
100
|
-
parent: n.parent ?? null,
|
|
101
|
-
children: n.children ?? []
|
|
102
|
-
};
|
|
103
|
-
if (!t.elements.includes(s)) return f;
|
|
104
|
-
const m = t.definition[s].attributes.sequence, c = t.definition[s].attributes.details, g = m.flatMap((r) => {
|
|
105
|
-
const D = c[r].required, N = c[r]?.namespace || void 0, p = o.find((_) => _.name === r)?.value ?? (D ? c[r]?.default ?? "" : c[r]?.default);
|
|
106
|
-
return p === void 0 ? [] : [
|
|
107
|
-
{
|
|
108
|
-
name: r,
|
|
109
|
-
value: p,
|
|
110
|
-
namespace: N
|
|
111
|
-
}
|
|
112
|
-
];
|
|
113
|
-
}), v = o.filter(
|
|
114
|
-
(r) => "namespace" in r && r.namespace != null && !m.includes(r.name)
|
|
115
|
-
);
|
|
116
|
-
let u = {
|
|
117
|
-
...f,
|
|
118
|
-
namespace: t.definition[s].namespace,
|
|
119
|
-
attributes: [...g, ...v]
|
|
120
|
-
};
|
|
121
|
-
return a?.afterStandardizedRecord && (u = a.afterStandardizedRecord({
|
|
122
|
-
record: u
|
|
123
|
-
})), u;
|
|
124
|
-
}
|
|
125
|
-
export {
|
|
126
|
-
j as C,
|
|
127
|
-
O as D,
|
|
128
|
-
C as a,
|
|
129
|
-
w as b,
|
|
130
|
-
L as c,
|
|
131
|
-
y as d,
|
|
132
|
-
B as e,
|
|
133
|
-
F as f,
|
|
134
|
-
Y as g,
|
|
135
|
-
K as h,
|
|
136
|
-
P as i,
|
|
137
|
-
V as j,
|
|
138
|
-
I as k,
|
|
139
|
-
q as l,
|
|
140
|
-
x as m,
|
|
141
|
-
$ as n,
|
|
142
|
-
Q as s,
|
|
143
|
-
M as t
|
|
144
|
-
};
|