@vectoriahq/quac 0.1.0 → 0.2.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.
Files changed (50) hide show
  1. package/README.md +1 -1
  2. package/dist/generate/externalStacCatalogue.d.ts +4 -4
  3. package/dist/generate/externalStacCatalogue.js +9 -11
  4. package/dist/generate/folderStacCatalogue.js +1 -1
  5. package/dist/generate/normalizedProject.d.ts +5 -4
  6. package/dist/generate/normalizedProject.js +44 -92
  7. package/dist/generate/ogcFeaturesStacCatalogue.js +1 -1
  8. package/dist/generate/stacCatalogue.js +7 -2
  9. package/dist/generate/wmsStacCatalogue.js +2 -1
  10. package/dist/model/QgsProject.d.ts +11 -9
  11. package/dist/model/Stac.d.ts +8 -6
  12. package/dist/model/Stac.js +1 -1
  13. package/dist/model/featureFilter.d.ts +1 -1
  14. package/dist/model/fieldIconAddress.d.ts +1 -1
  15. package/dist/model/fieldIconAddress.js +1 -1
  16. package/dist/model/ogcFeatures.d.ts +3 -3
  17. package/dist/model/ogcFeatures.js +2 -2
  18. package/dist/model/quacExtension.d.ts +1 -1
  19. package/dist/model/quacExtension.js +1 -1
  20. package/dist/model/stacAssetRoles.d.ts +1 -1
  21. package/dist/model/stacAssetRoles.js +1 -1
  22. package/dist/model/stacHref.d.ts +1 -1
  23. package/dist/model/stacHref.js +1 -1
  24. package/dist/model/stacPmtiles.d.ts +1 -1
  25. package/dist/model/stacWms.d.ts +1 -1
  26. package/dist/model/stacWms.js +1 -1
  27. package/dist/model/wfs.d.ts +1 -1
  28. package/dist/parse/geometrySiblings.d.ts +1 -1
  29. package/dist/parse/geometrySiblings.js +1 -1
  30. package/dist/parse/parseBrandColour.d.ts +3 -3
  31. package/dist/parse/parseBrandColour.js +3 -3
  32. package/dist/parse/parseDataDefinedEditable.js +2 -2
  33. package/dist/parse/parseLayers.js +88 -85
  34. package/dist/parse/parseMeasurement.d.ts +2 -3
  35. package/dist/parse/parseMeasurement.js +3 -4
  36. package/dist/parse/qgisExpression.d.ts +4 -4
  37. package/dist/parse/qgisExpression.js +8 -8
  38. package/dist/parse/qtDateFormat.d.ts +3 -3
  39. package/dist/parse/qtDateFormat.js +3 -3
  40. package/dist/parse/qtRegex.d.ts +2 -2
  41. package/dist/parse/qtRegex.js +2 -2
  42. package/dist/sources/stacItems.d.ts +1 -1
  43. package/dist/sources/stacItems.js +2 -2
  44. package/dist/util/devLog.d.ts +1 -2
  45. package/dist/util/devLog.js +1 -2
  46. package/dist/util/nonBlankText.d.ts +2 -0
  47. package/dist/util/nonBlankText.js +4 -0
  48. package/dist/util/wfsVersions.js +1 -1
  49. package/package.json +10 -2
  50. package/src/schema/quac.schema.json +5 -1
@@ -54,12 +54,12 @@ export declare function readQtDateTime(value: unknown): QtDateTime | null;
54
54
  * `fcnDayOfWeek` and `fcnWeek`, `src/core/expression/qgsexpressionfunction.cpp`,
55
55
  * `qgis/QGIS@16eddb2`, read 2026-10-26). The value is read as `format_date`
56
56
  * reads one (`readQtDateTime`) and the part is taken in its zone. A field QGIS
57
- * holds as a date-time reaches Groundwork as ISO text, so such text counts as a
57
+ * holds as a date-time reaches this function as ISO text, so such text counts as a
58
58
  * date-time. QGIS takes no time from a date alone and no weekday from a time
59
59
  * alone, so `hour`, `minute` and `second` of `2026-10-06`, and `day_of_week` of
60
60
  * `14:05`, are null, where QGIS reports an error. A time alone is read on
61
61
  * 0001-01-01, so its `year`, `month`, `day` and `week` are 1. `day_of_week`
62
- * counts from 0 for Sunday. QGIS also takes a span of time, which Groundwork never makes.
62
+ * counts from 0 for Sunday. QGIS also takes a span of time, which this function does not read.
63
63
  */
64
64
  export declare function qtDatePart(part: string, value: unknown): number | null;
65
65
  /**
@@ -68,7 +68,7 @@ export declare function qtDatePart(part: string, value: unknown): number | null;
68
68
  * `qgis/QGIS@16eddb2`, read 2026-10-26). A `Z` anywhere after the pattern's
69
69
  * first character shows the moment in UTC. Month and day names, am and pm and
70
70
  * the digits are in `language`; QGIS uses the computer's own language when
71
- * none is given, and Groundwork uses `en-AU`, as `format_number` does. Null
71
+ * none is given, and this function uses `en-AU`, as `format_number` does. Null
72
72
  * for a pattern holding `t` and for a language the browser cannot read.
73
73
  */
