@vectoriahq/quac 0.22.0 → 0.24.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.
@@ -38,6 +38,21 @@ export interface StacStyle {
38
38
  * `QUAC_STYLE_OVERRIDES`. Absent means none: the style draws as published.
39
39
  */
40
40
  overrides?: StyleOverrideReference[];
41
+ /**
42
+ * For a Collection made from QGIS's per-shape layers over one file, the
43
+ * style's part for each shape, in the order the Collection lists them: the
44
+ * shapes it draws (`quac:geometry_filter` on its asset) and its own address.
45
+ * `href` and `type` are then the first part's. Absent for a style drawn
46
+ * whole.
47
+ */
48
+ parts?: StacStylePart[];
49
+ }
50
+ /** One shape's part of a style, as `StacStyle.parts` lists it. */
51
+ export interface StacStylePart {
52
+ shapes: Array<'Point' | 'LineString' | 'Polygon'>;
53
+ href: string;
54
+ type?: string;
55
+ categorisedField?: string;
41
56
  }
42
57
  /**
43
58
  * One style override: the address of a JSON document, or the document itself.
@@ -59,7 +74,9 @@ export declare const DEFAULT_STYLE_ROLE = "default";
59
74
  /** MapLibre/Mapbox GL style document — a vector basemap's style. */
60
75
  export declare const GL_STYLE_MEDIA_TYPE = "application/vnd.mapbox.style+json";
61
76
  /**
62
- * Every style a Collection declares.
77
+ * Every style a Collection declares. The assets of a per-shape style, each
78
+ * carrying the shapes it draws, are one style, listed where its first part is,
79
+ * with each part in `parts`.
63
80
  *
64
81
  * The style's name comes from the asset's `title`, falling back to its key. The
65
82
  * two are the same except where a source had to disambiguate the key — see
@@ -24,7 +24,9 @@ export const DEFAULT_STYLE_ROLE = 'default';
24
24
  /** MapLibre/Mapbox GL style document — a vector basemap's style. */
25
25
  export const GL_STYLE_MEDIA_TYPE = 'application/vnd.mapbox.style+json';
26
26
  /**
27
- * Every style a Collection declares.
27
+ * Every style a Collection declares. The assets of a per-shape style, each
28
+ * carrying the shapes it draws, are one style, listed where its first part is,
29
+ * with each part in `parts`.
28
30
  *
29
31
  * The style's name comes from the asset's `title`, falling back to its key. The
30
32
  * two are the same except where a source had to disambiguate the key — see
@@ -37,13 +39,16 @@ export const GL_STYLE_MEDIA_TYPE = 'application/vnd.mapbox.style+json';
37
39
  * "which one is the default".
38
40
  */
