@es-joy/jsoe 0.29.0 → 0.31.0
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/.claude/scheduled_tasks.lock +1 -0
- package/CHANGES.md +11 -0
- package/README.md +3 -0
- package/dist/fundamentalTypes/dateType.d.ts +8 -3
- package/dist/fundamentalTypes/dateType.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/search/fundamentalTypes/arraySearchType.d.ts +11 -4
- package/dist/search/fundamentalTypes/arraySearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/bigintSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/blobSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/dateSearchType.d.ts +8 -3
- package/dist/search/fundamentalTypes/dateSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/domexceptionSearchType.d.ts +5 -5
- package/dist/search/fundamentalTypes/domexceptionSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/enumSearchType.d.ts +4 -0
- package/dist/search/fundamentalTypes/enumSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/fileSearchType.d.ts +19 -10
- package/dist/search/fundamentalTypes/fileSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/filelistSearchType.d.ts +4 -12
- package/dist/search/fundamentalTypes/filelistSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/functionSearchType.d.ts +4 -4
- package/dist/search/fundamentalTypes/functionSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/mapSearchType.d.ts +8 -4
- package/dist/search/fundamentalTypes/mapSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/numberSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/objectSearchType.d.ts +10 -4
- package/dist/search/fundamentalTypes/objectSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/regexpSearchType.d.ts +7 -1
- package/dist/search/fundamentalTypes/regexpSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/setSearchType.d.ts +5 -4
- package/dist/search/fundamentalTypes/setSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/stringSearchType.d.ts +9 -1
- package/dist/search/fundamentalTypes/stringSearchType.d.ts.map +1 -1
- package/dist/search/fundamentalTypes/symbolSearchType.d.ts.map +1 -1
- package/dist/search/index.d.ts +18 -8
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/queryTree.d.ts +15 -1
- package/dist/search/queryTree.d.ts.map +1 -1
- package/dist/search/queryTreeBuilders.d.ts +8 -1
- package/dist/search/queryTreeBuilders.d.ts.map +1 -1
- package/dist/search/searchElementUtils.d.ts +17 -8
- package/dist/search/searchElementUtils.d.ts.map +1 -1
- package/dist/search/searchUtils.d.ts +350 -18
- package/dist/search/searchUtils.d.ts.map +1 -1
- package/dist/search/subTypes/blobHTMLSearchType.d.ts +32 -5
- package/dist/search/subTypes/blobHTMLSearchType.d.ts.map +1 -1
- package/dist/search/subTypes/recordSearchType.d.ts +4 -4
- package/dist/search/subTypes/recordSearchType.d.ts.map +1 -1
- package/dist/search/subTypes/tupleSearchType.d.ts +3 -3
- package/dist/search/subTypes/tupleSearchType.d.ts.map +1 -1
- package/dist/search/superTypes/buffersourceSearchType.d.ts.map +1 -1
- package/dist/search/unions/unionFamilySearchType.d.ts.map +1 -1
- package/package.json +3 -3
- package/pnpm-workspace.yaml +26 -26
- package/src/fundamentalTypes/dateType.js +9 -4
- package/src/fundamentalTypes/regexpType.js +1 -1
- package/src/jsoe.css +204 -0
- package/src/search/fundamentalTypes/arraySearchType.js +42 -7
- package/src/search/fundamentalTypes/bigintSearchType.js +7 -1
- package/src/search/fundamentalTypes/blobSearchType.js +2 -1
- package/src/search/fundamentalTypes/booleanSearchType.js +1 -1
- package/src/search/fundamentalTypes/dateSearchType.js +113 -20
- package/src/search/fundamentalTypes/domexceptionSearchType.js +39 -10
- package/src/search/fundamentalTypes/enumSearchType.js +5 -1
- package/src/search/fundamentalTypes/fileSearchType.js +64 -11
- package/src/search/fundamentalTypes/filelistSearchType.js +32 -7
- package/src/search/fundamentalTypes/functionSearchType.js +36 -12
- package/src/search/fundamentalTypes/mapSearchType.js +43 -13
- package/src/search/fundamentalTypes/numberSearchType.js +8 -1
- package/src/search/fundamentalTypes/objectSearchType.js +236 -17
- package/src/search/fundamentalTypes/regexpSearchType.js +29 -5
- package/src/search/fundamentalTypes/setSearchType.js +33 -7
- package/src/search/fundamentalTypes/stringSearchType.js +11 -2
- package/src/search/fundamentalTypes/symbolSearchType.js +2 -1
- package/src/search/index.js +26 -9
- package/src/search/queryTree.js +14 -2
- package/src/search/queryTreeBuilders.js +12 -2
- package/src/search/searchElementUtils.js +108 -24
- package/src/search/searchUtils.js +576 -24
- package/src/search/subTypes/blobHTMLSearchType.js +202 -9
- package/src/search/subTypes/recordSearchType.js +34 -13
- package/src/search/subTypes/tupleSearchType.js +51 -10
- package/src/search/superTypes/SpecialRealNumberSearchType.js +1 -1
- package/src/search/superTypes/buffersourceSearchType.js +7 -1
- package/src/search/unions/unionFamilySearchType.js +8 -0
- package/vendor/zod/classic/schemas.d.ts +3 -1
- package/vendor/zod/core/versions.js +1 -1
|
@@ -30,11 +30,75 @@ export function buildPathLabel(schemaObject: import("../formats/schema.js").Zode
|
|
|
30
30
|
* `typeNamespace` closed over inside a `$define` mixin, which is installed
|
|
31
31
|
* once on the shared custom-element prototype the first time a tag is
|
|
32
32
|
* defined - nothing here depends on a per-instance closure at all.
|
|
33
|
-
* @param {
|
|
33
|
+
* @param {Element} root
|
|
34
34
|
* @param {string} selector
|
|
35
35
|
* @returns {HTMLElement|undefined}
|
|
36
36
|
*/
|
|
37
|
-
export function findOwnControl(root:
|
|
37
|
+
export function findOwnControl(root: Element, selector: string): HTMLElement | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Whether `el` sits inside an `objectSearchType.js` has-property row whose
|
|
40
|
+
* own "Has"/"Doesn't have" tri-state is *already* explicitly chosen (not
|
|
41
|
+
* "(any)") - if so, that existence assertion alone is already a complete
|
|
42
|
+
* constraint for the row, so a per-field "no absent values" requirement
|
|
43
|
+
* inside it (a range's own "at least one bound", `buildRangeInputsPair`'s
|
|
44
|
+
* doc) should be relaxed. `setDescendantsRequired` handles this for plain
|
|
45
|
+
* `required`-attribute controls, but a range pair's requirement is
|
|
46
|
+
* re-asserted imperatively on every `input`/`change` via `setCustomValidity`
|
|
47
|
+
* (`syncRangeValidity`, `dateSearchType.js`'s own equivalent) - clearing it
|
|
48
|
+
* once wouldn't stick past the next keystroke, so those call this directly,
|
|
49
|
+
* live, instead.
|
|
50
|
+
*
|
|
51
|
+
* Returns `false` (not exempted) when `el` also sits inside a
|
|
52
|
+
* `buildOptInFieldset` fieldset (`jsoeSearchOptInFieldset--*`), for the same
|
|
53
|
+
* reason `setDescendantsRequired` skips those controls: a dimension range
|
|
54
|
+
* nested in `makeDomShapeSearchType`'s per-dimension opt-in gate (say,
|
|
55
|
+
* DOMRect's "Width") is only reachable at all once its own checkbox is
|
|
56
|
+
* checked, and checking it is itself the user's explicit request to
|
|
57
|
+
* constrain *that* facet - an enclosing "Has property" shouldn't then let
|
|
58
|
+
* its "From"/"To" sit blank and still read as valid, any more than
|
|
59
|
+
* `fileSearchType.js`'s "Name" facet should once opted into.
|
|
60
|
+
* @param {Element} el
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
export function isExemptedByAncestorHasProperty(el: Element): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Re-runs every `input`/`change`-driven validator within `root` by
|
|
66
|
+
* re-dispatching those events on each descendant form control -
|
|
67
|
+
* `objectSearchType.js`'s `buildHasPropertyRow` calls this when its own
|
|
68
|
+
* "Has"/"Doesn't have" tri-state changes, since a range pair (or anything
|
|
69
|
+
* else reactive) nested anywhere inside the child widget needs to
|
|
70
|
+
* re-evaluate `isExemptedByAncestorHasProperty` against the *new* tri-state
|
|
71
|
+
* value - nothing else would otherwise prompt it to run again until the
|
|
72
|
+
* user happens to interact with that specific field themselves.
|
|
73
|
+
* @param {Element} root
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
export function revalidateDescendants(root: Element): void;
|
|
77
|
+
/**
|
|
78
|
+
* The `buildRangeInputsPair` cross-validation check, factored out so a
|
|
79
|
+
* consuming widget's own `$define.connectedCallback` (custom elements,
|
|
80
|
+
* search plan §8) can also call it - the `input`/`change` events
|
|
81
|
+
* `buildRangeInputsPair` wires below only fire from the user's *first*
|
|
82
|
+
* interaction, so a freshly-built pair with both ends still empty would
|
|
83
|
+
* otherwise stay "valid" by the browser's reckoning (no `setCustomValidity`
|
|
84
|
+
* call has ever run yet) until then, contradicting the "leaving both blank
|
|
85
|
+
* is invalid" rule documented below. `connectedCallback` is a native
|
|
86
|
+
* Custom Elements lifecycle method (invoked once per instance the moment it
|
|
87
|
+
* connects to the document), so calling this from there closes that gap
|
|
88
|
+
* without needing any build-time live element reference.
|
|
89
|
+
*
|
|
90
|
+
* "Leaving both blank is invalid" is itself relaxed when
|
|
91
|
+
* `isExemptedByAncestorHasProperty` says so - a range nested as a has-
|
|
92
|
+
* property row's own child widget (e.g. a `date`/`number` property) needs
|
|
93
|
+
* the same "'Has property X' is already a complete constraint" relief
|
|
94
|
+
* `setDescendantsRequired` gives `required`-attribute controls, just
|
|
95
|
+
* re-checked live on every call rather than toggled once, since this runs
|
|
96
|
+
* imperatively on every keystroke regardless.
|
|
97
|
+
* @param {Element} root
|
|
98
|
+
* @param {string} [key]
|
|
99
|
+
* @returns {void}
|
|
100
|
+
*/
|
|
101
|
+
export function syncRangeValidity(root: Element, key?: string): void;
|
|
38
102
|
/**
|
|
39
103
|
* A "from"/"to" pair of native inputs sharing one `type`, for the OR-range/
|
|
40
104
|
* Is-Not-Range README affordance (number/bigint/buffersource; `date` uses
|
|
@@ -48,6 +112,25 @@ export function findOwnControl(root: HTMLElement, selector: string): HTMLElement
|
|
|
48
112
|
* apart two same-class controls belonging to the *same* widget, so those
|
|
49
113
|
* need distinct classes. Leave it at the default `''` for the common case
|
|
50
114
|
* of a widget with only one range pair.
|
|
115
|
+
*
|
|
116
|
+
* Cross-validates the pair via the native Constraint Validation API,
|
|
117
|
+
* surfaced by `jsoe.css`'s `input:invalid` styling and a real `<form>`'s
|
|
118
|
+
* `reportValidity`/`checkValidity` (`src/search/index.js`): leaving *both*
|
|
119
|
+
* ends blank is invalid - the same "no absent values" reasoning
|
|
120
|
+
* `buildLiteralRegexControls`'s Value input documents, an added range row
|
|
121
|
+
* needs at least one bound to mean anything - and if both ends are filled
|
|
122
|
+
* with "To" less than "From", that's invalid too. An open-ended range (only
|
|
123
|
+
* one end filled) stays valid. A row nested under an
|
|
124
|
+
* `objectSearchType.js` required-property's opt-in `<fieldset disabled>`
|
|
125
|
+
* (or, for `dateSearchType.js`'s own equivalent pair, its own
|
|
126
|
+
* "Invalid date" fieldset) is unaffected either way, since a disabled field
|
|
127
|
+
* is excluded from constraint validation entirely. Every caller must also
|
|
128
|
+
* call `syncRangeValidity` from its own `connectedCallback` (see that
|
|
129
|
+
* function's doc) so the initial both-blank state is actually invalid from
|
|
130
|
+
* the moment the widget exists, not just after the user's first keystroke.
|
|
131
|
+
* `dateSearchType.js`'s own `datetime-local` pair needs the same two checks
|
|
132
|
+
* but isn't built through this helper (`buildDateInputControl` handles its
|
|
133
|
+
* own ISO-slicing), so it wires an equivalent handler itself.
|
|
51
134
|
* @param {{
|
|
52
135
|
* name: string,
|
|
53
136
|
* key?: string,
|
|
@@ -81,22 +164,34 @@ export function readRangeInputsPair(el: HTMLElement, key?: string): {
|
|
|
81
164
|
* A `<select multiple>` populated from a fixed candidate list - used by
|
|
82
165
|
* `enum`/`multiSelect`/`literalSet` leaf controls (README: "multiple
|
|
83
166
|
* select").
|
|
167
|
+
*
|
|
168
|
+
* `required`, when set, makes leaving *every* option unselected invalid -
|
|
169
|
+
* `<select multiple required>` is natively satisfied by one or more
|
|
170
|
+
* selections, no custom validity code needed. `enumSearchType.js` passes
|
|
171
|
+
* this (an enum widget has nothing else to constrain, so an empty selection
|
|
172
|
+
* is never a meaningful "no constraint" state - same "no absent values"
|
|
173
|
+
* reasoning as `buildLiteralRegexControls`'s Value input); other callers
|
|
174
|
+
* (`regexpSearchType.js`'s Flags, `SpecialRealNumberSearchType.js`) leave it
|
|
175
|
+
* at the default `false`, since an empty selection there legitimately means
|
|
176
|
+
* "no constraint on this facet" alongside a widget that has other facets.
|
|
84
177
|
* @param {{
|
|
85
178
|
* name: string,
|
|
86
|
-
* options: (string|[value: string, title: string])[]
|
|
179
|
+
* options: (string|[value: string, title: string])[],
|
|
180
|
+
* required?: boolean
|
|
87
181
|
* }} cfg
|
|
88
182
|
* @returns {JamilihArray}
|
|
89
183
|
*/
|
|
90
|
-
export function buildMultiSelect({ name, options }: {
|
|
184
|
+
export function buildMultiSelect({ name, options, required }: {
|
|
91
185
|
name: string;
|
|
92
186
|
options: (string | [value: string, title: string])[];
|
|
187
|
+
required?: boolean;
|
|
93
188
|
}): JamilihArray;
|
|
94
189
|
/**
|
|
95
190
|
* Reads back a `buildMultiSelect` into the selected values, `[]` if none.
|
|
96
|
-
* @param {
|
|
191
|
+
* @param {Element} el
|
|
97
192
|
* @returns {string[]}
|
|
98
193
|
*/
|
|
99
|
-
export function readMultiSelect(el:
|
|
194
|
+
export function readMultiSelect(el: Element): string[];
|
|
100
195
|
/**
|
|
101
196
|
* A tri-state "has property" control for one already-chosen property name
|
|
102
197
|
* (README: "Has property <property pull-down>", "avoid listing
|
|
@@ -126,35 +221,71 @@ export function buildHasPropertyToggle({ name, propertyName }: {
|
|
|
126
221
|
* `dommatrixSearchType.js`'s "Is/Is not Readonly" and "Is/Is not 3d" side
|
|
127
222
|
* by side); see `buildRangeInputsPair`'s doc for why. Leave it at the
|
|
128
223
|
* default `''` for the common case of a widget with only one tri-state.
|
|
129
|
-
*
|
|
224
|
+
* `onChange`, when given, wires the select's own `change` event too (in
|
|
225
|
+
* addition to whatever the caller reads back via `readTriStateSelect` at
|
|
226
|
+
* `getQuery` time) - `dateSearchType.js`'s "Is valid/invalid date" tri-state
|
|
227
|
+
* uses it to disable the (otherwise irrelevant) From/To range while
|
|
228
|
+
* "Invalid date" is selected.
|
|
229
|
+
*
|
|
230
|
+
* `required`, when set, makes leaving the select at "(any)" invalid - the
|
|
231
|
+
* "(any)" option's `value: ''` below is exactly what native `required`
|
|
232
|
+
* treats as "nothing selected", the same trick `unionFamilySearchType.js`'s
|
|
233
|
+
* "Has type" select and `buildMultiSelect`'s `required` use.
|
|
234
|
+
* `booleanSearchType.js` passes this (a boolean widget has nothing else to
|
|
235
|
+
* constrain, so "(any)" is never a meaningful "no constraint" state - same
|
|
236
|
+
* "no absent values" reasoning as `buildLiteralRegexControls`'s Value
|
|
237
|
+
* input); other callers (`numberSearchType.js`'s "Is/Is Not Integer",
|
|
238
|
+
* `dommatrixSearchType.js`'s readonly/3d) leave it at the default `false`,
|
|
239
|
+
* since those are one of *several* facets in their own widget, where
|
|
240
|
+
* "(any)" legitimately means "no constraint on this facet".
|
|
241
|
+
* @param {{
|
|
242
|
+
* name: string, key?: string, trueLabel: string, falseLabel: string,
|
|
243
|
+
* onChange?: (this: HTMLElement) => void, required?: boolean
|
|
244
|
+
* }} cfg
|
|
130
245
|
* @returns {JamilihArray}
|
|
131
246
|
*/
|
|
132
|
-
export function buildTriStateSelect({ name, key, trueLabel, falseLabel }: {
|
|
247
|
+
export function buildTriStateSelect({ name, key, trueLabel, falseLabel, onChange, required }: {
|
|
133
248
|
name: string;
|
|
134
249
|
key?: string;
|
|
135
250
|
trueLabel: string;
|
|
136
251
|
falseLabel: string;
|
|
252
|
+
onChange?: (this: HTMLElement) => void;
|
|
253
|
+
required?: boolean;
|
|
137
254
|
}): JamilihArray;
|
|
138
255
|
/**
|
|
139
256
|
* Reads back a `buildTriStateSelect`/`buildHasPropertyToggle` - pass the
|
|
140
257
|
* same `key` it was built with. `''` (any) maps to `undefined`.
|
|
141
|
-
* @param {
|
|
258
|
+
* @param {Element} el
|
|
142
259
|
* @param {string} [key]
|
|
143
260
|
* @returns {boolean|undefined}
|
|
144
261
|
*/
|
|
145
|
-
export function readTriStateSelect(el:
|
|
262
|
+
export function readTriStateSelect(el: Element, key?: string): boolean | undefined;
|
|
146
263
|
/**
|
|
147
264
|
* A single checkbox - the only search affordance the README grants
|
|
148
265
|
* `undefined`/`void`/`null`/`NaN` ("Require present"; they have "no
|
|
149
266
|
* variants to allow for distinct search", since existence only becomes a
|
|
150
267
|
* meaningful question once the path is optional or nested in a union), and
|
|
151
|
-
* also used by `recordSearchType.js` for
|
|
152
|
-
*
|
|
268
|
+
* also used by `recordSearchType.js`/`mapSearchType.js` for their "require
|
|
269
|
+
* same entry" toggle.
|
|
270
|
+
*
|
|
271
|
+
* `checked`, when set, pre-checks the checkbox; `disabled` locks it there,
|
|
272
|
+
* non-interactive. `makePresenceOnlySearchType` passes both: the checkbox
|
|
273
|
+
* is that leaf's *only* possible constraint, and its whole schema type has
|
|
274
|
+
* exactly one value ("no variants to allow for distinct search" above) -
|
|
275
|
+
* there is no second state worth offering a choice between, so this simply
|
|
276
|
+
* asserts the one meaningful thing outright rather than making the user
|
|
277
|
+
* pointlessly check a box that could only ever mean one thing. "require
|
|
278
|
+
* same entry" leaves both at their `false` defaults (interactive,
|
|
279
|
+
* unchecked), since that's one optional facet alongside a map/record's own
|
|
280
|
+
* key/value matches, not the whole widget's sole, single-valued constraint.
|
|
281
|
+
* @param {{name: string, label: string, checked?: boolean, disabled?: boolean}} cfg
|
|
153
282
|
* @returns {JamilihArray}
|
|
154
283
|
*/
|
|
155
|
-
export function buildCheckbox({ name, label }: {
|
|
284
|
+
export function buildCheckbox({ name, label, checked, disabled }: {
|
|
156
285
|
name: string;
|
|
157
286
|
label: string;
|
|
287
|
+
checked?: boolean;
|
|
288
|
+
disabled?: boolean;
|
|
158
289
|
}): JamilihArray;
|
|
159
290
|
/**
|
|
160
291
|
* Reads back a `buildCheckbox`.
|
|
@@ -174,17 +305,59 @@ export function readCheckbox(el: HTMLElement): boolean;
|
|
|
174
305
|
* (e.g. `errorSearchType.js`'s `message`/`name`/`fileName`/`stack`); see
|
|
175
306
|
* `buildRangeInputsPair`'s doc for why. Leave it at the default `''` for
|
|
176
307
|
* the common case of a widget with only one such control.
|
|
177
|
-
*
|
|
308
|
+
*
|
|
309
|
+
* The Value input is `required`: unlike an untouched range/checkbox/select
|
|
310
|
+
* (whose empty/default state unambiguously means "no constraint"), a mode
|
|
311
|
+
* is always selected here (there is no "(any)" option), so an empty Value
|
|
312
|
+
* next to it is never a meaningful "no constraint" state - it just means
|
|
313
|
+
* the row was added and never finished. That leaves the whole form invalid
|
|
314
|
+
* from the moment such a row exists (`buildSearchChoices`'s `<form>`,
|
|
315
|
+
* `src/search/index.js`) until either a value is entered or (for an
|
|
316
|
+
* `objectSearchType.js` has-property row) the row is removed via its own
|
|
317
|
+
* "Remove" button.
|
|
318
|
+
*
|
|
319
|
+
* `onModeChange`, when given, wires the mode select's own `change` event
|
|
320
|
+
* too (in addition to whatever the caller reads back via
|
|
321
|
+
* `readLiteralRegexQuery` at `getQuery` time) - `regexpSearchType.js` uses
|
|
322
|
+
* it to show/hide its Flags multi-select, which only makes sense while
|
|
323
|
+
* "Matches regex" is the chosen mode.
|
|
324
|
+
*
|
|
325
|
+
* `flagOptions`, when given, adds a Flags multi-select (options passed in
|
|
326
|
+
* by the caller - most callers pass `regexpType.js`'s own `allowedFlags`,
|
|
327
|
+
* the same list `regexpSearchType.js` uses for the actual regexp's own
|
|
328
|
+
* flags - kept out of this generic module to avoid it depending on a
|
|
329
|
+
* specific fundamental type), shown only while "Matches regex" is the
|
|
330
|
+
* chosen mode, the same `$options` a Mongo-flavored `$regex` accepts
|
|
331
|
+
* alongside it - a plain literal/substring match has no regex to apply
|
|
332
|
+
* flags to, so it stays hidden otherwise. `regexpSearchType.js`'s own call
|
|
333
|
+
* (matching against the regexp's `.source` text, not to be confused with
|
|
334
|
+
* its separate, bespoke Flags control for the regexp's *actual* flags)
|
|
335
|
+
* leaves this unset, since a flag there would have no real regex of its own
|
|
336
|
+
* to apply to.
|
|
337
|
+
*
|
|
338
|
+
* While "Matches regex" is chosen, the Value input is also live syntax-
|
|
339
|
+
* checked (`syncLiteralRegexValidity`, below) against
|
|
340
|
+
* `new RegExp(value, flags)` - an unparsable pattern (or one only invalid
|
|
341
|
+
* for the currently-selected flags, e.g. `u`/`v`'s stricter escape rules)
|
|
342
|
+
* sets a custom validity message rather than silently accepting it.
|
|
343
|
+
* @param {{
|
|
344
|
+
* name: string, key?: string, onModeChange?: (this: HTMLElement) => void,
|
|
345
|
+
* flagOptions?: string[]
|
|
346
|
+
* }} cfg
|
|
178
347
|
* @returns {JamilihArray}
|
|
179
348
|
*/
|
|
180
|
-
export function buildLiteralRegexControls({ name, key }: {
|
|
349
|
+
export function buildLiteralRegexControls({ name, key, onModeChange, flagOptions }: {
|
|
181
350
|
name: string;
|
|
182
351
|
key?: string;
|
|
352
|
+
onModeChange?: (this: HTMLElement) => void;
|
|
353
|
+
flagOptions?: string[];
|
|
183
354
|
}): JamilihArray;
|
|
184
355
|
/**
|
|
185
356
|
* Reads back `buildLiteralRegexControls` into the corresponding
|
|
186
357
|
* `literalSet`/`regex`/`notContains` leaf - pass the same `key` it was
|
|
187
|
-
* built with.
|
|
358
|
+
* built with. A `regex` leaf's `$options` is only ever populated when the
|
|
359
|
+
* caller built this with `flagOptions` (see that function's doc) and at
|
|
360
|
+
* least one flag is currently selected.
|
|
188
361
|
* @param {HTMLElement} el
|
|
189
362
|
* @param {string} path
|
|
190
363
|
* @param {string} [key]
|
|
@@ -216,10 +389,169 @@ export function buildLengthSizeControls({ name, min, max, includeSparse }: {
|
|
|
216
389
|
/**
|
|
217
390
|
* Reads back `buildLengthSizeControls` into one `lengthSize` leaf, or
|
|
218
391
|
* `undefined` if neither the size nor the sparse control was set.
|
|
219
|
-
* @param {
|
|
392
|
+
* @param {Element} el
|
|
220
393
|
* @param {string} path
|
|
221
394
|
* @returns {import('./queryTree.js').QueryLengthSizeLeaf|undefined}
|
|
222
395
|
*/
|
|
223
|
-
export function readLengthSizeQuery(el:
|
|
396
|
+
export function readLengthSizeQuery(el: Element, path: string): import("./queryTree.js").QueryLengthSizeLeaf | undefined;
|
|
397
|
+
/**
|
|
398
|
+
* Wraps arbitrary markup - a recursed child search widget's array, or a
|
|
399
|
+
* fixed facet's own controls (`buildLiteralRegexControls`'s output, say) -
|
|
400
|
+
* in an opt-in "Search on this" checkbox around a disabled `<fieldset>`.
|
|
401
|
+
* For a facet that's one of *several* independent, individually-optional
|
|
402
|
+
* constraints within a parent widget (array/set/tuple/filelist's element
|
|
403
|
+
* match(es); map/record's key/value; `fileSearchType.js`'s name/content-
|
|
404
|
+
* type), this keeps that facet's own `required` controls (if it has any)
|
|
405
|
+
* from forcing the *whole* form invalid just by the facet existing -
|
|
406
|
+
* generalizes `objectSearchType.js`'s original required-property row (see
|
|
407
|
+
* that file's history) into a shared helper once enough call sites needed
|
|
408
|
+
* the identical checkbox+fieldset shape.
|
|
409
|
+
*
|
|
410
|
+
* `key` distinguishes multiple opt-in fieldsets *within one widget* (e.g.
|
|
411
|
+
* `mapSearchType.js`'s "key" and "value"); see `buildRangeInputsPair`'s doc
|
|
412
|
+
* for why. Leave it at the default `''` for a widget with only one.
|
|
413
|
+
*
|
|
414
|
+
* The checkbox's own `name` attribute is `${name}-optIn`, not the bare
|
|
415
|
+
* `name` passed in: a caller's `name` is typically shared with (a prefix
|
|
416
|
+
* of) the wrapped content's own field names (`mapSearchType.js`'s "value"
|
|
417
|
+
* facet, say, names its checkbox from the same `name` its inner value
|
|
418
|
+
* widget builds its own `-value`-suffixed `<input>` from), and callers
|
|
419
|
+
* cannot always predict what suffix a given recursed `SearchTypeObject`
|
|
420
|
+
* will pick - the fixed `-optIn` suffix here guarantees no collision
|
|
421
|
+
* regardless, without every caller needing to reason about it.
|
|
422
|
+
*
|
|
423
|
+
* Call `wireOptInFieldset` once, right after this is built into real DOM
|
|
424
|
+
* (e.g. inside a `jml(...)` caller, same as `objectSearchType.js`'s rows
|
|
425
|
+
* do), to actually connect the checkbox to the fieldset's `disabled` state -
|
|
426
|
+
* this function only builds the static markup (default unchecked/disabled).
|
|
427
|
+
* @param {{
|
|
428
|
+
* name: string, key?: string, label: string, children: JamilihArray[]
|
|
429
|
+
* }} cfg
|
|
430
|
+
* @returns {JamilihArray[]}
|
|
431
|
+
*/
|
|
432
|
+
export function buildOptInFieldset({ name, key, label, children }: {
|
|
433
|
+
name: string;
|
|
434
|
+
key?: string;
|
|
435
|
+
label: string;
|
|
436
|
+
children: JamilihArray[];
|
|
437
|
+
}): JamilihArray[];
|
|
438
|
+
/**
|
|
439
|
+
* Reads back a `buildOptInFieldset`'s checkbox - pass the same `key` it was
|
|
440
|
+
* built with.
|
|
441
|
+
* @param {Element} root
|
|
442
|
+
* @param {string} [key]
|
|
443
|
+
* @returns {boolean}
|
|
444
|
+
*/
|
|
445
|
+
export function readOptInChecked(root: Element, key?: string): boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Connects a `buildOptInFieldset`'s checkbox to toggle its own fieldset's
|
|
448
|
+
* `disabled` state - call once, synchronously, right after both are live
|
|
449
|
+
* DOM nodes (see that function's doc). Pass the same `key` it was built
|
|
450
|
+
* with.
|
|
451
|
+
*
|
|
452
|
+
* `onToggle`, when given, is called after each toggle (with the checkbox as
|
|
453
|
+
* `this`) - `mapSearchType.js`/`recordSearchType.js`/`fileSearchType.js`
|
|
454
|
+
* use it to re-run their own `syncAtLeastOneCheck` whenever one of their
|
|
455
|
+
* (exactly two) opt-in facets changes, since checking/unchecking either one
|
|
456
|
+
* can change whether "at least one" is satisfied.
|
|
457
|
+
* @param {Element} root
|
|
458
|
+
* @param {string} [key]
|
|
459
|
+
* @param {((this: HTMLInputElement) => void)} [onToggle]
|
|
460
|
+
* @returns {void}
|
|
461
|
+
*/
|
|
462
|
+
export function wireOptInFieldset(root: Element, key?: string, onToggle?: ((this: HTMLInputElement) => void)): void;
|
|
463
|
+
/**
|
|
464
|
+
* A visually-hidden but still-rendered (and so still constraint-validation-
|
|
465
|
+
* eligible - see `jsoe.css`'s `.searchAtLeastOneSentinel`, the same
|
|
466
|
+
* "visually-hidden" pattern used for accessibility, which keeps an element
|
|
467
|
+
* off-screen without `display: none`/`hidden` triggering the Constraint
|
|
468
|
+
* Validation API's own "not rendered" exemption) sentinel control, for a
|
|
469
|
+
* widget with several independent optional facets where leaving *every one*
|
|
470
|
+
* unconfigured should be invalid even though no single facet is itself
|
|
471
|
+
* always required (`mapSearchType.js`/`recordSearchType.js`'s key/value,
|
|
472
|
+
* `fileSearchType.js`'s name/content-type). Pair with `syncAtLeastOneCheck`.
|
|
473
|
+
* @returns {JamilihArray}
|
|
474
|
+
*/
|
|
475
|
+
export function buildAtLeastOneSentinel(): JamilihArray;
|
|
476
|
+
/**
|
|
477
|
+
* Sets a `buildAtLeastOneSentinel`'s custom validity from a live check -
|
|
478
|
+
* call once at `connectedCallback` time for the initial state (a freshly-
|
|
479
|
+
* built widget has satisfied none of its facets yet) and again whenever a
|
|
480
|
+
* facet that could change the answer does (an opt-in checkbox toggling, a
|
|
481
|
+
* recursed child's own `input`/`change`).
|
|
482
|
+
*
|
|
483
|
+
* Also relaxed, independently of `isSatisfied`, while
|
|
484
|
+
* `isExemptedByAncestorHasProperty` says an enclosing
|
|
485
|
+
* `objectSearchType.js` has-property row's own "Has"/"Doesn't have"
|
|
486
|
+
* already provides a complete constraint - the same relief
|
|
487
|
+
* `syncRangeValidity` and `dateSearchType.js`'s own range validator give
|
|
488
|
+
* their "at least one bound" rule, needed here too since a has-property
|
|
489
|
+
* row's own child could just as easily be an `array`/`map`/`file`/etc.
|
|
490
|
+
* whose *own* sole constraint is this same "at least one facet" sentinel
|
|
491
|
+
* rather than a plain `required` attribute or a range pair.
|
|
492
|
+
*
|
|
493
|
+
* Every call re-registers `isSatisfied` (keyed by `root` in a `WeakMap`, so
|
|
494
|
+
* it never leaks past the element's own lifetime) for `resyncAtLeastOne` to
|
|
495
|
+
* call later. This exists because not every "at least one" widget's own
|
|
496
|
+
* answer changes via a plain `input`/`change` event - `objectSearchType.js`
|
|
497
|
+
* itself is the reason: its sentinel changes when a row is added/removed
|
|
498
|
+
* (a button click, and a structural DOM change, not a value change on any
|
|
499
|
+
* control), which `revalidateDescendants`' blanket event-redispatch can
|
|
500
|
+
* never reach, unlike `array`/`map`/etc.'s own opt-in checkboxes and size
|
|
501
|
+
* inputs. `objectSearchType.js`'s `buildHasPropertyRow` calls
|
|
502
|
+
* `resyncAtLeastOne` directly instead, precisely because it can't rely on
|
|
503
|
+
* redispatched events reaching every possible child type.
|
|
504
|
+
* @param {Element} root
|
|
505
|
+
* @param {() => boolean} isSatisfied
|
|
506
|
+
* @returns {void}
|
|
507
|
+
*/
|
|
508
|
+
export function syncAtLeastOneCheck(root: Element, isSatisfied: () => boolean): void;
|
|
509
|
+
/**
|
|
510
|
+
* Re-runs every `syncAtLeastOneCheck` registered anywhere within `root`
|
|
511
|
+
* (itself included) - see that function's doc for why this exists
|
|
512
|
+
* alongside `revalidateDescendants` rather than relying on it alone.
|
|
513
|
+
* @param {Element} root
|
|
514
|
+
* @returns {void}
|
|
515
|
+
*/
|
|
516
|
+
export function resyncAtLeastOne(root: Element): void;
|
|
517
|
+
/**
|
|
518
|
+
* Toggles the native `required` attribute on every originally-`required`
|
|
519
|
+
* control inside `root`, leaving everything else (visibility, `disabled`)
|
|
520
|
+
* alone - unlike `buildOptInFieldset`'s `<fieldset disabled>`, this keeps
|
|
521
|
+
* the whole subtree fully interactive, for a case where an ancestor's own
|
|
522
|
+
* choice already provides a complete constraint on its own, but should
|
|
523
|
+
* still let the recursed child *optionally* add a further constraint on
|
|
524
|
+
* top rather than blocking interaction with it entirely.
|
|
525
|
+
* `objectSearchType.js`'s `buildHasPropertyRow` uses this for its "Has"/
|
|
526
|
+
* "Doesn't have" tri-state: once existence is explicitly asserted either
|
|
527
|
+
* way, the child's own required inputs (whatever type it turns out to be)
|
|
528
|
+
* should stop forcing it to be filled in, while a user who still wants to
|
|
529
|
+
* combine "Has property X" with "X matches Y" can keep typing into it -
|
|
530
|
+
* `dateSearchType.js`'s "Valid"/"Invalid date" tri-state needs the
|
|
531
|
+
* equivalent relaxation for its own (structurally different, so not built
|
|
532
|
+
* through this helper) range pair.
|
|
533
|
+
*
|
|
534
|
+
* Relaxing (`required: false`) marks each control it touches with
|
|
535
|
+
* `data-jsoe-was-required` before clearing the IDL `required` property -
|
|
536
|
+
* setting that property to `false` reflects back to *removing* the
|
|
537
|
+
* `required` content attribute entirely (standard boolean-attribute
|
|
538
|
+
* reflection), so a later call to restore it can't rely on `[required]`
|
|
539
|
+
* still matching that element; it looks for the marker instead.
|
|
540
|
+
*
|
|
541
|
+
* Skips any control inside a `buildOptInFieldset` fieldset
|
|
542
|
+
* (`jsoeSearchOptInFieldset--*`): that facet already has its own gate on
|
|
543
|
+
* whether it applies at all (the checkbox's `disabled` toggle exempts it
|
|
544
|
+
* from constraint validation while unchecked), so an enclosing "Has
|
|
545
|
+
* property" shouldn't also strip its `required` - a user who explicitly
|
|
546
|
+
* opts into e.g. `fileSearchType.js`'s "Name" facet under a "Has property"
|
|
547
|
+
* ancestor still needs to fill in the Value it requires, or uncheck "Name"
|
|
548
|
+
* again; only the widget's own `buildAtLeastOneSentinel` (which *is*
|
|
549
|
+
* exempted, via `isExemptedByAncestorHasProperty`) should be satisfied by
|
|
550
|
+
* "Has property" alone.
|
|
551
|
+
* @param {Element} root
|
|
552
|
+
* @param {boolean} required
|
|
553
|
+
* @returns {void}
|
|
554
|
+
*/
|
|
555
|
+
export function setDescendantsRequired(root: Element, required: boolean): void;
|
|
224
556
|
export type JamilihArray = import("../types.js").JamilihArray;
|
|
225
557
|
//# sourceMappingURL=searchUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchUtils.d.ts","sourceRoot":"","sources":["../../src/search/searchUtils.js"],"names":[],"mappings":"AAGA;;GAEG;AAEH;;;;;;;;;GASG;AACH,6CAJW,OAAO,sBAAsB,EAAE,WAAW,GAAC,SAAS,QACpD,MAAM,GACJ,MAAM,CASlB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qCAJW,
|
|
1
|
+
{"version":3,"file":"searchUtils.d.ts","sourceRoot":"","sources":["../../src/search/searchUtils.js"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
export default blobHTMLSearchType;
|
|
2
2
|
export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {import('../searchDispatch.js').SearchTypeObject} SearchTypeObject
|
|
5
|
-
*/
|
|
6
3
|
/**
|
|
7
4
|
* Blob HTML: XPath, CSS selectors, full text search, regex search of raw
|
|
8
|
-
* HTML (README) - a mode `<select>` plus one
|
|
5
|
+
* HTML (README) - a mode `<select>` plus one value control, the same
|
|
9
6
|
* "pick a mode, give it one value" shape as `buildLiteralRegexControls`
|
|
10
7
|
* (`searchUtils.js`), but not built through it: the four modes and the
|
|
11
8
|
* `blobHTML` leaf kind they produce are specific to this one type, with no
|
|
12
|
-
* second caller to share the helper with.
|
|
9
|
+
* second caller to share the helper with. The value control is a single-line
|
|
10
|
+
* `<input>` for XPath/CSS-selector/regex, but swaps to a `<textarea>` for
|
|
11
|
+
* "Full text search" mode alone, since a search phrase in a body of text is
|
|
12
|
+
* the one mode actually expected to run to more than one line - both share
|
|
13
|
+
* the same class, so the mode `<select>`'s `change` handler (and `getQuery`)
|
|
14
|
+
* only need the tag name to tell them apart. Only the currently-visible one
|
|
15
|
+
* of the pair is ever `required` (toggled alongside `hidden` by the mode
|
|
16
|
+
* `change` handler): a `required` field that's merely hidden, rather than
|
|
17
|
+
* also un-required, still blocks the form's validity even though the user
|
|
18
|
+
* has no way to see or fill it. "CSS selector" is listed ahead of "XPath"
|
|
19
|
+
* (and is the default mode) as the option most jsoe users will recognize.
|
|
20
|
+
*
|
|
21
|
+
* The `change` handler also checks `isExemptedByAncestorHasProperty` before
|
|
22
|
+
* (re-)asserting `required` on the now-visible control: nested as an
|
|
23
|
+
* optional object property's own child widget, an enclosing "Has property"
|
|
24
|
+
* already provides a complete constraint on its own (the same relief
|
|
25
|
+
* `setDescendantsRequired` gives other `required`-attribute controls), but
|
|
26
|
+
* that relief is a one-time toggle applied *before* `revalidateDescendants`
|
|
27
|
+
* re-dispatches a synthetic `change` on this very `<select>` - without this
|
|
28
|
+
* check, that synthetic event would immediately reassert `required` on
|
|
29
|
+
* whichever control the current mode makes visible, undoing the exemption
|
|
30
|
+
* `setDescendantsRequired` had just granted.
|
|
31
|
+
*
|
|
32
|
+
* "Regex search of raw HTML" gets its own Flags multi-select (the same
|
|
33
|
+
* `regexpType.js` `allowedFlags` list `stringSearchType.js`'s literal/regex
|
|
34
|
+
* control passes as `buildLiteralRegexControls`'s `flagOptions`), shown only
|
|
35
|
+
* while that mode is chosen, folded into the `blobHTML` leaf's own
|
|
36
|
+
* `$options` (mirroring `QueryRegexLeaf`'s field of the same name) - and,
|
|
37
|
+
* via `syncBlobHTMLValueValidity`, included when syntax-checking the Value
|
|
38
|
+
* itself, since the chosen flags can affect whether a given pattern is
|
|
39
|
+
* actually valid.
|
|
13
40
|
* @type {SearchTypeObject}
|
|
14
41
|
*/
|
|
15
42
|
declare const blobHTMLSearchType: SearchTypeObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobHTMLSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/blobHTMLSearchType.js"],"names":[],"mappings":";+
|
|
1
|
+
{"version":3,"file":"blobHTMLSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/blobHTMLSearchType.js"],"names":[],"mappings":";+BAQa,OAAO,sBAAsB,EAAE,gBAAgB;AA8F5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,kCAFU,gBAAgB,CAoHxB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export default recordSearchType;
|
|
2
2
|
export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {import('../searchDispatch.js').SearchTypeObject} SearchTypeObject
|
|
5
|
-
*/
|
|
6
3
|
/**
|
|
7
4
|
* Record search is "key-schema search AND/OR value-schema search,"
|
|
8
5
|
* structurally unlike object's additive "has property" (search plan §1) -
|
|
@@ -11,7 +8,10 @@ export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
|
|
|
11
8
|
* whether a match must come from the *same* entry ("has key 2-4 and value
|
|
12
9
|
* 7-9", README) via the "joint" toggle on the resulting `mapRecordJoint`
|
|
13
10
|
* leaf - also used for `looseRecord`, aliased to this same module in
|
|
14
|
-
* `searchDispatch.js` since the search semantics are identical.
|
|
11
|
+
* `searchDispatch.js` since the search semantics are identical. Key and
|
|
12
|
+
* value each get their own `buildOptInFieldset` (see `mapSearchType.js`'s
|
|
13
|
+
* matching doc for why), but leaving *both* unopted-in is itself invalid via
|
|
14
|
+
* `buildAtLeastOneSentinel`.
|
|
15
15
|
* @type {SearchTypeObject}
|
|
16
16
|
*/
|
|
17
17
|
declare const recordSearchType: SearchTypeObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/recordSearchType.js"],"names":[],"mappings":";+
|
|
1
|
+
{"version":3,"file":"recordSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/recordSearchType.js"],"names":[],"mappings":";+BASa,OAAO,sBAAsB,EAAE,gBAAgB;AAa5D;;;;;;;;;;;;;GAaG;AACH,gCAFU,gBAAgB,CAoExB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export default tupleSearchType;
|
|
2
2
|
export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {import('../searchDispatch.js').SearchTypeObject} SearchTypeObject
|
|
5
|
-
*/
|
|
6
3
|
/**
|
|
7
4
|
* Each fixed position gets its own control from `.items[i]`, not one
|
|
8
5
|
* control repeated per element (search plan §1 - unlike the value-editing
|
|
@@ -15,6 +12,9 @@ export type SearchTypeObject = import("../searchDispatch.js").SearchTypeObject;
|
|
|
15
12
|
* items.length`, no sparse toggle - not applicable to a tuple), and the
|
|
16
13
|
* `rest` element itself recurses into its own search widget under the same
|
|
17
14
|
* `*` path-segment convention `arraySearchType.js` uses for its element.
|
|
15
|
+
* Leaving every position, the rest element, and (when present) the length
|
|
16
|
+
* unconfigured at once is invalid (`buildAtLeastOneSentinel`), the same as
|
|
17
|
+
* `arraySearchType.js`/`setSearchType.js`/`filelistSearchType.js`.
|
|
18
18
|
* @type {SearchTypeObject}
|
|
19
19
|
*/
|
|
20
20
|
declare const tupleSearchType: SearchTypeObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tupleSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/tupleSearchType.js"],"names":[],"mappings":";+
|
|
1
|
+
{"version":3,"file":"tupleSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/subTypes/tupleSearchType.js"],"names":[],"mappings":";+BAUa,OAAO,sBAAsB,EAAE,gBAAgB;AAkB5D;;;;;;;;;;;;;;;;GAgBG;AACH,+BAFU,gBAAgB,CA0GxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffersourceSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/superTypes/buffersourceSearchType.js"],"names":[],"mappings":";+
|
|
1
|
+
{"version":3,"file":"buffersourceSearchType.d.ts","sourceRoot":"","sources":["../../../src/search/superTypes/buffersourceSearchType.js"],"names":[],"mappings":";+BAOa,OAAO,sBAAsB,EAAE,gBAAgB;AAD5D;;GAEG;AAEH;;;;;;;;;GASG;AACH,sCAFU,gBAAgB,CAgCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unionFamilySearchType.d.ts","sourceRoot":"","sources":["../../../src/search/unions/unionFamilySearchType.js"],"names":[],"mappings":"AAkBA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sEAHW;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAC,GACvC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"unionFamilySearchType.d.ts","sourceRoot":"","sources":["../../../src/search/unions/unionFamilySearchType.js"],"names":[],"mappings":"AAkBA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sEAHW;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAC,GACvC,gBAAgB,CA4H5B;+BAhKY,OAAO,sBAAsB,EAAE,gBAAgB;oCAY/C;IACR,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,yBAAyB,EAAE,WAAW,EAAE,CAAA;CACzD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@es-joy/jsoe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"style-mod": "^4.1.3",
|
|
54
54
|
"typeson-registry": "14.6.1",
|
|
55
55
|
"w3c-keyname": "^2.2.8",
|
|
56
|
-
"zod": "^4.6.
|
|
56
|
+
"zod": "^4.6.5",
|
|
57
57
|
"zodexy": "^0.32.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"nyc": "^18.0.0",
|
|
86
86
|
"open-cli": "^9.0.0",
|
|
87
87
|
"rimraf": "^6.1.3",
|
|
88
|
-
"rollup": "4.63.
|
|
88
|
+
"rollup": "4.63.3",
|
|
89
89
|
"rollup-plugin-istanbul": "^5.0.0",
|
|
90
90
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
91
91
|
"typescript": "^6.0.3",
|