74
74
  export declare function formatQtDateTime(value: QtDateTime, pattern: string, language?: string | null): string | null;
@@ -184,12 +184,12 @@ const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
184
184
  * `fcnDayOfWeek` and `fcnWeek`, `src/core/expression/qgsexpressionfunction.cpp`,
185
185
  * `qgis/QGIS@16eddb2`, read 2026-10-26). The value is read as `format_date`
186
186
  * reads one (`readQtDateTime`) and the part is taken in its zone. A field QGIS
187
- * holds as a date-time reaches Groundwork as ISO text, so such text counts as a
187
+ * holds as a date-time reaches this function as ISO text, so such text counts as a
188
188
  * date-time. QGIS takes no time from a date alone and no weekday from a time
189
189
  * alone, so `hour`, `minute` and `second` of `2026-10-06`, and `day_of_week` of
190
190
  * `14:05`, are null, where QGIS reports an error. A time alone is read on
191
191
  * 0001-01-01, so its `year`, `month`, `day` and `week` are 1. `day_of_week`
192
- * counts from 0 for Sunday. QGIS also takes a span of time, which Groundwork never makes.
192
+ * counts from 0 for Sunday. QGIS also takes a span of time, which this function does not read.
193
193
  */
194
194
  export function qtDatePart(part, value) {
195
195
  const moment = readQtDateTime(value);
@@ -220,7 +220,7 @@ function namePart(locale, options, epoch, type) {
220
220
  * `qgis/QGIS@16eddb2`, read 2026-10-26). A `Z` anywhere after the pattern's
221
221
  * first character shows the moment in UTC. Month and day names, am and pm and
222
222
  * the digits are in `language`; QGIS uses the computer's own language when
223
- * none is given, and Groundwork uses `en-AU`, as `format_number` does. Null
223
+ * none is given, and this function uses `en-AU`, as `format_number` does. Null
224
224
  * for a pattern holding `t` and for a language the browser cannot read.
225
225
  */
226
226
  export function formatQtDateTime(value, pattern, language) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * QGIS hands a regular expression to Qt's `QRegularExpression`, which is PCRE2;
3
- * Groundwork runs it as a JavaScript `RegExp`. The two engines differ in many
3
+ * this package runs it as a JavaScript `RegExp`. The two engines differ in many
4
4
  * corners (`pcre2pattern`, PCRE2 10.4x, read 2026-10-27), so this file reads
5
5
  * only the forms listed here, written so that both give the same answer, and
6
6
  * gives null for any other pattern, so the expression is not read rather than
@@ -50,7 +50,7 @@
50
50
  */
51
51
  /**
52
52
  * A PCRE2 pattern as a JavaScript `RegExp` that matches what QGIS matches, or
53
- * null where Groundwork cannot translate it, or where the result does not
53
+ * null where this package cannot translate it, or where the result does not
54
54
  * compile. `unicode` is QGIS's `UseUnicodePropertiesOption`: on for the
55
55
  * `regexp_` functions, off for `~`. The `RegExp` is shared, so a caller that
56
56
  * matches globally makes its own from its `source` and `flags`.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * QGIS hands a regular expression to Qt's `QRegularExpression`, which is PCRE2;
3
- * Groundwork runs it as a JavaScript `RegExp`. The two engines differ in many
3
+ * this package runs it as a JavaScript `RegExp`. The two engines differ in many
4
4
  * corners (`pcre2pattern`, PCRE2 10.4x, read 2026-10-27), so this file reads
5
5
  * only the forms listed here, written so that both give the same answer, and
6
6
  * gives null for any other pattern, so the expression is not read rather than
@@ -296,7 +296,7 @@ function translate(pattern, unicode) {
296
296
  const COMPILED = new Map();
297
297
  /**
298
298
  * A PCRE2 pattern as a JavaScript `RegExp` that matches what QGIS matches, or
299
- * null where Groundwork cannot translate it, or where the result does not
299
+ * null where this package cannot translate it, or where the result does not
300
300
  * compile. `unicode` is QGIS's `UseUnicodePropertiesOption`: on for the
301
301
  * `regexp_` functions, off for `~`. The `RegExp` is shared, so a caller that
302
302
  * matches globally makes its own from its `source` and `flags`.
@@ -3,7 +3,7 @@ import type { StacCollection, StacItem } from '../model/Stac.ts';
3
3
  * Reading the Items inside a STAC API's Collection.
4
4
  *
5
5
  * A static catalogue puts its data on the Collection — one downloadable asset,
6
- * which `classifyStacCollectionFormat` reads and the rest of the app loads. A
6
+ * which `classifyStacCollectionFormat` reads and a reading application loads. A
7
7
  * STAC API does not: its Collections have no such asset, and every file sits on
8
8
  * an Item inside, reached through the Collection's `rel: "items"` link. Without
9
9
  * this module every Collection a STAC API lists classifies as unsupported.
@@ -3,7 +3,7 @@ import { STAC_VERSION } from "../model/Stac.js";
3
3
  * Reading the Items inside a STAC API's Collection.
4
4
  *
5
5
  * A static catalogue puts its data on the Collection — one downloadable asset,
6
- * which `classifyStacCollectionFormat` reads and the rest of the app loads. A
6
+ * which `classifyStacCollectionFormat` reads and a reading application loads. A
7
7
  * STAC API does not: its Collections have no such asset, and every file sits on
8
8
  * an Item inside, reached through the Collection's `rel: "items"` link. Without
9
9
  * this module every Collection a STAC API lists classifies as unsupported.
@@ -217,7 +217,7 @@ function itemBaseUrl(item, itemAddress) {
217
217
  *
218
218
  * An Item's asset href may be relative to the item document — `./scene.tif`
219
219
  * beside it. By the time a loader reads that href the document it was relative
220
- * to is gone, so without this the app resolves it against its own address and
220
+ * to is gone, so without this the loader resolves it against its own address and
221
221
  * fetches nothing. An href already absolute passes through
222
222
  * unchanged, and one that cannot be resolved is left as it stands.
223
223
  */
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Turns the package's logging on or off. It is off until an application turns
3
- * it on; Groundwork turns it on in its development builds
4
- * (`src/startDevLogging.ts`, which `src/main.tsx` imports first).
3
+ * it on.
5
4
  */
6
5
  export declare function setDevLogging(on: boolean): void;
7
6
  /**
@@ -1,8 +1,7 @@
1
1
  let enabled = false;
2
2
  /**
3
3
  * Turns the package's logging on or off. It is off until an application turns
4
- * it on; Groundwork turns it on in its development builds
5
- * (`src/startDevLogging.ts`, which `src/main.tsx` imports first).
4
+ * it on.
6
5
  */
7
6
  export function setDevLogging(on) {
8
7
  enabled = on;
@@ -0,0 +1,2 @@
1
+ /** The text trimmed, or null where the value is not text or is blank. */
2
+ export declare function readNonBlank(value: unknown): string | null;
@@ -0,0 +1,4 @@
1
+ /** The text trimmed, or null where the value is not text or is blank. */
2
+ export function readNonBlank(value) {
3
+ return typeof value === 'string' && value.trim() ? value.trim() : null;
4
+ }
@@ -1,4 +1,4 @@
1
- // The WFS versions Groundwork speaks. Kept free of imports so a catalogue
1
+ // The WFS versions this package speaks. Kept free of imports so a catalogue
2
2
  // generator can read them without loading the WFS client, which loads OpenLayers.
3
3
  export const DEFAULT_WFS_VERSION = '1.1.0';
4
4
  // WFS 2.0.0 is used as a fallback for Esri servers, which require it for GeoJSON output and
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "@vectoriahq/quac",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
- "description": "QUAC, a STAC profile for describing the layers of a map, and the code that writes and reads it.",
6
+ "description": "Writes and reads QUAC, which adds map layer settings to STAC catalogues.",
7
+ "keywords": [
8
+ "stac",
9
+ "qgis",
10
+ "gis",
11
+ "geospatial",
12
+ "catalog",
13
+ "map"
14
+ ],
7
15
  "homepage": "https://github.com/vectoriahq/quac#readme",
8
16
  "bugs": {
9
17
  "url": "https://github.com/vectoriahq/quac/issues"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://vectoriahq.github.io/quac/v0.1.0/schema.json",
3
+ "$id": "https://vectoriahq.github.io/quac/v0.2.0/schema.json",
4
4
  "title": "QUAC: Quite Useful Additions for Catalogs",
5
5
  "description": "The fields of QUAC (Quite Useful Additions for Catalogs): the fields a STAC catalogue carries under the quac: prefix to say how a layer is drawn, edited and set up, as a source such as a QGIS project declares it. Validates a Catalog with its inlined collections and catalogs, or a single Collection. Only quac: fields are checked: any other field passes, and a quac: field this schema does not define fails. A field is written only when the source declares it, so an absent field means the source said nothing.",
6
6
  "type": "object",
@@ -518,6 +518,10 @@
518
518
  "description": "The form never shows the field. Written from a QGIS Hidden widget.",
519
519
  "const": true
520
520
  },
521
+ "quac:searchable": {
522
+ "description": "A search of the layer's features skips the field. Written from QGIS's Not searchable.",
523
+ "const": false
524
+ },
521
525
  "quac:reuse_last_value": {
522
526
  "description": "A new feature or record is offered the value last entered in the field. Written from QGIS's Reuse last entered value.",
523
527
  "const": true