@septkit/ui 0.0.88 → 0.0.90
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/dialecte/composables/change-id-window.js +14 -0
- package/dist/dialecte/composables/use-live-data.js +154 -31
- package/dist/dialecte/create-document-store.js +16 -7
- package/dist/dropdown/combobox.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js +7293 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/helpers-Bfv2XDC-.js +351 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js +6 -0
- package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/open-connections-D59wm6nb.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/open-connections-ClJo0-Af.js} +2 -2
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/project-key-DD8DyQ8-.js +1751 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/qname-definition-C6GUFWL8.js +56 -0
- package/dist/external/.pnpm/{@dialecte_core@0.11.0 → @dialecte_core@0.12.1}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/same-json-value-boJ4pSRe.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/same-json-value-DTtSsGUF.js} +491 -370
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js +2449 -0
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js +2 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js +627 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +31 -0
- package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js +38 -0
- package/dist/external/.pnpm/@tanstack_vue-virtual@3.13.31_vue@3.5.39_typescript@5.8.3_/node_modules/@tanstack/vue-virtual/dist/esm/index.js +28 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +24 -2
- package/dist/index.d.ts +268 -7
- package/dist/index.js +7 -1
- package/dist/ui.css +1 -1
- package/dist/virtual/grid-aria.js +16 -0
- package/dist/virtual/grid-navigation.js +84 -0
- package/dist/virtual/index.js +6 -0
- package/dist/virtual/kept-range.js +32 -0
- package/dist/virtual/use-virtual-scroller.js +180 -0
- package/dist/virtual/virtual.constants.js +7 -0
- package/package.json +6 -4
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js +0 -4426
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -130
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js +0 -6
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/project-key-sr4wkl2Q.js +0 -1371
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +0 -865
- package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils.js +0 -2
package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js
DELETED
|
@@ -1,865 +0,0 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/@dialecte+core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js
|
|
2
|
-
var e = "https://dialecte.github.io/core", t = /* @__PURE__ */ new Set([
|
|
3
|
-
"throwDialecteError",
|
|
4
|
-
"createDialecteError",
|
|
5
|
-
"invariant",
|
|
6
|
-
"reportFailure"
|
|
7
|
-
]), n = {
|
|
8
|
-
UNKNOWN: {
|
|
9
|
-
code: "D0001",
|
|
10
|
-
message: "An unknown error occurred",
|
|
11
|
-
explanation: {
|
|
12
|
-
when: "A transaction's callback threw something that is not a structured error (a plain `Error`, a value); the original is its `cause`.",
|
|
13
|
-
fix: "Read `cause` and `detail`; raise your own failures with `throwDialecteError` or `invariant` so callers get a key.",
|
|
14
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
ASSERTION_FAILED: {
|
|
18
|
-
code: "D0002",
|
|
19
|
-
message: "Assertion failed",
|
|
20
|
-
explanation: {
|
|
21
|
-
when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, a store running on a dependency older than the one it supports).",
|
|
22
|
-
fix: "Read `detail`: it names the condition. Give `invariant` a key of its own when the failure is one a caller should handle.",
|
|
23
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
STORE_CONNECTION_FAILED: {
|
|
27
|
-
code: "D1001",
|
|
28
|
-
message: "Failed to open database",
|
|
29
|
-
explanation: {
|
|
30
|
-
when: "The store could not open the project's data, or could not reach what serves it (its database, a worker, a server): it failed to start, was blocked, or went unanswered; the failure is the `cause` when there is one.",
|
|
31
|
-
fix: "Check the browser supports what the store needs and that no other tab holds the project; reload, or open the project with another storage. The store's own docs name what it needs.",
|
|
32
|
-
docs: `${e}/api/project#store-errors`
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
STORE_COMMIT_FAILED: {
|
|
36
|
-
code: "D1002",
|
|
37
|
-
message: "Failed to commit changes",
|
|
38
|
-
explanation: {
|
|
39
|
-
when: "The database refused a transaction's write as it committed (the failure is the `cause`).",
|
|
40
|
-
fix: "Read `cause`; a full disk or a lost connection are the usual reasons. Retry the transaction once the store is back.",
|
|
41
|
-
docs: `${e}/api/project#store-errors`
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
STORE_RECORD_NOT_FOUND: {
|
|
45
|
-
code: "D1003",
|
|
46
|
-
message: "Record not found in database",
|
|
47
|
-
explanation: {
|
|
48
|
-
when: "A write updated or deleted a record the store does not hold in that document.",
|
|
49
|
-
fix: "Read the record again before writing: it was deleted, or the ref names another document.",
|
|
50
|
-
docs: `${e}/api/project#store-errors`
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
STORE_BULK_ADD_FAILED: {
|
|
54
|
-
code: "D1004",
|
|
55
|
-
message: "Failed to add records to database",
|
|
56
|
-
explanation: {
|
|
57
|
-
when: "The database refused to add a batch of records (import, commit); the failure is the `cause`.",
|
|
58
|
-
fix: "Read `cause`; a full disk or a closed store are the usual reasons.",
|
|
59
|
-
docs: `${e}/api/project#store-errors`
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
STORE_BULK_UPDATE_FAILED: {
|
|
63
|
-
code: "D1005",
|
|
64
|
-
message: "Failed to update records in database",
|
|
65
|
-
explanation: {
|
|
66
|
-
when: "The database refused to update a batch of records; the failure is the `cause`.",
|
|
67
|
-
fix: "Read `cause`; a full disk or a closed store are the usual reasons.",
|
|
68
|
-
docs: `${e}/api/project#store-errors`
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
STORE_DELETE_FAILED: {
|
|
72
|
-
code: "D1006",
|
|
73
|
-
message: "Failed to delete records from database",
|
|
74
|
-
explanation: {
|
|
75
|
-
when: "The database refused to delete records; the failure is the `cause`.",
|
|
76
|
-
fix: "Read `cause`; a closed store is the usual reason.",
|
|
77
|
-
docs: `${e}/api/project#store-errors`
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
STORE_NOT_WRITABLE: {
|
|
81
|
-
code: "D1007",
|
|
82
|
-
message: "Store is not writable",
|
|
83
|
-
explanation: {
|
|
84
|
-
when: "A write reached an in-memory store created read-only.",
|
|
85
|
-
fix: "Create the project with `storage: { type: 'inMemory', writable: true }` when the script writes.",
|
|
86
|
-
docs: `${e}/api/project#in-memory-storage`
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
STORE_BLOB_NOT_FOUND: {
|
|
90
|
-
code: "D1008",
|
|
91
|
-
message: "Blob not found",
|
|
92
|
-
explanation: {
|
|
93
|
-
when: "A blob operation named a blob id the store does not hold.",
|
|
94
|
-
fix: "List the blobs (`project.getBlobsByDocument`) and use an id from there.",
|
|
95
|
-
docs: `${e}/api/project#blobs`
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
STORE_DUPLICATE_ID: {
|
|
99
|
-
code: "D1009",
|
|
100
|
-
message: "An id is already taken in the store",
|
|
101
|
-
explanation: {
|
|
102
|
-
when: "A write would create a record (or register a document) with an id the store already holds; `meta.recordIds` lists them.",
|
|
103
|
-
fix: "Let core mint ids (omit `id`), or pick ids no record of the document has; `deepClone` mints new ids itself.",
|
|
104
|
-
docs: `${e}/api/project#store-errors`
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
STORE_CLOSED: {
|
|
108
|
-
code: "D1010",
|
|
109
|
-
message: "Store is closed",
|
|
110
|
-
explanation: {
|
|
111
|
-
when: "A store operation was still in flight when its store closed, or code holding the store itself (a custom store, a test context) called it after its `close()`. A project closed with `project.close()` answers `PROJECT_NOT_OPENED` instead.",
|
|
112
|
-
fix: "Await every operation before closing the store or the project; open it again before using it.",
|
|
113
|
-
docs: `${e}/api/project#lifecycle`
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
STORE_READ_FAILED: {
|
|
117
|
-
code: "D1011",
|
|
118
|
-
message: "Failed to read from database",
|
|
119
|
-
explanation: {
|
|
120
|
-
when: "The store's database failed under a read; the failure is the `cause`.",
|
|
121
|
-
fix: "Read `cause`; reopen the project. A lasting failure means the file is damaged: import its documents again.",
|
|
122
|
-
docs: `${e}/api/project#store-errors`
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
STORE_VALUE_NOT_JSON: {
|
|
126
|
-
code: "D1015",
|
|
127
|
-
message: "A value handed to the store is not JSON",
|
|
128
|
-
explanation: {
|
|
129
|
-
when: "A write handed the store a value that is not plain JSON (a function, a Map, undefined, a class instance) in a record or in document metadata.",
|
|
130
|
-
fix: "Pass plain strings, numbers, booleans, arrays and objects; `detail` names the value and the field.",
|
|
131
|
-
docs: `${e}/io/#values-a-store-keeps`
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
STORE_UNAVAILABLE: {
|
|
135
|
-
code: "D1016",
|
|
136
|
-
message: "This browser gives the page no storage for a project",
|
|
137
|
-
explanation: {
|
|
138
|
-
when: "The browser gives the page none of the storage the store needs (a private window, an API the browser lacks), so it cannot create, open or destroy the project; nothing is changed.",
|
|
139
|
-
fix: "Open the app in a normal (not private) window of a browser that supports what the project's store needs, or open the project with another storage.",
|
|
140
|
-
docs: `${e}/api/project#store-errors`
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
STORE_QUOTA_EXCEEDED: {
|
|
144
|
-
code: "D1017",
|
|
145
|
-
message: "Not enough storage left for the project",
|
|
146
|
-
explanation: {
|
|
147
|
-
when: "The origin has too little storage left for what the call needs (a new project's files, an import's room ahead of it), or the store's storage refused a write for want of space; nothing of the call applied. A store that checks the room it needs answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`); the in-memory store has no limit.",
|
|
148
|
-
fix: "Free storage for the origin (delete projects no longer needed) or import a smaller file, then try again; `meta.needed` and `meta.available` give the sizes when known.",
|
|
149
|
-
docs: `${e}/api/project#store-errors`
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
STORE_CONNECTION_LOST: {
|
|
153
|
-
code: "D1018",
|
|
154
|
-
message: "The store lost its connection",
|
|
155
|
-
explanation: {
|
|
156
|
-
when: "A call to a store whose project is served elsewhere (a worker, another realm, a server) lost its connection to what serves it: that went away or gave no answer within its budget, sent nothing for too long while the call waited (the call may still finish), or dropped this view. `meta.reason` is the store's own word for why, listed in its docs; a write's refusal carries `meta.writeId`.",
|
|
157
|
-
fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (what serves the store may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. The store's docs say what each `meta.reason` asks of the app.",
|
|
158
|
-
docs: `${e}/api/project#a-lost-connection`
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
STORE_KIND_TAKEN: {
|
|
162
|
-
code: "D1021",
|
|
163
|
-
message: "This storage type is registered already by another kind",
|
|
164
|
-
explanation: {
|
|
165
|
-
when: "`registerStorageKind({ type, kind })` named a type a kind of another `id` holds already: the first registration in the realm is kept, nothing replaced (the same `id` again does nothing: a module evaluated twice, or another copy of the package). `meta`: `type`, `registered` (the id kept), `asked` (the id refused).",
|
|
166
|
-
fix: "Register each storage type once, from one package: import the entry that registers it from a single copy, or give the other kind a type of its own.",
|
|
167
|
-
docs: `${e}/guide/development/implementing-a-store#register-a-storage-kind`
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
ELEMENT_NOT_FOUND: {
|
|
171
|
-
code: "D2001",
|
|
172
|
-
message: "Element not found",
|
|
173
|
-
explanation: {
|
|
174
|
-
when: "A ref names an element the document does not hold (deleted, never created, or from another document).",
|
|
175
|
-
fix: "Read the ref from a query in the same document (`getRecord`, `findDescendants`) instead of keeping an old one.",
|
|
176
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
ROOT_NOT_FOUND: {
|
|
180
|
-
code: "D2002",
|
|
181
|
-
message: "Root element not found",
|
|
182
|
-
explanation: {
|
|
183
|
-
when: "The document holds no root element of the dialecte's root tag (an empty or foreign document).",
|
|
184
|
-
fix: "Import a file whose root is the dialecte's root element, or create the document with `project.initEmptyDocument`.",
|
|
185
|
-
docs: `${e}/api/project#initemptydocument`
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
DUPLICATE_ID: {
|
|
189
|
-
code: "D2003",
|
|
190
|
-
message: "Duplicate element ID",
|
|
191
|
-
explanation: {
|
|
192
|
-
when: "Not raised by core itself: a dialecte or app code raises it when two elements carry the same id.",
|
|
193
|
-
fix: "Give each element its own id; let core mint them.",
|
|
194
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
ELEMENT_TAGNAME_MISMATCH: {
|
|
198
|
-
code: "D2004",
|
|
199
|
-
message: "Element tagName does not match the expected type",
|
|
200
|
-
explanation: {
|
|
201
|
-
when: "A ref's `tagName` is not the tag of the record its id names.",
|
|
202
|
-
fix: "Build refs with `toRef(record)` from a record you read, never by hand with a guessed tag.",
|
|
203
|
-
docs: `${e}/api/transaction#reforrecord`
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
INVALID_PARENT_CHILD: {
|
|
207
|
-
code: "D3001",
|
|
208
|
-
message: "Invalid parent-child relationship",
|
|
209
|
-
explanation: {
|
|
210
|
-
when: "Not raised by core itself: a dialecte or app code raises it when an element is placed under a parent the schema does not admit.",
|
|
211
|
-
fix: "Read the parent's children in the definition (`query.getDefinition`) and add the element under an admitted parent.",
|
|
212
|
-
docs: `${e}/api/transaction#addchild`
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
INVALID_ATTRIBUTE: {
|
|
216
|
-
code: "D3002",
|
|
217
|
-
message: "Invalid attribute for element",
|
|
218
|
-
explanation: {
|
|
219
|
-
when: "Not raised by core itself: a dialecte or app code raises it for an attribute the element does not declare.",
|
|
220
|
-
fix: "Use an attribute the element's definition lists.",
|
|
221
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
PROTECTED_ROOT: {
|
|
225
|
-
code: "D3003",
|
|
226
|
-
message: "Root element cannot be deleted",
|
|
227
|
-
explanation: {
|
|
228
|
-
when: "A transaction tried to delete the document's root element.",
|
|
229
|
-
fix: "Delete the root's children instead, or remove the whole document with `project.removeDocument`.",
|
|
230
|
-
docs: `${e}/api/transaction#delete`
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
REQUIRED_ATTRIBUTE_MISSING: {
|
|
234
|
-
code: "D3004",
|
|
235
|
-
message: "Required attribute is missing",
|
|
236
|
-
explanation: {
|
|
237
|
-
when: "Not raised by core itself: a dialecte or app code raises it when a required attribute is absent.",
|
|
238
|
-
fix: "Give the attribute a value when creating the element.",
|
|
239
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
UNIQUE_CONSTRAINT_VIOLATION: {
|
|
243
|
-
code: "D3005",
|
|
244
|
-
message: "Value is already used within its scope",
|
|
245
|
-
explanation: {
|
|
246
|
-
when: "Not raised by core itself: a dialecte raises it when a value is already used within the scope where it must be unique.",
|
|
247
|
-
fix: "Pick another value, or let the dialecte's hook name the element.",
|
|
248
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
UNKNOWN_NAMESPACE_PREFIX: {
|
|
252
|
-
code: "D3006",
|
|
253
|
-
message: "Unknown namespace prefix on attribute — pass it explicitly as { name, namespace: { prefix, uri } }",
|
|
254
|
-
explanation: {
|
|
255
|
-
when: "An attribute was written with a namespace key or prefix the dialecte does not declare.",
|
|
256
|
-
fix: "Use a namespace key of the dialecte's config, or pass the namespace in full: `{ name, namespace: { prefix, uri } }`.",
|
|
257
|
-
docs: `${e}/api/transaction#addchild`
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
PREFIXED_ATTRIBUTE_NAME: {
|
|
261
|
-
code: "D3007",
|
|
262
|
-
message: "Authored attribute name must be a local name — pass the namespace separately as { name, namespace }, not a prefixed name",
|
|
263
|
-
explanation: {
|
|
264
|
-
when: "An attribute was written with a prefixed name (`ext:attr`) on create or update.",
|
|
265
|
-
fix: "Pass the local name and the namespace apart: `{ name: 'attr', namespace }`.",
|
|
266
|
-
docs: `${e}/api/transaction#addchild`
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
FIXED_VALUE_VIOLATION: {
|
|
270
|
-
code: "D3008",
|
|
271
|
-
message: "Attribute value differs from the schema-fixed value",
|
|
272
|
-
explanation: {
|
|
273
|
-
when: "A write gave an attribute another value than the one the schema fixes.",
|
|
274
|
-
fix: "Leave the attribute out (core writes the fixed value) or give exactly the fixed value; `getAttributeRules` reads it.",
|
|
275
|
-
docs: `${e}/api/transaction#addchild`
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
XSI_TYPE_REQUIRED: {
|
|
279
|
-
code: "D3009",
|
|
280
|
-
message: "The element is declared with an abstract type: name a type with xsi:type",
|
|
281
|
-
explanation: {
|
|
282
|
-
when: "An element declared with an abstract type was created without naming a concrete type in `xsi:type`.",
|
|
283
|
-
fix: "Name one of the admitted types: `attributes: { 'xsi:type': '<Type>' }`; `admittedXsiTypes` lists them.",
|
|
284
|
-
docs: `${e}/api/transaction#addchild`
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
XSI_TYPE_NOT_ADMITTED: {
|
|
288
|
-
code: "D3010",
|
|
289
|
-
message: "The element may not take the type named with xsi:type",
|
|
290
|
-
explanation: {
|
|
291
|
-
when: "A write named in `xsi:type` a type the element may not take.",
|
|
292
|
-
fix: "Pick a type from `admittedXsiTypes` for that element.",
|
|
293
|
-
docs: `${e}/api/transaction#addchild`
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
XSI_TYPE_CHANGE_LEAVES_CONTENT: {
|
|
297
|
-
code: "D3011",
|
|
298
|
-
message: "The new xsi:type does not admit content the element still holds",
|
|
299
|
-
explanation: {
|
|
300
|
-
when: "An update changed `xsi:type` to a type that does not admit attributes or children the element still holds.",
|
|
301
|
-
fix: "Remove that content in the same transaction before changing the type, or pick a type that admits it.",
|
|
302
|
-
docs: `${e}/api/transaction#update`
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
XML_CHARACTER_NOT_ALLOWED: {
|
|
306
|
-
code: "D3012",
|
|
307
|
-
message: "The text holds a character XML does not allow",
|
|
308
|
-
explanation: {
|
|
309
|
-
when: "A write, an import session's own writes or an export met a character XML does not allow (a control character below U+0020 but tab, line feed and carriage return, U+FFFE, U+FFFF) in a value, a name, a prefix, a namespace URI or an id; nothing was written, no file.",
|
|
310
|
-
fix: "Remove or replace the character named in `meta.character` at `meta.part` of the record `meta.recordId` before writing or exporting it.",
|
|
311
|
-
docs: `${e}/io/#values-a-store-keeps`
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
ALREADY_COMMITTED: {
|
|
315
|
-
code: "D4001",
|
|
316
|
-
message: "Transaction already committed",
|
|
317
|
-
explanation: {
|
|
318
|
-
when: "Not raised by core today: kept for a transaction used after its commit.",
|
|
319
|
-
fix: "Start a new `doc.transaction` for further writes.",
|
|
320
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
ALREADY_FAILED: {
|
|
324
|
-
code: "D4002",
|
|
325
|
-
message: "Transaction already failed",
|
|
326
|
-
explanation: {
|
|
327
|
-
when: "Not raised by core today: kept for a transaction used after it failed.",
|
|
328
|
-
fix: "Start a new `doc.transaction`; the failed one wrote nothing.",
|
|
329
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
DATABASE_COMMIT_ERROR: {
|
|
333
|
-
code: "D4003",
|
|
334
|
-
message: "An error occurred while committing changes to the database",
|
|
335
|
-
explanation: {
|
|
336
|
-
when: "Not raised by core today: store commit failures are `STORE_COMMIT_FAILED`.",
|
|
337
|
-
fix: "Read `cause`; see `STORE_COMMIT_FAILED`.",
|
|
338
|
-
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
CONCURRENT_TRANSACTION: {
|
|
342
|
-
code: "D4004",
|
|
343
|
-
message: "A transaction is already in progress. Concurrent transactions are not supported yet — serialize them or implement a transaction queue.",
|
|
344
|
-
explanation: {
|
|
345
|
-
when: "A `doc.transaction` started on a Document while another transaction or `doc.prepare` was still running on it (a missing `await`, or a nested transaction).",
|
|
346
|
-
fix: "Await each transaction before the next; inside a transaction, write through its `tx`, never through `doc.transaction` again.",
|
|
347
|
-
docs: `${e}/api/document`
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
EXPORT_ROOT_NOT_FOUND: {
|
|
351
|
-
code: "D5001",
|
|
352
|
-
message: "Root element not found in records during export",
|
|
353
|
-
explanation: {
|
|
354
|
-
when: "The export found no root record in the document.",
|
|
355
|
-
fix: "The document is empty or damaged: import it again, or create it with `project.initEmptyDocument`.",
|
|
356
|
-
docs: `${e}/api/project#export`
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
EXPORT_ORPHAN_CHILD_REF: {
|
|
360
|
-
code: "D5002",
|
|
361
|
-
message: "Parent references non-existent child record",
|
|
362
|
-
explanation: {
|
|
363
|
-
when: "The export met a parent whose list of children names a record that does not exist.",
|
|
364
|
-
fix: "A hook or a raw write left a dangling child ref: a hook that deletes must also return the parent's `updated` operation.",
|
|
365
|
-
docs: `${e}/api/project#export`
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
PARSE_ERROR: {
|
|
369
|
-
code: "D5003",
|
|
370
|
-
message: "Failed to parse XML",
|
|
371
|
-
explanation: {
|
|
372
|
-
when: "The file given to import (or to `parseXmlDocument`) is not well-formed XML.",
|
|
373
|
-
fix: "Fix the XML where `detail` points (line and column); check the file's encoding.",
|
|
374
|
-
docs: `${e}/api/project#import`
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
IMPORT_FAILED: {
|
|
378
|
-
code: "D5004",
|
|
379
|
-
message: "Failed to import the file",
|
|
380
|
-
explanation: {
|
|
381
|
-
when: "Importing a file failed after it was parsed (a hook threw, the store refused the records); nothing of the file remains.",
|
|
382
|
-
fix: "Read `cause` and `detail`; an import hook must not read the store or throw on data it can report as a diagnostic.",
|
|
383
|
-
docs: `${e}/api/project#import`
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
IMPORT_ABORTED: {
|
|
387
|
-
code: "D5005",
|
|
388
|
-
message: "The import was aborted",
|
|
389
|
-
explanation: {
|
|
390
|
-
when: "The import's `signal` was aborted; nothing of the file remains.",
|
|
391
|
-
fix: "Nothing to fix when the abort was wanted; import the file again otherwise.",
|
|
392
|
-
docs: `${e}/api/project#import`
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
EXPORT_CONFLICT: {
|
|
396
|
-
code: "D5006",
|
|
397
|
-
message: "The document changed while it was exported",
|
|
398
|
-
explanation: {
|
|
399
|
-
when: "The document was written twice while it was being exported, so no consistent file could be read.",
|
|
400
|
-
fix: "Export when no transaction or import is writing the document, or retry.",
|
|
401
|
-
docs: `${e}/api/project#export`
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
EXPORT_ABORTED: {
|
|
405
|
-
code: "D5007",
|
|
406
|
-
message: "The export was aborted",
|
|
407
|
-
explanation: {
|
|
408
|
-
when: "The export's `signal` was aborted.",
|
|
409
|
-
fix: "Nothing to fix when the abort was wanted; export again otherwise.",
|
|
410
|
-
docs: `${e}/api/project#export`
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
EXTENSION_METHOD_COLLISION: {
|
|
414
|
-
code: "D6001",
|
|
415
|
-
message: "Extension method name collision detected",
|
|
416
|
-
explanation: {
|
|
417
|
-
when: "Two extension modules merged under one key define a method of the same name.",
|
|
418
|
-
fix: "Rename your method, or put your module under a key of its own.",
|
|
419
|
-
docs: `${e}/guide/extensions/#registering-extensions`
|
|
420
|
-
}
|
|
421
|
-
},
|
|
422
|
-
UNKNOWN_CONFIG_KEY: {
|
|
423
|
-
code: "D7001",
|
|
424
|
-
message: "Unknown config key",
|
|
425
|
-
explanation: {
|
|
426
|
-
when: "A document, a test or a declaration named a config key the dialecte does not declare.",
|
|
427
|
-
fix: "Use a key of the dialecte's `configs` (its `defaultConfigKey` when in doubt).",
|
|
428
|
-
docs: `${e}/api/dialecte#definedialecte`
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
DOCUMENT_NOT_REGISTERED: {
|
|
432
|
-
code: "D7002",
|
|
433
|
-
message: "Document not registered in project",
|
|
434
|
-
explanation: {
|
|
435
|
-
when: "A document id names no document of the open project (removed, or from another project).",
|
|
436
|
-
fix: "Use an id from `project.getDocuments()` or from the import result.",
|
|
437
|
-
docs: `${e}/api/project#document-access`
|
|
438
|
-
}
|
|
439
|
-
},
|
|
440
|
-
PROJECT_NOT_OPENED: {
|
|
441
|
-
code: "D7003",
|
|
442
|
-
message: "Project not opened",
|
|
443
|
-
explanation: {
|
|
444
|
-
when: "The project was used before `open(name)` resolved, or once `close()`, `destroy()` or another `open()` was called on it - a batch import's file whose turn came after that is refused the same.",
|
|
445
|
-
fix: "Keep the instance and await its `open(name)` before using the project; open it again after `close()` or `destroy()`, and await an `open()` of another project before using the Project again.",
|
|
446
|
-
docs: `${e}/api/project#lifecycle`
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
BLOB_NOT_FOUND: {
|
|
450
|
-
code: "D7004",
|
|
451
|
-
message: "Blob not found in store",
|
|
452
|
-
explanation: {
|
|
453
|
-
when: "`project.exportBlob` named a blob the project does not hold.",
|
|
454
|
-
fix: "Use an id from `project.getBlobsByDocument` or `getStandaloneBlobs`.",
|
|
455
|
-
docs: `${e}/api/project#blobs`
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
PROJECT_DIALECTE_MISMATCH: {
|
|
459
|
-
code: "D7008",
|
|
460
|
-
message: "The project's data is of another dialecte",
|
|
461
|
-
explanation: {
|
|
462
|
-
when: "A project stored by another dialecte was opened (nothing of it written), or what serves the store (a worker, a server) was asked for a project of a dialecte it does not serve. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `realmDialecteId` (the one asked), and `projectDialecteId` (the project's), or the dialectes served, as the store's docs name them.",
|
|
463
|
-
fix: "Open the project with the dialecte it was created with; serve every dialecte the app opens projects of, as the store's docs say.",
|
|
464
|
-
docs: `${e}/api/project#store-errors`
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
PROJECT_DIALECTE_VERSION_MISMATCH: {
|
|
468
|
-
code: "D7009",
|
|
469
|
-
message: "The project's store runs another version of the dialecte",
|
|
470
|
-
explanation: {
|
|
471
|
-
when: "What serves the project's store (a worker, a server) runs another version of the dialecte than this view: another tab's, or one this page runs already for the project (a page runs one version of each dialecte).",
|
|
472
|
-
fix: "Reload every tab of the app so they run the same version.",
|
|
473
|
-
docs: `${e}/api/project#store-errors`
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
PROJECT_DESTROY_FAILED: {
|
|
477
|
-
code: "D7010",
|
|
478
|
-
message: "The project could not be deleted",
|
|
479
|
-
explanation: {
|
|
480
|
-
when: "Destroying a project left its data in place: another tab, window or connection still holds it.",
|
|
481
|
-
fix: "Close the other tabs or windows of the app that have the project open, then destroy it again.",
|
|
482
|
-
docs: `${e}/api/project#lifecycle`
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
PROJECT_OPEN_ELSEWHERE: {
|
|
486
|
-
code: "D7011",
|
|
487
|
-
message: "The project is open in another tab, window or connection",
|
|
488
|
-
explanation: {
|
|
489
|
-
when: "Another tab or window has the project open and there is no shared connection between them; or a destroy was asked while another connection - a store or project of the name in this page, or another tab - has the project open (`meta.connections`, where the store counts them).",
|
|
490
|
-
fix: "Close the project in the other tab, window or connection, then open or destroy it here again.",
|
|
491
|
-
docs: `${e}/api/project#lifecycle`
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
|
-
PROJECT_DESTROYED_WHILE_AWAY: {
|
|
495
|
-
code: "D7013",
|
|
496
|
-
message: "The project was deleted while this view was away",
|
|
497
|
-
explanation: {
|
|
498
|
-
when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, what serves its store started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",
|
|
499
|
-
fix: "Tell the user the project was deleted elsewhere; close it in this view (`project.close()`), then open it again by its name for what is there now, or choose another.",
|
|
500
|
-
docs: `${e}/api/project#lifecycle`
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
PROJECT_NAME_INVALID: {
|
|
504
|
-
code: "D7014",
|
|
505
|
-
message: "The project's name cannot name its files",
|
|
506
|
-
explanation: {
|
|
507
|
-
when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a store may name its files after both, which no file can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",
|
|
508
|
-
fix: "Give the project a name of its own (and the dialecte an id) other than an empty one, `.` or `..`.",
|
|
509
|
-
docs: `${e}/api/project#lifecycle`
|
|
510
|
-
}
|
|
511
|
-
},
|
|
512
|
-
PROJECT_STORAGE_NOT_REGISTERED: {
|
|
513
|
-
code: "D7018",
|
|
514
|
-
message: "The project's storage type is not registered",
|
|
515
|
-
explanation: {
|
|
516
|
-
when: "A project was opened (or destroyed by name), or a test asked for a test store, on a `storage.type` no kind is registered for in this realm: core serves `local`, `inMemory` and `custom` itself, every other type comes from the entry that registers it (`registerStorageKind`). Nothing was opened. `meta`: `project`, `type`.",
|
|
517
|
-
fix: "Import the entry that registers the type once in the app's entry (for tests, in the test runner's setup file), before the first project opens on it; or open the project on another storage. Imported already? A kind is shared by every copy of @dialecte/core of the same storage version in the realm: one registered by a copy of another version (a package bringing its own core) is not seen - align the core versions.",
|
|
518
|
-
docs: `${e}/guide/development/implementing-a-store#register-a-storage-kind`
|
|
519
|
-
}
|
|
520
|
-
},
|
|
521
|
-
DOCUMENT_PATH_INVALID: {
|
|
522
|
-
code: "D7030",
|
|
523
|
-
message: "A document's path is not valid",
|
|
524
|
-
explanation: {
|
|
525
|
-
when: "A document's path breaks a rule (empty, `.` or `..` segment, backslash, invisible character, not NFC, too long), names another file than the document's, changes its extension, or was handed to `project.import` of several files; nothing was written. `detail` says which rule.",
|
|
526
|
-
fix: "Write the path relative, joined by `/`, in NFC, ending with the document's file name; pass a path to `importFile`, not to `import`.",
|
|
527
|
-
docs: `${e}/api/project#a-document-s-path`
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
DOCUMENT_PATH_TAKEN: {
|
|
531
|
-
code: "D7031",
|
|
532
|
-
message: "A document's path is another document's place",
|
|
533
|
-
explanation: {
|
|
534
|
-
when: "Another document already holds the place (`meta.takenBy`), a document still importing included: the same path, a path under another document's file, or a file at a folder another document's path uses.",
|
|
535
|
-
fix: "Choose a path no other document holds, or move the other document first.",
|
|
536
|
-
docs: `${e}/api/project#a-document-s-path`
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
};
|
|
540
|
-
new Set(Object.values(n).map((e) => e.code));
|
|
541
|
-
function r(e, t) {
|
|
542
|
-
throw i(e, t);
|
|
543
|
-
}
|
|
544
|
-
function i(e, t) {
|
|
545
|
-
let r = typeof e == "string" ? {
|
|
546
|
-
key: e,
|
|
547
|
-
...n[e]
|
|
548
|
-
} : e, i = {
|
|
549
|
-
code: r.code,
|
|
550
|
-
key: r.key,
|
|
551
|
-
message: t.message ?? r.message,
|
|
552
|
-
detail: t.detail,
|
|
553
|
-
method: o((/* @__PURE__ */ Error()).stack),
|
|
554
|
-
ref: t.ref,
|
|
555
|
-
meta: t.meta,
|
|
556
|
-
cause: t.cause
|
|
557
|
-
}, a = Error(t.detail);
|
|
558
|
-
return a.cause = i, a;
|
|
559
|
-
}
|
|
560
|
-
function a(e) {
|
|
561
|
-
if (!(e instanceof Error)) return;
|
|
562
|
-
let t = e.cause;
|
|
563
|
-
if (!(!t || t instanceof Error) && typeof t.key == "string" && typeof t.code == "string") return t;
|
|
564
|
-
}
|
|
565
|
-
function o(e) {
|
|
566
|
-
if (!e) return "unknown";
|
|
567
|
-
let t = e.split("\n").slice(1).map((e) => e.match(/\bat\s+(?:async\s+)?(\S+)(?:\s+\[as\s+[^\]]+\])?\s+\(([^)]+)\)/)).find((e) => !s(e?.[1])), n = t?.[1]?.replace(/^Object\./, ""), r = t?.[2];
|
|
568
|
-
if (!r || !n) return n ?? "unknown";
|
|
569
|
-
let i = r.match(/(\w[\w-]*\/src\/[^?:]+)/);
|
|
570
|
-
return i ? `${i[1].replace(/\.[^/.]+$/, "")}::${n}` : n;
|
|
571
|
-
}
|
|
572
|
-
function s(e) {
|
|
573
|
-
return e ? t.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
|
|
574
|
-
}
|
|
575
|
-
var c = /[ \t\r\n]+/g;
|
|
576
|
-
function l(e) {
|
|
577
|
-
let { text: t } = e, n = 0, r = t.length;
|
|
578
|
-
for (; n < r && f(t.charCodeAt(n));) n++;
|
|
579
|
-
for (; r > n && f(t.charCodeAt(r - 1));) r--;
|
|
580
|
-
return n === 0 && r === t.length ? t : t.slice(n, r);
|
|
581
|
-
}
|
|
582
|
-
function u(e) {
|
|
583
|
-
return e.text.replace(c, " ");
|
|
584
|
-
}
|
|
585
|
-
function d(e) {
|
|
586
|
-
let t = l({ text: e.text });
|
|
587
|
-
return t && u({ text: t });
|
|
588
|
-
}
|
|
589
|
-
function f(e) {
|
|
590
|
-
return e === 32 || e === 10 || e === 9 || e === 13;
|
|
591
|
-
}
|
|
592
|
-
var p = "db-id", m = {
|
|
593
|
-
uri: "http://dialecte.dev/XML/DEV",
|
|
594
|
-
prefix: "dev"
|
|
595
|
-
}, h = `${m.prefix}:${p}`, g = {
|
|
596
|
-
uri: "http://www.w3.org/2001/XMLSchema-instance",
|
|
597
|
-
prefix: "xsi"
|
|
598
|
-
}, _ = "http://www.w3.org/2000/xmlns/";
|
|
599
|
-
`${g.prefix}${g.uri}`;
|
|
600
|
-
function v(e) {
|
|
601
|
-
return e.namespace?.uri === g.uri && e.name.split(":").at(-1) === "type";
|
|
602
|
-
}
|
|
603
|
-
function y(e) {
|
|
604
|
-
let { namespaceOf: t } = e, n = l({ text: e.value });
|
|
605
|
-
if (n.startsWith("{")) {
|
|
606
|
-
let e = n.indexOf("}");
|
|
607
|
-
return e === -1 ? void 0 : w({
|
|
608
|
-
uri: n.slice(1, e),
|
|
609
|
-
local: n.slice(e + 1)
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
let r = n.indexOf(":"), i = r === -1 ? "" : n.slice(0, r), a = r === -1 ? n : n.slice(r + 1), o = i ? t(i) : t("") ?? "";
|
|
613
|
-
if (o !== void 0) return w({
|
|
614
|
-
uri: o,
|
|
615
|
-
local: a
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
function b(e) {
|
|
619
|
-
let { dialecteConfig: t, record: n } = e, r = n.attributes.find(v);
|
|
620
|
-
if (r === void 0 || typeof r.value != "string") return;
|
|
621
|
-
let i = x({
|
|
622
|
-
dialecteConfig: t,
|
|
623
|
-
attributes: n.attributes
|
|
624
|
-
});
|
|
625
|
-
return y({
|
|
626
|
-
value: r.value,
|
|
627
|
-
namespaceOf: i
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
function x(e) {
|
|
631
|
-
let { dialecteConfig: t, attributes: n } = e, r = Object.values(t.namespaces);
|
|
632
|
-
return function(e) {
|
|
633
|
-
if (!e) return t.namespaces.default.uri;
|
|
634
|
-
let i = r.find((t) => t.prefix === e);
|
|
635
|
-
if (i) return i.uri;
|
|
636
|
-
let a = n.find((t) => t.name === `xmlns:${e}` || t.namespace?.uri === "http://www.w3.org/2000/xmlns/" && t.name === e);
|
|
637
|
-
return typeof a?.value == "string" ? a.value : void 0;
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
function S(e) {
|
|
641
|
-
let { dialecteConfig: t, value: n, namespaceOf: r } = e, i = y({
|
|
642
|
-
value: n,
|
|
643
|
-
namespaceOf: r
|
|
644
|
-
});
|
|
645
|
-
if (i === void 0) return n;
|
|
646
|
-
if (i.namespace === t.namespaces.default.uri) return i.local;
|
|
647
|
-
let a = Object.values(t.namespaces).find((e) => e.uri === i.namespace && e.prefix !== "");
|
|
648
|
-
return a ? `${a.prefix}:${i.local}` : n;
|
|
649
|
-
}
|
|
650
|
-
function C(e) {
|
|
651
|
-
let { dialecteConfig: t, attributes: n, namespaceOf: r } = e;
|
|
652
|
-
return n.map((e) => v(e) && typeof e.value == "string" ? {
|
|
653
|
-
...e,
|
|
654
|
-
value: S({
|
|
655
|
-
dialecteConfig: t,
|
|
656
|
-
value: e.value,
|
|
657
|
-
namespaceOf: r
|
|
658
|
-
})
|
|
659
|
-
} : e);
|
|
660
|
-
}
|
|
661
|
-
function w(e) {
|
|
662
|
-
let { uri: t, local: n } = e;
|
|
663
|
-
return {
|
|
664
|
-
clark: t ? `{${t}}${n}` : n,
|
|
665
|
-
namespace: t,
|
|
666
|
-
local: n
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
function T(e) {
|
|
670
|
-
let { dialecteConfig: t, record: n, parentDefinition: r } = e, i = t.definition[n.tagName];
|
|
671
|
-
if (i === void 0) return;
|
|
672
|
-
let a = E({
|
|
673
|
-
dialecteConfig: t,
|
|
674
|
-
record: n,
|
|
675
|
-
tagLevel: i,
|
|
676
|
-
parentDefinition: r
|
|
677
|
-
}), o = D({
|
|
678
|
-
dialecteConfig: t,
|
|
679
|
-
record: n
|
|
680
|
-
}), s = a === i ? Object.values(i.declarations ?? {}).concat(i) : [a], c = o !== void 0 && s.some((e) => e.variants?.includes(o)) ? t.types[o] : void 0;
|
|
681
|
-
return a === i && c === void 0 && i.declarations === void 0 ? i : O({
|
|
682
|
-
tagLevel: i,
|
|
683
|
-
declaration: a,
|
|
684
|
-
type: c
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
function E(e) {
|
|
688
|
-
let { dialecteConfig: t, record: n, tagLevel: r, parentDefinition: i } = e, a = r.declarations;
|
|
689
|
-
if (a === void 0) return r;
|
|
690
|
-
let o = i ?? (n.parent ? t.definition[n.parent.tagName] : void 0), s = o?.children.details[n.tagName]?.declarations;
|
|
691
|
-
if (s !== void 0) {
|
|
692
|
-
let e = Object.keys(s), t = n.namespace?.uri ?? (e.length === 1 ? e[0] : void 0), i = t === void 0 ? void 0 : s[t];
|
|
693
|
-
if (i !== void 0) return i.length === 1 ? a[i[0]] ?? r : r;
|
|
694
|
-
}
|
|
695
|
-
let c = o === void 0 || o.children.any === !0, l = n.namespace?.uri;
|
|
696
|
-
return !c || l === void 0 ? r : Object.values(a).find((e) => e.global && e.namespace.uri === l) ?? r;
|
|
697
|
-
}
|
|
698
|
-
function D(e) {
|
|
699
|
-
return b(e)?.clark;
|
|
700
|
-
}
|
|
701
|
-
function O(e) {
|
|
702
|
-
let { tagLevel: t, declaration: n, type: r } = e, i = k.get(n) ?? /* @__PURE__ */ new Map();
|
|
703
|
-
k.set(n, i);
|
|
704
|
-
let a = i.get(r);
|
|
705
|
-
if (a?.tag === t.tag && a.parents === t.parents) return a;
|
|
706
|
-
let { declarations: o, abstractType: s, ...c } = n, l = {
|
|
707
|
-
...c,
|
|
708
|
-
tag: t.tag,
|
|
709
|
-
parents: t.parents
|
|
710
|
-
}, u = r === void 0 ? {
|
|
711
|
-
...l,
|
|
712
|
-
...n.abstractType ? { abstractType: !0 } : {}
|
|
713
|
-
} : {
|
|
714
|
-
...l,
|
|
715
|
-
attributes: n.attributes.identityFields === void 0 ? r.attributes : {
|
|
716
|
-
...r.attributes,
|
|
717
|
-
identityFields: n.attributes.identityFields
|
|
718
|
-
},
|
|
719
|
-
children: r.children,
|
|
720
|
-
contentModel: r.contentModel,
|
|
721
|
-
textContent: r.textContent
|
|
722
|
-
};
|
|
723
|
-
return u.contentModel === void 0 && delete u.contentModel, u.textContent === void 0 && delete u.textContent, i.set(r, u), u;
|
|
724
|
-
}
|
|
725
|
-
var k = /* @__PURE__ */ new WeakMap();
|
|
726
|
-
function A(e) {
|
|
727
|
-
let { dialecteConfig: t, record: n, attributeName: r } = e, i = t.elements.includes(n.tagName), a = i ? T({
|
|
728
|
-
dialecteConfig: t,
|
|
729
|
-
record: n
|
|
730
|
-
}) : void 0, o = a?.attributes.details[r];
|
|
731
|
-
return {
|
|
732
|
-
isKnownElement: i,
|
|
733
|
-
isDefined: !!o,
|
|
734
|
-
isRequired: !!o?.required,
|
|
735
|
-
isIdentityField: a?.attributes.identityFields?.includes(r) ?? !1,
|
|
736
|
-
fixed: o?.fixed,
|
|
737
|
-
default: o?.default,
|
|
738
|
-
namespace: o?.namespace || void 0
|
|
739
|
-
};
|
|
740
|
-
}
|
|
741
|
-
function j(e) {
|
|
742
|
-
let { dialecteConfig: t, record: n, attributeName: r, defaults: i } = e;
|
|
743
|
-
if (i === "none") return;
|
|
744
|
-
let a = A({
|
|
745
|
-
dialecteConfig: t,
|
|
746
|
-
record: n,
|
|
747
|
-
attributeName: r
|
|
748
|
-
});
|
|
749
|
-
if (i === "required") return a.isRequired || a.fixed !== void 0 ? a.fixed ?? a.default ?? "" : void 0;
|
|
750
|
-
if (a.fixed !== void 0) return a.fixed;
|
|
751
|
-
if (a.default) return a.default;
|
|
752
|
-
}
|
|
753
|
-
function M(e) {
|
|
754
|
-
let t = e.lastIndexOf(":");
|
|
755
|
-
return t === -1 ? e : e.slice(t + 1);
|
|
756
|
-
}
|
|
757
|
-
var N = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\uFFFE\uFFFF]/;
|
|
758
|
-
function P(e, t) {
|
|
759
|
-
if (e) return;
|
|
760
|
-
let { detail: n, key: i = "ASSERTION_FAILED", ref: a, meta: o } = t;
|
|
761
|
-
r(i, {
|
|
762
|
-
detail: n,
|
|
763
|
-
ref: a,
|
|
764
|
-
meta: o
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function F(e, t) {
|
|
768
|
-
if (t) return Object.values(e.namespaces).find((e) => e.prefix === t);
|
|
769
|
-
}
|
|
770
|
-
function I(e, t) {
|
|
771
|
-
return e.namespaces[t] ?? F(e, t);
|
|
772
|
-
}
|
|
773
|
-
function L(e, t) {
|
|
774
|
-
let n = e.namespace?.uri ?? "", r = t.namespace?.uri ?? "";
|
|
775
|
-
return n === r ? e.name === t.name ? 0 : e.name < t.name ? -1 : 1 : n < r ? -1 : 1;
|
|
776
|
-
}
|
|
777
|
-
function R(e, t) {
|
|
778
|
-
let n = t.flatMap((t) => e.filter((e) => e.name === t)), r = e.filter((e) => !t.includes(e.name)).sort(L);
|
|
779
|
-
return [...n, ...r];
|
|
780
|
-
}
|
|
781
|
-
function z(e) {
|
|
782
|
-
let { wildcard: t, namespaceUri: n } = e;
|
|
783
|
-
return t === void 0 ? !1 : t.namespace === void 0 ? !(t.notNamespace ?? []).includes(n) : t.namespace.includes(n);
|
|
784
|
-
}
|
|
785
|
-
function B(e) {
|
|
786
|
-
let { parentTagName: t, children: n, childrenConfig: r, definition: i } = e, a = r[t];
|
|
787
|
-
if (!a || a.length === 0) return n;
|
|
788
|
-
let o = new Set(a), s = /* @__PURE__ */ new Map();
|
|
789
|
-
for (let e of o) s.set(e, []);
|
|
790
|
-
let c = [];
|
|
791
|
-
for (let e of n) {
|
|
792
|
-
let t = s.get(e.tagName);
|
|
793
|
-
t ? t.push(e) : c.push(e);
|
|
794
|
-
}
|
|
795
|
-
let l = i?.[t], u = i && c.length > 0 && l?.children.any === !0 ? V({
|
|
796
|
-
contentModel: l.contentModel,
|
|
797
|
-
order: o
|
|
798
|
-
}) : [], d = u.map(() => []), f = u.length > 0 ? [] : c;
|
|
799
|
-
if (i && u.length > 0) for (let e of c) {
|
|
800
|
-
let t = H({
|
|
801
|
-
slots: u,
|
|
802
|
-
admitted: d,
|
|
803
|
-
definition: i,
|
|
804
|
-
tagName: e.tagName
|
|
805
|
-
});
|
|
806
|
-
t === -1 ? f.push(e) : d[t].push(e);
|
|
807
|
-
}
|
|
808
|
-
let p = [];
|
|
809
|
-
for (let e of o) {
|
|
810
|
-
u.length > 0 && U({
|
|
811
|
-
ordered: p,
|
|
812
|
-
slots: u,
|
|
813
|
-
admitted: d,
|
|
814
|
-
before: e
|
|
815
|
-
});
|
|
816
|
-
let t = s.get(e);
|
|
817
|
-
t && t.length && p.push(...t);
|
|
818
|
-
}
|
|
819
|
-
return u.length > 0 && U({
|
|
820
|
-
ordered: p,
|
|
821
|
-
slots: u,
|
|
822
|
-
admitted: d,
|
|
823
|
-
before: void 0
|
|
824
|
-
}), p.push(...f), p;
|
|
825
|
-
}
|
|
826
|
-
function V(e) {
|
|
827
|
-
let { contentModel: t, order: n } = e, r = [], i = /* @__PURE__ */ new Set(), a = [];
|
|
828
|
-
function o(e, t) {
|
|
829
|
-
let s = t * (e.maxOccurs ?? Infinity);
|
|
830
|
-
if (e.kind === "any") a.push({
|
|
831
|
-
wildcard: e,
|
|
832
|
-
capacity: s
|
|
833
|
-
});
|
|
834
|
-
else if (e.kind === "element") {
|
|
835
|
-
if (!n.has(e.name) || i.has(e.name)) return;
|
|
836
|
-
i.add(e.name);
|
|
837
|
-
for (let t of a) r.push({
|
|
838
|
-
...t,
|
|
839
|
-
before: e.name
|
|
840
|
-
});
|
|
841
|
-
a = [];
|
|
842
|
-
} else for (let t of e.particles) o(t, s);
|
|
843
|
-
}
|
|
844
|
-
t && o(t, 1);
|
|
845
|
-
for (let e of a) r.push({
|
|
846
|
-
...e,
|
|
847
|
-
before: void 0
|
|
848
|
-
});
|
|
849
|
-
return r;
|
|
850
|
-
}
|
|
851
|
-
function H(e) {
|
|
852
|
-
let { slots: t, admitted: n, definition: r, tagName: i } = e, a = r[i]?.namespace.uri;
|
|
853
|
-
return a === void 0 ? -1 : t.findIndex((e, t) => n[t].length < e.capacity && z({
|
|
854
|
-
wildcard: e.wildcard,
|
|
855
|
-
namespaceUri: a
|
|
856
|
-
}));
|
|
857
|
-
}
|
|
858
|
-
function U(e) {
|
|
859
|
-
let { ordered: t, slots: n, admitted: r, before: i } = e;
|
|
860
|
-
n.forEach((e, n) => {
|
|
861
|
-
e.before === i && t.push(...r[n]);
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
//#endregion
|
|
865
|
-
export { y as A, l as B, b as D, v as E, _ as F, a as G, n as K, p as M, m as N, x as O, g as R, j as S, S as T, i as V, r as W, B as a, A as b, R as c, P as f, N as h, h as j, C as k, F as l, L as o, e as q, z as s, I as u, T as w, M as y, d as z };
|