39
41
  export function collectCollectionStyles(collection) {
40
- return Object.entries(collection.assets ?? {})
41
- .filter(([, asset]) => asset.roles?.includes('style'))
42
- .map(([key, asset]) => {
43
- const style = { name: asset.title ?? key, href: asset.href };
42
+ const styles = [];
43
+ const shaped = new Map();
44
+ for (const [key, asset] of Object.entries(collection.assets ?? {})) {
45
+ if (!asset.roles?.includes('style'))
46
+ continue;
47
+ const name = asset.title ?? key;
48
+ const style = { name, href: asset.href };
44
49
  if (asset.type)
45
50
  style.type = asset.type;
46
- if (asset.roles?.includes(DEFAULT_STYLE_ROLE))
51
+ if (asset.roles.includes(DEFAULT_STYLE_ROLE))
47
52
  style.isDefault = true;
48
53
  const categorisedField = asset[QUAC_CATEGORISED_FIELD];
49
54
  if (typeof categorisedField === 'string' && categorisedField.trim()) {
@@ -52,8 +57,38 @@ export function collectCollectionStyles(collection) {
52
57
  const overrides = readStyleOverrides(asset[QUAC_STYLE_OVERRIDES]);
53
58
  if (overrides.length > 0)
54
59
  style.overrides = overrides;
55
- return style;
56
- });
60
+ // One shape's part of a per-shape style: gathered under the style's name.
61
+ const shapes = readShapes(asset[QUAC_GEOMETRY_FILTER_FIELD]);
62
+ if (!shapes) {
63
+ styles.push(style);
64
+ continue;
65
+ }
66
+ const part = { shapes, href: asset.href };
67
+ if (style.type)
68
+ part.type = style.type;
69
+ if (style.categorisedField)
70
+ part.categorisedField = style.categorisedField;
71
+ const gathered = shaped.get(name);
72
+ if (gathered) {
73
+ gathered.parts.push(part);
74
+ if (style.isDefault)
75
+ gathered.isDefault = true;
76
+ continue;
77
+ }
78
+ style.parts = [part];
79
+ shaped.set(name, style);
80
+ styles.push(style);
81
+ }
82
+ return styles;
83
+ }
84
+ /** The key an asset gives the shapes it holds, as `QUAC_GEOMETRY_FILTER` in `generate/stacCatalogue.ts` names it. */
85
+ const QUAC_GEOMETRY_FILTER_FIELD = 'quac:geometry_filter';
86
+ const SHAPES = new Set(['Point', 'LineString', 'Polygon']);
87
+ /** A non-empty list of shapes, each one a style part can draw; null for anything else. */
88
+ function readShapes(value) {
89
+ if (!Array.isArray(value) || value.length === 0)
90
+ return null;
91
+ return value.every((shape) => typeof shape === 'string' && SHAPES.has(shape)) ? value : null;
57
92
  }
58
93
  /**
59
94
  * A key for a style asset that does not displace one already in the set.
@@ -8,7 +8,24 @@ export declare const BRAND_COLOUR_LABEL = "Brand";
8
8
  * `src/core/project/qgsproject.cpp`), each colour in
9
9
  * `QgsColorUtils::colorToString` form, which starts `r,g,b,a,`
10
10
  * (`src/core/qgscolorutils.cpp`, `qgis/QGIS@master`, read 2026-10-25). The
11
- * first matching label wins. The reading application decodes the text: this
12
- * package reads no colours of its own.
11
+ * first matching label wins. `brandColorOf` turns the text into the
12
+ * catalogue's `#rrggbb`.
13
13
  */
14
14
  export declare function parseBrandColour(qgisRoot: Element): string | null;
15
+ /**
16
+ * A project colour's text as `#rrggbb`, read as QGIS reads a project colour
17
+ * (`QgsProjectColorScheme::fetchColors` reads each with
18
+ * `QgsColorUtils::colorFromString`, `src/core/qgscolorscheme.cpp` and
19
+ * `src/core/qgscolorutils.cpp`, `qgis/QGIS@master`, read 2026-11-30), or null
20
+ * where QGIS reads no colour. Its opacity is not kept.
21
+ *
22
+ * - `colorToString`'s form, `r,g,b,a,<model>:…`: its leading `r,g,b`, which
23
+ * QGIS writes from the colour's own 8-bit channels whatever its model. Where
24
+ * they are not whole numbers, an `rgb:` colour's fractions from 0 to 1, each
25
+ * times 255.
26
+ * - Three or more comma-separated parts: red, green and blue, each read as
27
+ * `QString::toInt` reads it, 0 where it is not a whole number.
28
+ * - Otherwise Qt's hex forms, `#rgb`, `#rrggbb`, `#aarrggbb`, `#rrrgggbbb` and
29
+ * `#rrrrggggbbbb`. A colour name, which QGIS never saves itself, gives null.
30
+ */
31
+ export declare function brandColorOf(text: string | null | undefined): string | null;
@@ -9,8 +9,8 @@ export const BRAND_COLOUR_LABEL = 'Brand';
9
9
  * `src/core/project/qgsproject.cpp`), each colour in
10
10
  * `QgsColorUtils::colorToString` form, which starts `r,g,b,a,`
11
11
  * (`src/core/qgscolorutils.cpp`, `qgis/QGIS@master`, read 2026-10-25). The
12
- * first matching label wins. The reading application decodes the text: this
13
- * package reads no colours of its own.
12
+ * first matching label wins. `brandColorOf` turns the text into the
13
+ * catalogue's `#rrggbb`.
14
14
  */
15
15
  export function parseBrandColour(qgisRoot) {
16
16
  const palette = readPropertyBlock(qgisRoot, 'Palette');
@@ -23,3 +23,93 @@ export function parseBrandColour(qgisRoot) {
23
23
  return null;
24
24
  return colours[index]?.trim() || null;
25
25
  }
26
+ /**
27
+ * `colorToString`'s form, `<r,g,b,a>,<model>:<v1>,<v2>,<v3>,<v4>[,<v5>]`, as
28
+ * `colorFromString` matches it, taken apart: the 8-bit `r,g,b,a` QGIS writes
29
+ * for older versions, the colour model, and its values. Null for any other
30
+ * text. Read without a regular expression over the whole text, which would
31
+ * backtrack.
32
+ */
33
+ function readModelledColour(text) {
34
+ const colon = text.lastIndexOf(':');
35
+ if (colon < 0)
36
+ return null;
37
+ const head = text.slice(0, colon);
38
+ const comma = head.lastIndexOf(',');
39
+ if (comma < 0)
40
+ return null;
41
+ const model = head.slice(comma + 1);
42
+ const values = text.slice(colon + 1).split(',');
43
+ const number = /^[\d.-]+$/;
44
+ const valid = /^[a-z]+$/.test(model)
45
+ && (values.length === 4 || (values.length === 5 && /^[\d.-]*$/.test(values[4])))
46
+ && values.slice(0, 4).every((value) => number.test(value));
47
+ return valid ? { leading: head.slice(0, comma), model, values } : null;
48
+ }
49
+ /**
50
+ * A project colour's text as `#rrggbb`, read as QGIS reads a project colour
51
+ * (`QgsProjectColorScheme::fetchColors` reads each with
52
+ * `QgsColorUtils::colorFromString`, `src/core/qgscolorscheme.cpp` and
53
+ * `src/core/qgscolorutils.cpp`, `qgis/QGIS@master`, read 2026-11-30), or null
54
+ * where QGIS reads no colour. Its opacity is not kept.
55
+ *
56
+ * - `colorToString`'s form, `r,g,b,a,<model>:…`: its leading `r,g,b`, which
57
+ * QGIS writes from the colour's own 8-bit channels whatever its model. Where
58
+ * they are not whole numbers, an `rgb:` colour's fractions from 0 to 1, each
59
+ * times 255.
60
+ * - Three or more comma-separated parts: red, green and blue, each read as
61
+ * `QString::toInt` reads it, 0 where it is not a whole number.
62
+ * - Otherwise Qt's hex forms, `#rgb`, `#rrggbb`, `#aarrggbb`, `#rrrgggbbb` and
63
+ * `#rrrrggggbbbb`. A colour name, which QGIS never saves itself, gives null.
64
+ */
65
+ export function brandColorOf(text) {
66
+ if (!text)
67
+ return null;
68
+ const modelled = readModelledColour(text);
69
+ if (modelled) {
70
+ const leading = channelsOf(modelled.leading.split(','), true);
71
+ if (leading)
72
+ return leading;
73
+ if (modelled.model !== 'rgb')
74
+ return null;
75
+ const fractions = modelled.values.slice(0, 3).map(Number);
76
+ return fractions.every((value) => Number.isFinite(value) && value >= 0 && value <= 1)
77
+ ? hex(fractions.map((value) => Math.round(value * 255)))
78
+ : null;
79
+ }
80
+ const parts = text.split(',');
81
+ if (parts.length >= 3)
82
+ return channelsOf(parts, false);
83
+ return text.startsWith('#') ? fromHexDigits(text.slice(1)) : null;
84
+ }
85
+ /**
86
+ * `#rrggbb` from the first three parts and the optional fourth, alpha, each
87
+ * 0 to 255, or null where one is out of range, which Qt reads as no colour.
88
+ * `strict` asks for whole numbers; otherwise a part that is not one reads as
89
+ * 0, as `QString::toInt` reads it.
90
+ */
91
+ function channelsOf(parts, strict) {
92
+ if (parts.length < 3)
93
+ return null;
94
+ const read = (part) => (/^\s*[+-]?\d+\s*$/.test(part) ? Number(part) : strict ? Number.NaN : 0);
95
+ const channels = parts.slice(0, 4).map(read);
96
+ if (!channels.every((channel) => Number.isInteger(channel) && channel >= 0 && channel <= 255))
97
+ return null;
98
+ return hex(channels.slice(0, 3));
99
+ }
100
+ function fromHexDigits(digits) {
101
+ if (!/^[0-9a-f]+$/i.test(digits))
102
+ return null;
103
+ const read = (start, length, max) => Math.round((parseInt(digits.slice(start, start + length), 16) / max) * 255);
104
+ switch (digits.length) {
105
+ case 3: return hex([0, 1, 2].map((i) => read(i, 1, 15)));
106
+ case 6: return hex([0, 2, 4].map((i) => read(i, 2, 255)));
107
+ case 8: return hex([2, 4, 6].map((i) => read(i, 2, 255)));
108
+ case 9: return hex([0, 3, 6].map((i) => read(i, 3, 4095)));
109
+ case 12: return hex([0, 4, 8].map((i) => read(i, 4, 65535)));
110
+ default: return null;
111
+ }
112
+ }
113
+ function hex(channels) {
114
+ return `#${channels.map((channel) => channel.toString(16).padStart(2, '0')).join('')}`;
115
+ }
@@ -72,7 +72,13 @@ function parseMapLayer(maplayer, notes, photoSettings) {
72
72
  if (!id)
73
73
  return null;
74
74
  const layerNotes = [];
75
- const note = (reason, field, text) => layerNotes.push({ layerId: id, layerName: name, field, reason, text });
75
+ const fieldRulesLeftOut = nameRecord();
76
+ const note = (reason, field, text, strength) => {
77
+ layerNotes.push({ layerId: id, layerName: name, field, reason, text });
78
+ if (field !== null && (reason === 'widget' || reason === 'default' || reason === 'constraint')) {
79
+ (fieldRulesLeftOut[field] ??= []).push({ rule: reason, text, ...(strength ? { strength } : {}) });
80
+ }
81
+ };
76
82
  const type = maplayer.getAttribute('type') ?? '';
77
83
  const geometryType = maplayer.getAttribute('geometry') || null;
78
84
  const wkbType = maplayer.getAttribute('wkbType') || null;
@@ -133,6 +139,8 @@ function parseMapLayer(maplayer, notes, photoSettings) {
133
139
  locks: parseQfieldSyncLocks(maplayer),
134
140
  rawXml: new XMLSerializer().serializeToString(maplayer)
135
141
  };
142
+ if (Object.keys(fieldRulesLeftOut).length > 0)
143
+ layer.fieldRulesLeftOut = fieldRulesLeftOut;
136
144
  // Added once the layer is read whole, so a layer that fails part way leaves one `layer` note.
137
145
  notes.push(...layerNotes);
138
146
  return layer;
@@ -617,7 +625,7 @@ function parseFieldEditRules(maplayer, note) {
617
625
  ruleFor(name).constraintExpression = expression;
618
626
  }
619
627
  else
620
- note('constraint', name, written.expression);
628
+ note('constraint', name, written.expression, strength);
621
629
  }
622
630
  }
623
631
  // A Range with Allow NULL off, or a Date/Time with it off, is a required
@@ -26,3 +26,10 @@ export declare function parsePrintLayouts(qgisRoot: Element): PrintLayoutTemplat
26
26
  * empty.
27
27
  */
28
28
  export declare function writeLayoutTemplate(element: Element): string;
29
+ /**
30
+ * An element as XML text by `writeLayoutTemplate`'s rule, from its name, its
31
+ * attributes in order and its children already written: each
32
+ * `SOURCE_ATTRIBUTE` left out, and an attribute whose value is an
33
+ * `ABSOLUTE_PATH` written empty.
34
+ */
35
+ export declare function writeXmlElement(tagName: string, attributes: ReadonlyArray<readonly [string, string]>, children: string): string;
@@ -48,10 +48,6 @@ const ABSOLUTE_PATH = /^\s*(\/|\\|~[\\/]|[A-Za-z]:([\\/]|$)|file:)/i;
48
48
  * empty.
49
49
  */
50
50
  export function writeLayoutTemplate(element) {
51
- const attributes = Array.from(element.attributes)
52
- .filter((attribute) => !SOURCE_ATTRIBUTE.test(attribute.name))
53
- .map((attribute) => ` ${attribute.name}="${ABSOLUTE_PATH.test(attribute.value) ? '' : escapeAttribute(attribute.value)}"`)
54
- .join('');
55
51
  const children = Array.from(element.childNodes)
56
52
  .map((child) => {
57
53
  if (child.nodeType === 1)
@@ -63,9 +59,20 @@ export function writeLayoutTemplate(element) {
63
59
  return '';
64
60
  })
65
61
  .join('');
66
- return children === ''
67
- ? `<${element.tagName}${attributes}/>`
68
- : `<${element.tagName}${attributes}>${children}</${element.tagName}>`;
62
+ return writeXmlElement(element.tagName, Array.from(element.attributes, (attribute) => [attribute.name, attribute.value]), children);
63
+ }
64
+ /**
65
+ * An element as XML text by `writeLayoutTemplate`'s rule, from its name, its
66
+ * attributes in order and its children already written: each
67
+ * `SOURCE_ATTRIBUTE` left out, and an attribute whose value is an
68
+ * `ABSOLUTE_PATH` written empty.
69
+ */
70
+ export function writeXmlElement(tagName, attributes, children) {
71
+ const written = attributes
72
+ .filter(([name]) => !SOURCE_ATTRIBUTE.test(name))
73
+ .map(([name, value]) => ` ${name}="${ABSOLUTE_PATH.test(value) ? '' : escapeAttribute(value)}"`)
74
+ .join('');
75
+ return children === '' ? `<${tagName}${written}/>` : `<${tagName}${written}>${children}</${tagName}>`;
69
76
  }
70
77
  function escapeText(text) {
71
78
  return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
@@ -1,3 +1,4 @@
1
+ import { writeLayoutTemplate, writeXmlElement } from "./parsePrintLayouts.js";
1
2
  import { devLog } from "../util/devLog.js";
2
3
  /**
3
4
  * Captures all named styles defined for a layer, plus the index of the
@@ -35,7 +36,7 @@ export function parseLayerStyles(maplayer) {
35
36
  const direct = captureMaplayerRenderer(maplayer, tag);
36
37
  if (!direct)
37
38
  return { styles: [], activeIndex: -1 };
38
- return { styles: [{ name: 'default', isActive: true, ...rendererFields(direct, tag) }], activeIndex: 0 };
39
+ return { styles: [{ name: 'default', isActive: true, ...rendererFields(direct, tag), styleDocument: writeStyleDocument(maplayer, maplayer, tag) }], activeIndex: 0 };
39
40
  }
40
41
  const currentName = manager.getAttribute('current') ?? '';
41
42
  const styles = [];
@@ -51,9 +52,11 @@ export function parseLayerStyles(maplayer) {
51
52
  const renderer = isActive
52
53
  ? captureMaplayerRenderer(maplayer, tag)
53
54
  : captureNestedRenderer(node, tag);
55
+ // The active style's settings are the layer's own; another's are the <qgis> document QGIS saved it as.
56
+ const source = isActive ? maplayer : node.firstElementChild;
54
57
  if (isActive)
55
58
  activeIndex = styles.length;
56
- styles.push({ name, isActive, ...rendererFields(renderer, tag) });
59
+ styles.push({ name, isActive, ...rendererFields(renderer, tag), ...(renderer && source ? { styleDocument: writeStyleDocument(source, maplayer, tag) } : {}) });
57
60
  }
58
61
  return { styles, activeIndex };
59
62
  }
@@ -80,6 +83,51 @@ function captureMaplayerRenderer(maplayer, tag) {
80
83
  }
81
84
  return null;
82
85
  }
86
+ /**
87
+ * The style categories a style document holds, as `QgsMapLayer::StyleCategories`
88
+ * names them, in their order: what the QUAC plugin exports a layer's style
89
+ * with, so both write the same kind of document.
90
+ */
91
+ const STYLE_CATEGORIES = 'Symbology|Symbology3D|Labeling|Diagrams|Rendering';
92
+ /**
93
+ * The elements QGIS writes for those categories (`QgsMapLayer::writeCommonStyle`,
94
+ * `src/core/qgsmaplayer.cpp`; `QgsVectorLayer::writeStyle`,
95
+ * `src/core/vector/qgsvectorlayer.cpp`; `qgis/QGIS@master`, read
96
+ * 2026-11-30): the renderer, the selection colour, the labels, the blend
97
+ * modes, the opacity, the 3D renderer and the diagrams. The renderer is added
98
+ * by its own tag.
99
+ */
100
+ const STYLE_ELEMENTS = new Set([
101
+ 'selection', 'labeling', 'blendMode', 'featureBlendMode', 'layerOpacity', 'renderer-3d',
102
+ 'SingleCategoryDiagramRenderer', 'LinearlyInterpolatedDiagramRenderer', 'StackedDiagramRenderer', 'DiagramLayerSettings'
103
+ ]);
104
+ /** The attributes QGIS writes on the layer's element for those categories, by the same functions. */
105
+ const STYLE_ATTRIBUTES = new Set([
106
+ 'layerType', 'labelsEnabled', 'hasScaleBasedVisibilityFlag', 'maxScale', 'minScale', 'autoRefreshMode', 'autoRefreshTime',
107
+ 'symbologyReferenceScale', 'simplifyDrawingHints', 'simplifyAlgorithm', 'simplifyDrawingTol', 'simplifyLocal', 'simplifyMaxScale'
108
+ ]);
109
+ /**
110
+ * A style as a QGIS style document (`.qml`), as `QgsMapLayer::exportNamedStyle`
111
+ * writes one for `STYLE_CATEGORIES`: a `<qgis>` element holding the project's
112
+ * QGIS version, the categories, and the attributes and elements of `source`
113
+ * that belong to them, written by `writeLayoutTemplate`'s rule, so it holds no
114
+ * path on the computer that saved the project. `source` is the layer's own
115
+ * element for its active style, and the `<qgis>` element QGIS saved for any
116
+ * other.
117
+ */
118
+ function writeStyleDocument(source, maplayer, tag) {
119
+ const version = maplayer.ownerDocument?.documentElement?.getAttribute('version') ?? '';
120
+ const attributes = [['version', version], ['styleCategories', STYLE_CATEGORIES]];
121
+ for (const attribute of Array.from(source.attributes)) {
122
+ if (STYLE_ATTRIBUTES.has(attribute.name))
123
+ attributes.push([attribute.name, attribute.value]);
124
+ }
125
+ const children = Array.from(source.children)
126
+ .filter((child) => child.tagName === tag || STYLE_ELEMENTS.has(child.tagName))
127
+ .map(writeLayoutTemplate)
128
+ .join('');
129
+ return `<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>\n${writeXmlElement('qgis', attributes, children)}\n`;
130
+ }
83
131
  /** A style's renderer fields, from its renderer element or none. */
84
132
  function rendererFields(renderer, tag) {
85
133
  if (tag === 'renderer') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriahq/quac",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Writes and reads QUAC, which adds map layer settings to STAC catalogues.",
@@ -93,6 +93,41 @@
93
93
  "additionalProperties": false
94
94
  }
95
95
  },
96
+ "quac:brand_color": {
97
+ "description": "On the top-level Catalog: the colour that the source names as its brand, as #rrggbb in lower case. Written from the QGIS project colour labelled Brand (Project Properties, Colors).",
98
+ "type": "string",
99
+ "pattern": "^#[0-9a-f]{6}$"
100
+ },
101
+ "quac:left_out": {
102
+ "description": "On the top-level Catalog: the source's layers that the catalogue leaves out, in the source's order, each with the id its Collection would have had, its title and why it was left out. Written by the QUAC plugin for QGIS.",
103
+ "type": "array",
104
+ "minItems": 1,
105
+ "items": {
106
+ "type": "object",
107
+ "required": ["id", "title", "reason"],
108
+ "properties": {
109
+ "id": { "type": "string", "minLength": 1 },
110
+ "title": { "type": "string" },
111
+ "reason": { "enum": ["outside_folder", "not_a_file", "holds_credentials", "not_opened", "not_copied", "copy_failed"] }
112
+ },
113
+ "additionalProperties": false
114
+ }
115
+ },
116
+ "quac:logo_left_out": {
117
+ "description": "On the top-level Catalog: the logo variables the source sets that write no icon link, the logo's first, each by the variable's name, never its value, with why it writes none. Written from a QGIS project's quac_logo and quac_logo_dark variables.",
118
+ "type": "array",
119
+ "minItems": 1,
120
+ "maxItems": 2,
121
+ "items": {
122
+ "type": "object",
123
+ "required": ["variable", "reason"],
124
+ "properties": {
125
+ "variable": { "enum": ["quac_logo", "quac_logo_dark"] },
126
+ "reason": { "enum": ["not_an_image", "not_relative", "outside_folder", "not_read", "no_logo"] }
127
+ },
128
+ "additionalProperties": false
129
+ }
130
+ },
96
131
  "quac:visibility_checked": {
97
132
  "description": "On a group: whether the group opens switched on. In a catalogue of basemaps, true marks the basemap that is shown first, and false keeps a group hidden.",
98
133
  "type": "boolean"
@@ -101,6 +136,12 @@
101
136
  "description": "The group shows only one of its children at a time, as a QGIS mutually exclusive group does. Written from a QGIS project's layer tree or QGIS Server's GetProjectSettings.",
102
137
  "const": true
103
138
  },
139
+ "links": {
140
+ "type": "array",
141
+ "items": {
142
+ "$ref": "#/definitions/link"
143
+ }
144
+ },
104
145
  "collections": {
105
146
  "type": "array",
106
147
  "items": {
@@ -339,10 +380,11 @@
339
380
  "type": "object",
340
381
  "properties": {
341
382
  "quac:geometry_type": {
342
- "description": "The layer's geometry type as a QGIS project names it, such as Point, as a one-item array.",
383
+ "description": "The layer's geometry type as a QGIS project names it, such as Point, as a one-item array; for a Collection made from QGIS's per-shape layers over one file, each layer's, in their order.",
343
384
  "type": "array",
344
385
  "minItems": 1,
345
- "maxItems": 1,
386
+ "maxItems": 3,
387
+ "uniqueItems": true,
346
388
  "items": {
347
389
  "$ref": "#/definitions/name"
348
390
  }
@@ -394,6 +436,10 @@
394
436
  "type": "string",
395
437
  "minLength": 1
396
438
  },
439
+ "quac:theme": {
440
+ "description": "On an icon link of the top-level Catalog: the theme the image is for. dark marks the logo shown in a dark theme, beside the icon link without it. Written from the QGIS project variable quac_logo_dark.",
441
+ "const": "dark"
442
+ },
397
443
  "quac:wmts_style": {
398
444
  "description": "On a WMTS link: the style that the layer's tiles are requested in. Written from a QGIS WMTS layer's style. Absent where QGIS uses the layer's default style. The Web Map Links extension defines no field for it and would be its natural home.",
399
445
  "type": "string",
@@ -424,7 +470,7 @@
424
470
  "minLength": 1
425
471
  },
426
472
  "quac:geometry_filter": {
427
- "description": "The geometry types in the asset's file that the Collection holds, so a layer shows only those features. A multi-part geometry, such as a MultiPoint, counts as its single-part type. Written from QGIS file layers' geometrytype= option, which QGIS uses to split a file holding several geometry types into one layer per type; one Collection made from two such layers lists both their types, and one made from all three has no filter, so it holds the whole file.",
473
+ "description": "The geometry types in the asset's file that the Collection holds, so a layer shows only those features. A multi-part geometry, such as a MultiPoint, counts as its single-part type. Written from QGIS file layers' geometrytype= option, which QGIS uses to split a file holding several geometry types into one layer per type; one Collection made from two such layers lists both their types, and one made from all three has no filter, so it holds the whole file. On a style asset of such a Collection: the one geometry type whose features the style draws, each layer's style being an asset of its own.",
428
474
  "type": "array",
429
475
  "minItems": 1,
430
476
  "uniqueItems": true,
@@ -652,6 +698,36 @@
652
698
  "description": "The form puts the field's name above its value, across the form's width. Written from QGIS's Label on top in the Attributes Form.",
653
699
  "const": true
654
700
  },
701
+ "quac:qgis_server_hidden": {
702
+ "description": "The QGIS Server services that leave the field's values out: wms for GetFeatureInfo and GetProjectSettings, wfs for DescribeFeatureType and GetFeature, in that order. Written from the WMS and WFS boxes of QGIS's QGIS Server settings in the Attributes Form.",
703
+ "type": "array",
704
+ "minItems": 1,
705
+ "maxItems": 2,
706
+ "uniqueItems": true,
707
+ "items": { "enum": ["wms", "wfs"] }
708
+ },
709
+ "quac:rules_left_out": {
710
+ "description": "The field's rules the catalogue leaves out, in the order the source was read: an edit widget it does not read, a default or constraint expression it cannot read, or a Value Relation whose lookup layer is not in the catalogue.",
711
+ "type": "array",
712
+ "minItems": 1,
713
+ "items": {
714
+ "type": "object",
715
+ "required": ["rule"],
716
+ "properties": {
717
+ "rule": { "enum": ["widget", "default", "constraint", "value_relation"] },
718
+ "text": {
719
+ "description": "The widget's type, or the expression, as the source wrote it.",
720
+ "type": "string",
721
+ "minLength": 1
722
+ },
723
+ "strength": {
724
+ "description": "A constraint expression's strength: enforced refuses a value it fails, warn saves it with a warning.",
725
+ "enum": ["enforced", "warn"]
726
+ }
727
+ },
728
+ "additionalProperties": false
729
+ }
730
+ },
655
731
  "quac:values": {
656
732
  "description": "The values the field takes, each with the label a form shows for it, in the source's order. Written from a QGIS Value Map widget or an ArcGIS coded-value domain.",
657
733
  "type": "array",