@modelform/react-native 0.8.0 → 0.10.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.
@@ -1001,6 +1001,10 @@ var panelsOf = (dashboard) => dashboard.panels.flatMap((p) => p.type === "row" ?
1001
1001
  function inputPanels(dashboard) {
1002
1002
  return panelsOf(dashboard).flatMap((p) => isInputGroup(p) ? groupFields(p) : isInputPanel(p) ? [p] : []);
1003
1003
  }
1004
+ function documentKind(dashboard) {
1005
+ if (dashboard.kind === "form" || dashboard.kind === "dashboard") return dashboard.kind;
1006
+ return Array.isArray(dashboard.panels) && inputPanels(dashboard).length ? "form" : "dashboard";
1007
+ }
1004
1008
  function inputGroups(dashboard) {
1005
1009
  return panelsOf(dashboard).filter(isInputGroup);
1006
1010
  }
@@ -2162,6 +2166,10 @@ var dashboard_schema_default = {
2162
2166
  Dashboard: {
2163
2167
  type: "object",
2164
2168
  properties: {
2169
+ kind: {
2170
+ $ref: "#/definitions/DocumentKind",
2171
+ description: "Whether this document is a form (for recording entries) or a dashboard (for showing them). Without it, a document with input-* panels counts as a form. See documentKind()."
2172
+ },
2165
2173
  uid: {
2166
2174
  type: "string"
2167
2175
  },
@@ -2253,8 +2261,15 @@ var dashboard_schema_default = {
2253
2261
  required: [
2254
2262
  "title",
2255
2263
  "panels"
2264
+ ]
2265
+ },
2266
+ DocumentKind: {
2267
+ type: "string",
2268
+ enum: [
2269
+ "form",
2270
+ "dashboard"
2256
2271
  ],
2257
- description: "The subset of the Grafana dashboard JSON model that modelform understands. Unknown keys are tolerated and ignored, so dashboards exported from Grafana load as-is. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/\n\nmodelform adds two extensions, both of which Grafana ignores: - `panel.mobile` to tune phone layout per panel - `input-*` panel types for data entry forms (see inputs.ts)"
2272
+ description: "The subset of the Grafana dashboard JSON model that modelform understands. Unknown keys are tolerated and ignored, so dashboards exported from Grafana load as-is. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/\n\nmodelform adds three extensions, all of which Grafana ignores: - `kind` to say whether the document is a form or a dashboard - `panel.mobile` to tune phone layout per panel - `input-*` panel types for data entry forms (see inputs.ts)"
2258
2273
  },
2259
2274
  Panel: {
2260
2275
  type: "object",
@@ -3757,10 +3772,11 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
3757
3772
  validate12.errors = vErrors;
3758
3773
  return errors === 0;
3759
3774
  }
3760
- var schema18 = { "type": "object", "properties": { "id": { "type": "number" }, "type": { "type": "string", "examples": ["row", "timeseries", "trend", "xychart", "stat", "gauge", "bargauge", "piechart", "barchart", "table", "text", "geomap", "input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration", "input-group"] }, "title": { "type": "string" }, "description": { "type": "string" }, "gridPos": { "$ref": "#/definitions/GridPos" }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }] }, "targets": { "type": "array", "items": { "$ref": "#/definitions/Target" } }, "fieldConfig": { "type": "object", "properties": { "defaults": { "$ref": "#/definitions/FieldConfig" }, "overrides": { "type": "array", "items": { "$ref": "#/definitions/FieldOverride" } } } }, "options": { "type": "object" }, "transformations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "options": { "type": "object" }, "disabled": { "type": "boolean" } }, "required": ["id"] }, "description": "Applied in order to the query results. See transform.ts for the ones modelform implements." }, "collapsed": { "type": "boolean", "description": "Rows only." }, "panels": { "type": "array", "items": { "$ref": "#/definitions/Panel" }, "description": "Rows only: children of a collapsed row live here instead of at the top level." }, "repeat": { "type": "string", "description": "Repeat this row (or panel) once per selected value of the named variable." }, "repeatDirection": { "type": "string", "enum": ["h", "v"], "description": "Panel repeats: side by side (`h`, wrapping at maxPerRow) or stacked (`v`)." }, "maxPerRow": { "type": "number" }, "scopedVars": { "type": "object", "additionalProperties": { "type": "object", "properties": { "text": { "type": "string" }, "value": { "type": "string" } }, "required": ["text", "value"] }, "description": "Set on each copy of a repeated row or panel: the single value it was repeated for." }, "mobile": { "$ref": "#/definitions/MobileOptions" }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Panel links, from the panel header menu in Grafana." } }, "required": ["type", "gridPos"], "additionalProperties": {}, "allOf": [{ "if": { "properties": { "type": { "pattern": "^input-(?!group$)" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputOptions" } } } }, { "if": { "properties": { "type": { "const": "input-group" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputGroupOptions" } } } }] };
3775
+ var schema18 = { "type": "string", "enum": ["form", "dashboard"], "description": "The subset of the Grafana dashboard JSON model that modelform understands. Unknown keys are tolerated and ignored, so dashboards exported from Grafana load as-is. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/\n\nmodelform adds three extensions, all of which Grafana ignores: - `kind` to say whether the document is a form or a dashboard - `panel.mobile` to tune phone layout per panel - `input-*` panel types for data entry forms (see inputs.ts)" };
3776
+ var schema19 = { "type": "object", "properties": { "id": { "type": "number" }, "type": { "type": "string", "examples": ["row", "timeseries", "trend", "xychart", "stat", "gauge", "bargauge", "piechart", "barchart", "table", "text", "geomap", "input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration", "input-group"] }, "title": { "type": "string" }, "description": { "type": "string" }, "gridPos": { "$ref": "#/definitions/GridPos" }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }] }, "targets": { "type": "array", "items": { "$ref": "#/definitions/Target" } }, "fieldConfig": { "type": "object", "properties": { "defaults": { "$ref": "#/definitions/FieldConfig" }, "overrides": { "type": "array", "items": { "$ref": "#/definitions/FieldOverride" } } } }, "options": { "type": "object" }, "transformations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "options": { "type": "object" }, "disabled": { "type": "boolean" } }, "required": ["id"] }, "description": "Applied in order to the query results. See transform.ts for the ones modelform implements." }, "collapsed": { "type": "boolean", "description": "Rows only." }, "panels": { "type": "array", "items": { "$ref": "#/definitions/Panel" }, "description": "Rows only: children of a collapsed row live here instead of at the top level." }, "repeat": { "type": "string", "description": "Repeat this row (or panel) once per selected value of the named variable." }, "repeatDirection": { "type": "string", "enum": ["h", "v"], "description": "Panel repeats: side by side (`h`, wrapping at maxPerRow) or stacked (`v`)." }, "maxPerRow": { "type": "number" }, "scopedVars": { "type": "object", "additionalProperties": { "type": "object", "properties": { "text": { "type": "string" }, "value": { "type": "string" } }, "required": ["text", "value"] }, "description": "Set on each copy of a repeated row or panel: the single value it was repeated for." }, "mobile": { "$ref": "#/definitions/MobileOptions" }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Panel links, from the panel header menu in Grafana." } }, "required": ["type", "gridPos"], "additionalProperties": {}, "allOf": [{ "if": { "properties": { "type": { "pattern": "^input-(?!group$)" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputOptions" } } } }, { "if": { "properties": { "type": { "const": "input-group" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputGroupOptions" } } } }] };
3761
3777
  var pattern1 = new RegExp("^input-(?!group$)", "u");
3762
- var schema19 = { "type": "object", "properties": { "metric": { "type": "string", "description": "The metric this input records to. Visualization queries select data by this name." }, "unit": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" }, "step": { "type": "number" }, "placeholder": { "type": "string" }, "labels": { "type": "array", "items": { "type": "string" }, "description": 'input-slider only: text spaced evenly along the track, first at min and last at max, e.g. ["Understeer", "Neutral", "Oversteer"]. Replaces the numeric min/max labels.' }, "default": { "anyOf": [{ "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "type": "string", "const": "last" }], "description": 'Initial value: a literal, or "last" to start from the most recent entry.' }, "record": { "type": "string", "enum": ["changed", "always"], "description": '"changed" (the default) records the value only when it was edited before Save; "always" records it on every Save, so a default like "last" is kept with each save.' }, "required": { "type": "boolean", "description": "Save waits until this has a value." }, "choices": { "type": "array", "items": { "$ref": "#/definitions/InputChoice" }, "description": "input-select only." }, "choicesFrom": { "type": "string", "description": "input-select only: take the choices from the app at runtime instead of `choices`, for lists that live in app data (e.g. wheel sets). Names a key of InputForm's `choices` prop." }, "multi": { "type": "boolean", "description": "input-select only: allow selecting several. Each selection is recorded as its own entry." }, "increment": { "type": "number", "description": "input-counter only: the amount each tap records (default 1)." }, "suggest": { "type": "boolean", "description": "input-text only: a single-line field that suggests values recorded earlier, matching what's typed." }, "suggestWith": { "type": "string", "description": "input-text with `suggest` only: another input's metric whose current value narrows the suggestions to values saved alongside it (e.g. configurations of the chosen track). Falls back to every earlier value when none were." } }, "required": ["metric"] };
3763
- var schema20 = { "type": "object", "properties": { "label": { "type": "string" }, "value": { "type": ["number", "string"] } }, "required": ["label", "value"] };
3778
+ var schema20 = { "type": "object", "properties": { "metric": { "type": "string", "description": "The metric this input records to. Visualization queries select data by this name." }, "unit": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" }, "step": { "type": "number" }, "placeholder": { "type": "string" }, "labels": { "type": "array", "items": { "type": "string" }, "description": 'input-slider only: text spaced evenly along the track, first at min and last at max, e.g. ["Understeer", "Neutral", "Oversteer"]. Replaces the numeric min/max labels.' }, "default": { "anyOf": [{ "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "type": "string", "const": "last" }], "description": 'Initial value: a literal, or "last" to start from the most recent entry.' }, "record": { "type": "string", "enum": ["changed", "always"], "description": '"changed" (the default) records the value only when it was edited before Save; "always" records it on every Save, so a default like "last" is kept with each save.' }, "required": { "type": "boolean", "description": "Save waits until this has a value." }, "choices": { "type": "array", "items": { "$ref": "#/definitions/InputChoice" }, "description": "input-select only." }, "choicesFrom": { "type": "string", "description": "input-select only: take the choices from the app at runtime instead of `choices`, for lists that live in app data (e.g. wheel sets). Names a key of InputForm's `choices` prop." }, "multi": { "type": "boolean", "description": "input-select only: allow selecting several. Each selection is recorded as its own entry." }, "increment": { "type": "number", "description": "input-counter only: the amount each tap records (default 1)." }, "suggest": { "type": "boolean", "description": "input-text only: a single-line field that suggests values recorded earlier, matching what's typed." }, "suggestWith": { "type": "string", "description": "input-text with `suggest` only: another input's metric whose current value narrows the suggestions to values saved alongside it (e.g. configurations of the chosen track). Falls back to every earlier value when none were." } }, "required": ["metric"] };
3779
+ var schema21 = { "type": "object", "properties": { "label": { "type": "string" }, "value": { "type": ["number", "string"] } }, "required": ["label", "value"] };
3764
3780
  function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
3765
3781
  let vErrors = null;
3766
3782
  let errors = 0;
@@ -3963,7 +3979,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
3963
3979
  errors++;
3964
3980
  }
3965
3981
  if (!(data9 === "changed" || data9 === "always")) {
3966
- const err16 = { instancePath: instancePath + "/record", schemaPath: "#/properties/record/enum", keyword: "enum", params: { allowedValues: schema19.properties.record.enum }, message: "must be equal to one of the allowed values" };
3982
+ const err16 = { instancePath: instancePath + "/record", schemaPath: "#/properties/record/enum", keyword: "enum", params: { allowedValues: schema20.properties.record.enum }, message: "must be equal to one of the allowed values" };
3967
3983
  if (vErrors === null) {
3968
3984
  vErrors = [err16];
3969
3985
  } else {
@@ -4022,7 +4038,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
4022
4038
  if (data12.value !== void 0) {
4023
4039
  let data14 = data12.value;
4024
4040
  if (!(typeof data14 == "number") && typeof data14 !== "string") {
4025
- const err21 = { instancePath: instancePath + "/choices/" + i1 + "/value", schemaPath: "#/definitions/InputChoice/properties/value/type", keyword: "type", params: { type: schema20.properties.value.type }, message: "must be number,string" };
4041
+ const err21 = { instancePath: instancePath + "/choices/" + i1 + "/value", schemaPath: "#/definitions/InputChoice/properties/value/type", keyword: "type", params: { type: schema21.properties.value.type }, message: "must be number,string" };
4026
4042
  if (vErrors === null) {
4027
4043
  vErrors = [err21];
4028
4044
  } else {
@@ -4118,7 +4134,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
4118
4134
  validate19.errors = vErrors;
4119
4135
  return errors === 0;
4120
4136
  }
4121
- var schema23 = { "type": "string", "enum": ["input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration"], "description": 'Input forms reuse the dashboard format: a form is a dashboard whose panels have `input-*` types. Layout, rows and gridPos work exactly like visualization panels, so one layout engine (and one hot-reloadable JSON file) drives both tabs.\n\n { "type": "input-number", "title": "Weight", "gridPos": {"x":0,"y":0,"w":12,"h":3}, "options": { "metric": "weight", "unit": "kg", "step": 0.1, "default": "last" } }' };
4137
+ var schema24 = { "type": "string", "enum": ["input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration"], "description": 'Input forms reuse the dashboard format: a form is a dashboard whose panels have `input-*` types. Layout, rows and gridPos work exactly like visualization panels, so one layout engine (and one hot-reloadable JSON file) drives both tabs.\n\n { "type": "input-number", "title": "Weight", "gridPos": {"x":0,"y":0,"w":12,"h":3}, "options": { "metric": "weight", "unit": "kg", "step": 0.1, "default": "last" } }' };
4122
4138
  function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4123
4139
  let vErrors = null;
4124
4140
  let errors = 0;
@@ -4153,7 +4169,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
4153
4169
  errors++;
4154
4170
  }
4155
4171
  if (!(data0 === "input-number" || data0 === "input-slider" || data0 === "input-select" || data0 === "input-toggle" || data0 === "input-rating" || data0 === "input-text" || data0 === "input-counter" || data0 === "input-duration")) {
4156
- const err3 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/InputType/enum", keyword: "enum", params: { allowedValues: schema23.enum }, message: "must be equal to one of the allowed values" };
4172
+ const err3 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/InputType/enum", keyword: "enum", params: { allowedValues: schema24.enum }, message: "must be equal to one of the allowed values" };
4157
4173
  if (vErrors === null) {
4158
4174
  vErrors = [err3];
4159
4175
  } else {
@@ -4526,9 +4542,9 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
4526
4542
  validate26.errors = vErrors;
4527
4543
  return errors === 0;
4528
4544
  }
4529
- var schema28 = { "type": "object", "properties": { "unit": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" }, "decimals": { "type": "number" }, "displayName": { "type": "string" }, "color": { "type": "object", "properties": { "mode": { "type": "string" }, "fixedColor": { "type": "string" } } }, "thresholds": { "type": "object", "properties": { "mode": { "type": "string", "enum": ["absolute", "percentage"] }, "steps": { "type": "array", "items": { "$ref": "#/definitions/ThresholdStep" } } }, "required": ["steps"] }, "mappings": { "type": "array", "items": { "$ref": "#/definitions/ValueMapping" } }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Data links: opened from a point, cell or value of this field." }, "custom": { "type": "object", "properties": { "drawStyle": { "type": "string", "enum": ["line", "bars", "points"] }, "lineWidth": { "type": "number" }, "fillOpacity": { "type": "number" }, "showPoints": { "type": "string", "enum": ["auto", "always", "never"] } }, "additionalProperties": {} } }, "additionalProperties": {} };
4530
- var schema29 = { "type": "object", "properties": { "value": { "type": ["number", "null"] }, "color": { "type": "string" } }, "required": ["value", "color"] };
4531
- var schema30 = { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "value" }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MappingResult" } } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "range" }, "options": { "type": "object", "properties": { "from": { "type": ["number", "null"] }, "to": { "type": ["number", "null"] }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "regex" }, "options": { "type": "object", "properties": { "pattern": { "type": "string" }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["pattern", "result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "special" }, "options": { "type": "object", "properties": { "match": { "type": "string", "enum": ["null", "nan", "null+nan", "true", "false", "empty"] }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["match", "result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string" }, "options": {} }, "required": ["type"] }], "description": "Grafana value mappings: display text (and optionally a color) in place of a value." };
4545
+ var schema29 = { "type": "object", "properties": { "unit": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" }, "decimals": { "type": "number" }, "displayName": { "type": "string" }, "color": { "type": "object", "properties": { "mode": { "type": "string" }, "fixedColor": { "type": "string" } } }, "thresholds": { "type": "object", "properties": { "mode": { "type": "string", "enum": ["absolute", "percentage"] }, "steps": { "type": "array", "items": { "$ref": "#/definitions/ThresholdStep" } } }, "required": ["steps"] }, "mappings": { "type": "array", "items": { "$ref": "#/definitions/ValueMapping" } }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Data links: opened from a point, cell or value of this field." }, "custom": { "type": "object", "properties": { "drawStyle": { "type": "string", "enum": ["line", "bars", "points"] }, "lineWidth": { "type": "number" }, "fillOpacity": { "type": "number" }, "showPoints": { "type": "string", "enum": ["auto", "always", "never"] } }, "additionalProperties": {} } }, "additionalProperties": {} };
4546
+ var schema30 = { "type": "object", "properties": { "value": { "type": ["number", "null"] }, "color": { "type": "string" } }, "required": ["value", "color"] };
4547
+ var schema31 = { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "value" }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MappingResult" } } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "range" }, "options": { "type": "object", "properties": { "from": { "type": ["number", "null"] }, "to": { "type": ["number", "null"] }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "regex" }, "options": { "type": "object", "properties": { "pattern": { "type": "string" }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["pattern", "result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "special" }, "options": { "type": "object", "properties": { "match": { "type": "string", "enum": ["null", "nan", "null+nan", "true", "false", "empty"] }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["match", "result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string" }, "options": {} }, "required": ["type"] }], "description": "Grafana value mappings: display text (and optionally a color) in place of a value." };
4532
4548
  function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
4533
4549
  let vErrors = null;
4534
4550
  let errors = 0;
@@ -4702,7 +4718,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
4702
4718
  if (data7.from !== void 0) {
4703
4719
  let data8 = data7.from;
4704
4720
  if (!(typeof data8 == "number") && data8 !== null) {
4705
- const err15 = { instancePath: instancePath + "/options/from", schemaPath: "#/anyOf/1/properties/options/properties/from/type", keyword: "type", params: { type: schema30.anyOf[1].properties.options.properties.from.type }, message: "must be number,null" };
4721
+ const err15 = { instancePath: instancePath + "/options/from", schemaPath: "#/anyOf/1/properties/options/properties/from/type", keyword: "type", params: { type: schema31.anyOf[1].properties.options.properties.from.type }, message: "must be number,null" };
4706
4722
  if (vErrors === null) {
4707
4723
  vErrors = [err15];
4708
4724
  } else {
@@ -4714,7 +4730,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
4714
4730
  if (data7.to !== void 0) {
4715
4731
  let data9 = data7.to;
4716
4732
  if (!(typeof data9 == "number") && data9 !== null) {
4717
- const err16 = { instancePath: instancePath + "/options/to", schemaPath: "#/anyOf/1/properties/options/properties/to/type", keyword: "type", params: { type: schema30.anyOf[1].properties.options.properties.to.type }, message: "must be number,null" };
4733
+ const err16 = { instancePath: instancePath + "/options/to", schemaPath: "#/anyOf/1/properties/options/properties/to/type", keyword: "type", params: { type: schema31.anyOf[1].properties.options.properties.to.type }, message: "must be number,null" };
4718
4734
  if (vErrors === null) {
4719
4735
  vErrors = [err16];
4720
4736
  } else {
@@ -5006,7 +5022,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
5006
5022
  errors++;
5007
5023
  }
5008
5024
  if (!(data23 === "null" || data23 === "nan" || data23 === "null+nan" || data23 === "true" || data23 === "false" || data23 === "empty")) {
5009
- const err43 = { instancePath: instancePath + "/options/match", schemaPath: "#/anyOf/3/properties/options/properties/match/enum", keyword: "enum", params: { allowedValues: schema30.anyOf[3].properties.options.properties.match.enum }, message: "must be equal to one of the allowed values" };
5025
+ const err43 = { instancePath: instancePath + "/options/match", schemaPath: "#/anyOf/3/properties/options/properties/match/enum", keyword: "enum", params: { allowedValues: schema31.anyOf[3].properties.options.properties.match.enum }, message: "must be equal to one of the allowed values" };
5010
5026
  if (vErrors === null) {
5011
5027
  vErrors = [err43];
5012
5028
  } else {
@@ -5259,7 +5275,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
5259
5275
  errors++;
5260
5276
  }
5261
5277
  if (!(data9 === "absolute" || data9 === "percentage")) {
5262
- const err10 = { instancePath: instancePath + "/thresholds/mode", schemaPath: "#/properties/thresholds/properties/mode/enum", keyword: "enum", params: { allowedValues: schema28.properties.thresholds.properties.mode.enum }, message: "must be equal to one of the allowed values" };
5278
+ const err10 = { instancePath: instancePath + "/thresholds/mode", schemaPath: "#/properties/thresholds/properties/mode/enum", keyword: "enum", params: { allowedValues: schema29.properties.thresholds.properties.mode.enum }, message: "must be equal to one of the allowed values" };
5263
5279
  if (vErrors === null) {
5264
5280
  vErrors = [err10];
5265
5281
  } else {
@@ -5296,7 +5312,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
5296
5312
  if (data11.value !== void 0) {
5297
5313
  let data12 = data11.value;
5298
5314
  if (!(typeof data12 == "number") && data12 !== null) {
5299
- const err13 = { instancePath: instancePath + "/thresholds/steps/" + i0 + "/value", schemaPath: "#/definitions/ThresholdStep/properties/value/type", keyword: "type", params: { type: schema29.properties.value.type }, message: "must be number,null" };
5315
+ const err13 = { instancePath: instancePath + "/thresholds/steps/" + i0 + "/value", schemaPath: "#/definitions/ThresholdStep/properties/value/type", keyword: "type", params: { type: schema30.properties.value.type }, message: "must be number,null" };
5300
5316
  if (vErrors === null) {
5301
5317
  vErrors = [err13];
5302
5318
  } else {
@@ -5459,7 +5475,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
5459
5475
  errors++;
5460
5476
  }
5461
5477
  if (!(data22 === "line" || data22 === "bars" || data22 === "points")) {
5462
- const err27 = { instancePath: instancePath + "/custom/drawStyle", schemaPath: "#/properties/custom/properties/drawStyle/enum", keyword: "enum", params: { allowedValues: schema28.properties.custom.properties.drawStyle.enum }, message: "must be equal to one of the allowed values" };
5478
+ const err27 = { instancePath: instancePath + "/custom/drawStyle", schemaPath: "#/properties/custom/properties/drawStyle/enum", keyword: "enum", params: { allowedValues: schema29.properties.custom.properties.drawStyle.enum }, message: "must be equal to one of the allowed values" };
5463
5479
  if (vErrors === null) {
5464
5480
  vErrors = [err27];
5465
5481
  } else {
@@ -5502,7 +5518,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
5502
5518
  errors++;
5503
5519
  }
5504
5520
  if (!(data25 === "auto" || data25 === "always" || data25 === "never")) {
5505
- const err31 = { instancePath: instancePath + "/custom/showPoints", schemaPath: "#/properties/custom/properties/showPoints/enum", keyword: "enum", params: { allowedValues: schema28.properties.custom.properties.showPoints.enum }, message: "must be equal to one of the allowed values" };
5521
+ const err31 = { instancePath: instancePath + "/custom/showPoints", schemaPath: "#/properties/custom/properties/showPoints/enum", keyword: "enum", params: { allowedValues: schema29.properties.custom.properties.showPoints.enum }, message: "must be equal to one of the allowed values" };
5506
5522
  if (vErrors === null) {
5507
5523
  vErrors = [err31];
5508
5524
  } else {
@@ -6216,7 +6232,7 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
6216
6232
  errors++;
6217
6233
  }
6218
6234
  if (!(data37 === "h" || data37 === "v")) {
6219
- const err53 = { instancePath: instancePath + "/repeatDirection", schemaPath: "#/properties/repeatDirection/enum", keyword: "enum", params: { allowedValues: schema18.properties.repeatDirection.enum }, message: "must be equal to one of the allowed values" };
6235
+ const err53 = { instancePath: instancePath + "/repeatDirection", schemaPath: "#/properties/repeatDirection/enum", keyword: "enum", params: { allowedValues: schema19.properties.repeatDirection.enum }, message: "must be equal to one of the allowed values" };
6220
6236
  if (vErrors === null) {
6221
6237
  vErrors = [err53];
6222
6238
  } else {
@@ -6438,7 +6454,7 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
6438
6454
  validate18.errors = vErrors;
6439
6455
  return errors === 0;
6440
6456
  }
6441
- var schema39 = { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "label": { "type": "string" }, "hide": { "type": "number" }, "query": {}, "current": { "type": "object", "properties": { "text": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "value": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "selected": { "type": "boolean" } } }, "options": { "type": "array", "items": { "$ref": "#/definitions/VariableOption" } }, "multi": { "type": "boolean" }, "includeAll": { "type": "boolean" }, "allValue": { "type": ["string", "null"] }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }], "description": "Query variables: where the options come from." }, "refresh": { "type": "number", "description": "Query variables: 0/missing = never, 1 = on dashboard load, 2 = on time range change." }, "regex": { "type": "string", "description": "Query variables: `/pattern/flags` applied to each option's text." }, "sort": { "type": "number", "description": "Query variables: 0 = query order, 1/2 = alpha, 3/4 = numeric, 5/6 = alpha ignoring case, 7/8 = natural. Odd ascending." } }, "required": ["name", "type"] };
6457
+ var schema40 = { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "label": { "type": "string" }, "hide": { "type": "number" }, "query": {}, "current": { "type": "object", "properties": { "text": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "value": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "selected": { "type": "boolean" } } }, "options": { "type": "array", "items": { "$ref": "#/definitions/VariableOption" } }, "multi": { "type": "boolean" }, "includeAll": { "type": "boolean" }, "allValue": { "type": ["string", "null"] }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }], "description": "Query variables: where the options come from." }, "refresh": { "type": "number", "description": "Query variables: 0/missing = never, 1 = on dashboard load, 2 = on time range change." }, "regex": { "type": "string", "description": "Query variables: `/pattern/flags` applied to each option's text." }, "sort": { "type": "number", "description": "Query variables: 0 = query order, 1/2 = alpha, 3/4 = numeric, 5/6 = alpha ignoring case, 7/8 = natural. Odd ascending." } }, "required": ["name", "type"] };
6442
6458
  function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
6443
6459
  let vErrors = null;
6444
6460
  let errors = 0;
@@ -6858,7 +6874,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
6858
6874
  if (data.allValue !== void 0) {
6859
6875
  let data19 = data.allValue;
6860
6876
  if (typeof data19 !== "string" && data19 !== null) {
6861
- const err31 = { instancePath: instancePath + "/allValue", schemaPath: "#/properties/allValue/type", keyword: "type", params: { type: schema39.properties.allValue.type }, message: "must be string,null" };
6877
+ const err31 = { instancePath: instancePath + "/allValue", schemaPath: "#/properties/allValue/type", keyword: "type", params: { type: schema40.properties.allValue.type }, message: "must be string,null" };
6862
6878
  if (vErrors === null) {
6863
6879
  vErrors = [err31];
6864
6880
  } else {
@@ -7020,9 +7036,10 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
7020
7036
  }
7021
7037
  errors++;
7022
7038
  }
7023
- if (data.uid !== void 0) {
7024
- if (typeof data.uid !== "string") {
7025
- const err2 = { instancePath: instancePath + "/uid", schemaPath: "#/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7039
+ if (data.kind !== void 0) {
7040
+ let data0 = data.kind;
7041
+ if (typeof data0 !== "string") {
7042
+ const err2 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7026
7043
  if (vErrors === null) {
7027
7044
  vErrors = [err2];
7028
7045
  } else {
@@ -7030,232 +7047,252 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
7030
7047
  }
7031
7048
  errors++;
7032
7049
  }
7050
+ if (!(data0 === "form" || data0 === "dashboard")) {
7051
+ const err3 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" };
7052
+ if (vErrors === null) {
7053
+ vErrors = [err3];
7054
+ } else {
7055
+ vErrors.push(err3);
7056
+ }
7057
+ errors++;
7058
+ }
7059
+ }
7060
+ if (data.uid !== void 0) {
7061
+ if (typeof data.uid !== "string") {
7062
+ const err4 = { instancePath: instancePath + "/uid", schemaPath: "#/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7063
+ if (vErrors === null) {
7064
+ vErrors = [err4];
7065
+ } else {
7066
+ vErrors.push(err4);
7067
+ }
7068
+ errors++;
7069
+ }
7033
7070
  }
7034
7071
  if (data.title !== void 0) {
7035
7072
  if (typeof data.title !== "string") {
7036
- const err3 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7073
+ const err5 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7037
7074
  if (vErrors === null) {
7038
- vErrors = [err3];
7075
+ vErrors = [err5];
7039
7076
  } else {
7040
- vErrors.push(err3);
7077
+ vErrors.push(err5);
7041
7078
  }
7042
7079
  errors++;
7043
7080
  }
7044
7081
  }
7045
7082
  if (data.description !== void 0) {
7046
7083
  if (typeof data.description !== "string") {
7047
- const err4 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7084
+ const err6 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7048
7085
  if (vErrors === null) {
7049
- vErrors = [err4];
7086
+ vErrors = [err6];
7050
7087
  } else {
7051
- vErrors.push(err4);
7088
+ vErrors.push(err6);
7052
7089
  }
7053
7090
  errors++;
7054
7091
  }
7055
7092
  }
7056
7093
  if (data.tags !== void 0) {
7057
- let data3 = data.tags;
7058
- if (Array.isArray(data3)) {
7059
- const len0 = data3.length;
7094
+ let data4 = data.tags;
7095
+ if (Array.isArray(data4)) {
7096
+ const len0 = data4.length;
7060
7097
  for (let i0 = 0; i0 < len0; i0++) {
7061
- if (typeof data3[i0] !== "string") {
7062
- const err5 = { instancePath: instancePath + "/tags/" + i0, schemaPath: "#/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7098
+ if (typeof data4[i0] !== "string") {
7099
+ const err7 = { instancePath: instancePath + "/tags/" + i0, schemaPath: "#/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7063
7100
  if (vErrors === null) {
7064
- vErrors = [err5];
7101
+ vErrors = [err7];
7065
7102
  } else {
7066
- vErrors.push(err5);
7103
+ vErrors.push(err7);
7067
7104
  }
7068
7105
  errors++;
7069
7106
  }
7070
7107
  }
7071
7108
  } else {
7072
- const err6 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7109
+ const err8 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7073
7110
  if (vErrors === null) {
7074
- vErrors = [err6];
7111
+ vErrors = [err8];
7075
7112
  } else {
7076
- vErrors.push(err6);
7113
+ vErrors.push(err8);
7077
7114
  }
7078
7115
  errors++;
7079
7116
  }
7080
7117
  }
7081
7118
  if (data.panels !== void 0) {
7082
- let data5 = data.panels;
7083
- if (Array.isArray(data5)) {
7084
- const len1 = data5.length;
7119
+ let data6 = data.panels;
7120
+ if (Array.isArray(data6)) {
7121
+ const len1 = data6.length;
7085
7122
  for (let i1 = 0; i1 < len1; i1++) {
7086
- if (!validate18(data5[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
7123
+ if (!validate18(data6[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data6, parentDataProperty: i1, rootData })) {
7087
7124
  vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
7088
7125
  errors = vErrors.length;
7089
7126
  }
7090
7127
  }
7091
7128
  } else {
7092
- const err7 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7129
+ const err9 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7093
7130
  if (vErrors === null) {
7094
- vErrors = [err7];
7131
+ vErrors = [err9];
7095
7132
  } else {
7096
- vErrors.push(err7);
7133
+ vErrors.push(err9);
7097
7134
  }
7098
7135
  errors++;
7099
7136
  }
7100
7137
  }
7101
7138
  if (data.templating !== void 0) {
7102
- let data7 = data.templating;
7103
- if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
7104
- if (data7.list === void 0) {
7105
- const err8 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/required", keyword: "required", params: { missingProperty: "list" }, message: "must have required property 'list'" };
7139
+ let data8 = data.templating;
7140
+ if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
7141
+ if (data8.list === void 0) {
7142
+ const err10 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/required", keyword: "required", params: { missingProperty: "list" }, message: "must have required property 'list'" };
7106
7143
  if (vErrors === null) {
7107
- vErrors = [err8];
7144
+ vErrors = [err10];
7108
7145
  } else {
7109
- vErrors.push(err8);
7146
+ vErrors.push(err10);
7110
7147
  }
7111
7148
  errors++;
7112
7149
  }
7113
- if (data7.list !== void 0) {
7114
- let data8 = data7.list;
7115
- if (Array.isArray(data8)) {
7116
- const len2 = data8.length;
7150
+ if (data8.list !== void 0) {
7151
+ let data9 = data8.list;
7152
+ if (Array.isArray(data9)) {
7153
+ const len2 = data9.length;
7117
7154
  for (let i2 = 0; i2 < len2; i2++) {
7118
- if (!validate33(data8[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data8, parentDataProperty: i2, rootData })) {
7155
+ if (!validate33(data9[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data9, parentDataProperty: i2, rootData })) {
7119
7156
  vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
7120
7157
  errors = vErrors.length;
7121
7158
  }
7122
7159
  }
7123
7160
  } else {
7124
- const err9 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7161
+ const err11 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7125
7162
  if (vErrors === null) {
7126
- vErrors = [err9];
7163
+ vErrors = [err11];
7127
7164
  } else {
7128
- vErrors.push(err9);
7165
+ vErrors.push(err11);
7129
7166
  }
7130
7167
  errors++;
7131
7168
  }
7132
7169
  }
7133
7170
  } else {
7134
- const err10 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7171
+ const err12 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7135
7172
  if (vErrors === null) {
7136
- vErrors = [err10];
7173
+ vErrors = [err12];
7137
7174
  } else {
7138
- vErrors.push(err10);
7175
+ vErrors.push(err12);
7139
7176
  }
7140
7177
  errors++;
7141
7178
  }
7142
7179
  }
7143
7180
  if (data.time !== void 0) {
7144
- let data10 = data.time;
7145
- if (data10 && typeof data10 == "object" && !Array.isArray(data10)) {
7146
- if (data10.from === void 0) {
7147
- const err11 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "from" }, message: "must have required property 'from'" };
7181
+ let data11 = data.time;
7182
+ if (data11 && typeof data11 == "object" && !Array.isArray(data11)) {
7183
+ if (data11.from === void 0) {
7184
+ const err13 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "from" }, message: "must have required property 'from'" };
7148
7185
  if (vErrors === null) {
7149
- vErrors = [err11];
7186
+ vErrors = [err13];
7150
7187
  } else {
7151
- vErrors.push(err11);
7188
+ vErrors.push(err13);
7152
7189
  }
7153
7190
  errors++;
7154
7191
  }
7155
- if (data10.to === void 0) {
7156
- const err12 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "to" }, message: "must have required property 'to'" };
7192
+ if (data11.to === void 0) {
7193
+ const err14 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "to" }, message: "must have required property 'to'" };
7157
7194
  if (vErrors === null) {
7158
- vErrors = [err12];
7195
+ vErrors = [err14];
7159
7196
  } else {
7160
- vErrors.push(err12);
7197
+ vErrors.push(err14);
7161
7198
  }
7162
7199
  errors++;
7163
7200
  }
7164
- if (data10.from !== void 0) {
7165
- if (typeof data10.from !== "string") {
7166
- const err13 = { instancePath: instancePath + "/time/from", schemaPath: "#/properties/time/properties/from/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7201
+ if (data11.from !== void 0) {
7202
+ if (typeof data11.from !== "string") {
7203
+ const err15 = { instancePath: instancePath + "/time/from", schemaPath: "#/properties/time/properties/from/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7167
7204
  if (vErrors === null) {
7168
- vErrors = [err13];
7205
+ vErrors = [err15];
7169
7206
  } else {
7170
- vErrors.push(err13);
7207
+ vErrors.push(err15);
7171
7208
  }
7172
7209
  errors++;
7173
7210
  }
7174
7211
  }
7175
- if (data10.to !== void 0) {
7176
- if (typeof data10.to !== "string") {
7177
- const err14 = { instancePath: instancePath + "/time/to", schemaPath: "#/properties/time/properties/to/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7212
+ if (data11.to !== void 0) {
7213
+ if (typeof data11.to !== "string") {
7214
+ const err16 = { instancePath: instancePath + "/time/to", schemaPath: "#/properties/time/properties/to/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7178
7215
  if (vErrors === null) {
7179
- vErrors = [err14];
7216
+ vErrors = [err16];
7180
7217
  } else {
7181
- vErrors.push(err14);
7218
+ vErrors.push(err16);
7182
7219
  }
7183
7220
  errors++;
7184
7221
  }
7185
7222
  }
7186
7223
  } else {
7187
- const err15 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7224
+ const err17 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7188
7225
  if (vErrors === null) {
7189
- vErrors = [err15];
7226
+ vErrors = [err17];
7190
7227
  } else {
7191
- vErrors.push(err15);
7228
+ vErrors.push(err17);
7192
7229
  }
7193
7230
  errors++;
7194
7231
  }
7195
7232
  }
7196
7233
  if (data.timezone !== void 0) {
7197
7234
  if (typeof data.timezone !== "string") {
7198
- const err16 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7235
+ const err18 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7199
7236
  if (vErrors === null) {
7200
- vErrors = [err16];
7237
+ vErrors = [err18];
7201
7238
  } else {
7202
- vErrors.push(err16);
7239
+ vErrors.push(err18);
7203
7240
  }
7204
7241
  errors++;
7205
7242
  }
7206
7243
  }
7207
7244
  if (data.refresh !== void 0) {
7208
- let data14 = data.refresh;
7209
- const _errs28 = errors;
7210
- let valid9 = false;
7211
- const _errs29 = errors;
7212
- if (typeof data14 !== "string") {
7213
- const err17 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7245
+ let data15 = data.refresh;
7246
+ const _errs31 = errors;
7247
+ let valid10 = false;
7248
+ const _errs32 = errors;
7249
+ if (typeof data15 !== "string") {
7250
+ const err19 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7214
7251
  if (vErrors === null) {
7215
- vErrors = [err17];
7252
+ vErrors = [err19];
7216
7253
  } else {
7217
- vErrors.push(err17);
7254
+ vErrors.push(err19);
7218
7255
  }
7219
7256
  errors++;
7220
7257
  }
7221
- var _valid0 = _errs29 === errors;
7222
- valid9 = valid9 || _valid0;
7223
- if (!valid9) {
7224
- const _errs31 = errors;
7225
- if (typeof data14 !== "boolean") {
7226
- const err18 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
7258
+ var _valid0 = _errs32 === errors;
7259
+ valid10 = valid10 || _valid0;
7260
+ if (!valid10) {
7261
+ const _errs34 = errors;
7262
+ if (typeof data15 !== "boolean") {
7263
+ const err20 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
7227
7264
  if (vErrors === null) {
7228
- vErrors = [err18];
7265
+ vErrors = [err20];
7229
7266
  } else {
7230
- vErrors.push(err18);
7267
+ vErrors.push(err20);
7231
7268
  }
7232
7269
  errors++;
7233
7270
  }
7234
- if (false !== data14) {
7235
- const err19 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/const", keyword: "const", params: { allowedValue: false }, message: "must be equal to constant" };
7271
+ if (false !== data15) {
7272
+ const err21 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/const", keyword: "const", params: { allowedValue: false }, message: "must be equal to constant" };
7236
7273
  if (vErrors === null) {
7237
- vErrors = [err19];
7274
+ vErrors = [err21];
7238
7275
  } else {
7239
- vErrors.push(err19);
7276
+ vErrors.push(err21);
7240
7277
  }
7241
7278
  errors++;
7242
7279
  }
7243
- var _valid0 = _errs31 === errors;
7244
- valid9 = valid9 || _valid0;
7280
+ var _valid0 = _errs34 === errors;
7281
+ valid10 = valid10 || _valid0;
7245
7282
  }
7246
- if (!valid9) {
7247
- const err20 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7283
+ if (!valid10) {
7284
+ const err22 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7248
7285
  if (vErrors === null) {
7249
- vErrors = [err20];
7286
+ vErrors = [err22];
7250
7287
  } else {
7251
- vErrors.push(err20);
7288
+ vErrors.push(err22);
7252
7289
  }
7253
7290
  errors++;
7254
7291
  } else {
7255
- errors = _errs28;
7292
+ errors = _errs31;
7256
7293
  if (vErrors !== null) {
7257
- if (_errs28) {
7258
- vErrors.length = _errs28;
7294
+ if (_errs31) {
7295
+ vErrors.length = _errs31;
7259
7296
  } else {
7260
7297
  vErrors = null;
7261
7298
  }
@@ -7263,89 +7300,89 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
7263
7300
  }
7264
7301
  }
7265
7302
  if (data.__inputs !== void 0) {
7266
- let data15 = data.__inputs;
7267
- if (Array.isArray(data15)) {
7268
- const len3 = data15.length;
7303
+ let data16 = data.__inputs;
7304
+ if (Array.isArray(data16)) {
7305
+ const len3 = data16.length;
7269
7306
  for (let i3 = 0; i3 < len3; i3++) {
7270
- let data16 = data15[i3];
7271
- if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
7272
- if (data16.name === void 0) {
7273
- const err21 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
7307
+ let data17 = data16[i3];
7308
+ if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
7309
+ if (data17.name === void 0) {
7310
+ const err23 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
7274
7311
  if (vErrors === null) {
7275
- vErrors = [err21];
7312
+ vErrors = [err23];
7276
7313
  } else {
7277
- vErrors.push(err21);
7314
+ vErrors.push(err23);
7278
7315
  }
7279
7316
  errors++;
7280
7317
  }
7281
- if (data16.type === void 0) {
7282
- const err22 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
7318
+ if (data17.type === void 0) {
7319
+ const err24 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
7283
7320
  if (vErrors === null) {
7284
- vErrors = [err22];
7321
+ vErrors = [err24];
7285
7322
  } else {
7286
- vErrors.push(err22);
7323
+ vErrors.push(err24);
7287
7324
  }
7288
7325
  errors++;
7289
7326
  }
7290
- if (data16.name !== void 0) {
7291
- if (typeof data16.name !== "string") {
7292
- const err23 = { instancePath: instancePath + "/__inputs/" + i3 + "/name", schemaPath: "#/properties/__inputs/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7327
+ if (data17.name !== void 0) {
7328
+ if (typeof data17.name !== "string") {
7329
+ const err25 = { instancePath: instancePath + "/__inputs/" + i3 + "/name", schemaPath: "#/properties/__inputs/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7293
7330
  if (vErrors === null) {
7294
- vErrors = [err23];
7331
+ vErrors = [err25];
7295
7332
  } else {
7296
- vErrors.push(err23);
7333
+ vErrors.push(err25);
7297
7334
  }
7298
7335
  errors++;
7299
7336
  }
7300
7337
  }
7301
- if (data16.type !== void 0) {
7302
- if (typeof data16.type !== "string") {
7303
- const err24 = { instancePath: instancePath + "/__inputs/" + i3 + "/type", schemaPath: "#/properties/__inputs/items/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7338
+ if (data17.type !== void 0) {
7339
+ if (typeof data17.type !== "string") {
7340
+ const err26 = { instancePath: instancePath + "/__inputs/" + i3 + "/type", schemaPath: "#/properties/__inputs/items/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7304
7341
  if (vErrors === null) {
7305
- vErrors = [err24];
7342
+ vErrors = [err26];
7306
7343
  } else {
7307
- vErrors.push(err24);
7344
+ vErrors.push(err26);
7308
7345
  }
7309
7346
  errors++;
7310
7347
  }
7311
7348
  }
7312
- if (data16.pluginId !== void 0) {
7313
- if (typeof data16.pluginId !== "string") {
7314
- const err25 = { instancePath: instancePath + "/__inputs/" + i3 + "/pluginId", schemaPath: "#/properties/__inputs/items/properties/pluginId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7349
+ if (data17.pluginId !== void 0) {
7350
+ if (typeof data17.pluginId !== "string") {
7351
+ const err27 = { instancePath: instancePath + "/__inputs/" + i3 + "/pluginId", schemaPath: "#/properties/__inputs/items/properties/pluginId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7315
7352
  if (vErrors === null) {
7316
- vErrors = [err25];
7353
+ vErrors = [err27];
7317
7354
  } else {
7318
- vErrors.push(err25);
7355
+ vErrors.push(err27);
7319
7356
  }
7320
7357
  errors++;
7321
7358
  }
7322
7359
  }
7323
7360
  } else {
7324
- const err26 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7361
+ const err28 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7325
7362
  if (vErrors === null) {
7326
- vErrors = [err26];
7363
+ vErrors = [err28];
7327
7364
  } else {
7328
- vErrors.push(err26);
7365
+ vErrors.push(err28);
7329
7366
  }
7330
7367
  errors++;
7331
7368
  }
7332
7369
  }
7333
7370
  } else {
7334
- const err27 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7371
+ const err29 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7335
7372
  if (vErrors === null) {
7336
- vErrors = [err27];
7373
+ vErrors = [err29];
7337
7374
  } else {
7338
- vErrors.push(err27);
7375
+ vErrors.push(err29);
7339
7376
  }
7340
7377
  errors++;
7341
7378
  }
7342
7379
  }
7343
7380
  } else {
7344
- const err28 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7381
+ const err30 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7345
7382
  if (vErrors === null) {
7346
- vErrors = [err28];
7383
+ vErrors = [err30];
7347
7384
  } else {
7348
- vErrors.push(err28);
7385
+ vErrors.push(err30);
7349
7386
  }
7350
7387
  errors++;
7351
7388
  }
@@ -7579,9 +7616,10 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
7579
7616
  }
7580
7617
  errors++;
7581
7618
  }
7582
- if (data.uid !== void 0) {
7583
- if (typeof data.uid !== "string") {
7584
- const err2 = { instancePath: instancePath + "/uid", schemaPath: "#/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7619
+ if (data.kind !== void 0) {
7620
+ let data0 = data.kind;
7621
+ if (typeof data0 !== "string") {
7622
+ const err2 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7585
7623
  if (vErrors === null) {
7586
7624
  vErrors = [err2];
7587
7625
  } else {
@@ -7589,232 +7627,252 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
7589
7627
  }
7590
7628
  errors++;
7591
7629
  }
7630
+ if (!(data0 === "form" || data0 === "dashboard")) {
7631
+ const err3 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" };
7632
+ if (vErrors === null) {
7633
+ vErrors = [err3];
7634
+ } else {
7635
+ vErrors.push(err3);
7636
+ }
7637
+ errors++;
7638
+ }
7639
+ }
7640
+ if (data.uid !== void 0) {
7641
+ if (typeof data.uid !== "string") {
7642
+ const err4 = { instancePath: instancePath + "/uid", schemaPath: "#/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7643
+ if (vErrors === null) {
7644
+ vErrors = [err4];
7645
+ } else {
7646
+ vErrors.push(err4);
7647
+ }
7648
+ errors++;
7649
+ }
7592
7650
  }
7593
7651
  if (data.title !== void 0) {
7594
7652
  if (typeof data.title !== "string") {
7595
- const err3 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7653
+ const err5 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7596
7654
  if (vErrors === null) {
7597
- vErrors = [err3];
7655
+ vErrors = [err5];
7598
7656
  } else {
7599
- vErrors.push(err3);
7657
+ vErrors.push(err5);
7600
7658
  }
7601
7659
  errors++;
7602
7660
  }
7603
7661
  }
7604
7662
  if (data.description !== void 0) {
7605
7663
  if (typeof data.description !== "string") {
7606
- const err4 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7664
+ const err6 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7607
7665
  if (vErrors === null) {
7608
- vErrors = [err4];
7666
+ vErrors = [err6];
7609
7667
  } else {
7610
- vErrors.push(err4);
7668
+ vErrors.push(err6);
7611
7669
  }
7612
7670
  errors++;
7613
7671
  }
7614
7672
  }
7615
7673
  if (data.tags !== void 0) {
7616
- let data3 = data.tags;
7617
- if (Array.isArray(data3)) {
7618
- const len0 = data3.length;
7674
+ let data4 = data.tags;
7675
+ if (Array.isArray(data4)) {
7676
+ const len0 = data4.length;
7619
7677
  for (let i0 = 0; i0 < len0; i0++) {
7620
- if (typeof data3[i0] !== "string") {
7621
- const err5 = { instancePath: instancePath + "/tags/" + i0, schemaPath: "#/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7678
+ if (typeof data4[i0] !== "string") {
7679
+ const err7 = { instancePath: instancePath + "/tags/" + i0, schemaPath: "#/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7622
7680
  if (vErrors === null) {
7623
- vErrors = [err5];
7681
+ vErrors = [err7];
7624
7682
  } else {
7625
- vErrors.push(err5);
7683
+ vErrors.push(err7);
7626
7684
  }
7627
7685
  errors++;
7628
7686
  }
7629
7687
  }
7630
7688
  } else {
7631
- const err6 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7689
+ const err8 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7632
7690
  if (vErrors === null) {
7633
- vErrors = [err6];
7691
+ vErrors = [err8];
7634
7692
  } else {
7635
- vErrors.push(err6);
7693
+ vErrors.push(err8);
7636
7694
  }
7637
7695
  errors++;
7638
7696
  }
7639
7697
  }
7640
7698
  if (data.panels !== void 0) {
7641
- let data5 = data.panels;
7642
- if (Array.isArray(data5)) {
7643
- const len1 = data5.length;
7699
+ let data6 = data.panels;
7700
+ if (Array.isArray(data6)) {
7701
+ const len1 = data6.length;
7644
7702
  for (let i1 = 0; i1 < len1; i1++) {
7645
- if (!validate18(data5[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
7703
+ if (!validate18(data6[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data6, parentDataProperty: i1, rootData })) {
7646
7704
  vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
7647
7705
  errors = vErrors.length;
7648
7706
  }
7649
7707
  }
7650
7708
  } else {
7651
- const err7 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7709
+ const err9 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7652
7710
  if (vErrors === null) {
7653
- vErrors = [err7];
7711
+ vErrors = [err9];
7654
7712
  } else {
7655
- vErrors.push(err7);
7713
+ vErrors.push(err9);
7656
7714
  }
7657
7715
  errors++;
7658
7716
  }
7659
7717
  }
7660
7718
  if (data.templating !== void 0) {
7661
- let data7 = data.templating;
7662
- if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
7663
- if (data7.list === void 0) {
7664
- const err8 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/required", keyword: "required", params: { missingProperty: "list" }, message: "must have required property 'list'" };
7719
+ let data8 = data.templating;
7720
+ if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
7721
+ if (data8.list === void 0) {
7722
+ const err10 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/required", keyword: "required", params: { missingProperty: "list" }, message: "must have required property 'list'" };
7665
7723
  if (vErrors === null) {
7666
- vErrors = [err8];
7724
+ vErrors = [err10];
7667
7725
  } else {
7668
- vErrors.push(err8);
7726
+ vErrors.push(err10);
7669
7727
  }
7670
7728
  errors++;
7671
7729
  }
7672
- if (data7.list !== void 0) {
7673
- let data8 = data7.list;
7674
- if (Array.isArray(data8)) {
7675
- const len2 = data8.length;
7730
+ if (data8.list !== void 0) {
7731
+ let data9 = data8.list;
7732
+ if (Array.isArray(data9)) {
7733
+ const len2 = data9.length;
7676
7734
  for (let i2 = 0; i2 < len2; i2++) {
7677
- if (!validate33(data8[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data8, parentDataProperty: i2, rootData })) {
7735
+ if (!validate33(data9[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data9, parentDataProperty: i2, rootData })) {
7678
7736
  vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
7679
7737
  errors = vErrors.length;
7680
7738
  }
7681
7739
  }
7682
7740
  } else {
7683
- const err9 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7741
+ const err11 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7684
7742
  if (vErrors === null) {
7685
- vErrors = [err9];
7743
+ vErrors = [err11];
7686
7744
  } else {
7687
- vErrors.push(err9);
7745
+ vErrors.push(err11);
7688
7746
  }
7689
7747
  errors++;
7690
7748
  }
7691
7749
  }
7692
7750
  } else {
7693
- const err10 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7751
+ const err12 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7694
7752
  if (vErrors === null) {
7695
- vErrors = [err10];
7753
+ vErrors = [err12];
7696
7754
  } else {
7697
- vErrors.push(err10);
7755
+ vErrors.push(err12);
7698
7756
  }
7699
7757
  errors++;
7700
7758
  }
7701
7759
  }
7702
7760
  if (data.time !== void 0) {
7703
- let data10 = data.time;
7704
- if (data10 && typeof data10 == "object" && !Array.isArray(data10)) {
7705
- if (data10.from === void 0) {
7706
- const err11 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "from" }, message: "must have required property 'from'" };
7761
+ let data11 = data.time;
7762
+ if (data11 && typeof data11 == "object" && !Array.isArray(data11)) {
7763
+ if (data11.from === void 0) {
7764
+ const err13 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "from" }, message: "must have required property 'from'" };
7707
7765
  if (vErrors === null) {
7708
- vErrors = [err11];
7766
+ vErrors = [err13];
7709
7767
  } else {
7710
- vErrors.push(err11);
7768
+ vErrors.push(err13);
7711
7769
  }
7712
7770
  errors++;
7713
7771
  }
7714
- if (data10.to === void 0) {
7715
- const err12 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "to" }, message: "must have required property 'to'" };
7772
+ if (data11.to === void 0) {
7773
+ const err14 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "to" }, message: "must have required property 'to'" };
7716
7774
  if (vErrors === null) {
7717
- vErrors = [err12];
7775
+ vErrors = [err14];
7718
7776
  } else {
7719
- vErrors.push(err12);
7777
+ vErrors.push(err14);
7720
7778
  }
7721
7779
  errors++;
7722
7780
  }
7723
- if (data10.from !== void 0) {
7724
- if (typeof data10.from !== "string") {
7725
- const err13 = { instancePath: instancePath + "/time/from", schemaPath: "#/properties/time/properties/from/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7781
+ if (data11.from !== void 0) {
7782
+ if (typeof data11.from !== "string") {
7783
+ const err15 = { instancePath: instancePath + "/time/from", schemaPath: "#/properties/time/properties/from/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7726
7784
  if (vErrors === null) {
7727
- vErrors = [err13];
7785
+ vErrors = [err15];
7728
7786
  } else {
7729
- vErrors.push(err13);
7787
+ vErrors.push(err15);
7730
7788
  }
7731
7789
  errors++;
7732
7790
  }
7733
7791
  }
7734
- if (data10.to !== void 0) {
7735
- if (typeof data10.to !== "string") {
7736
- const err14 = { instancePath: instancePath + "/time/to", schemaPath: "#/properties/time/properties/to/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7792
+ if (data11.to !== void 0) {
7793
+ if (typeof data11.to !== "string") {
7794
+ const err16 = { instancePath: instancePath + "/time/to", schemaPath: "#/properties/time/properties/to/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7737
7795
  if (vErrors === null) {
7738
- vErrors = [err14];
7796
+ vErrors = [err16];
7739
7797
  } else {
7740
- vErrors.push(err14);
7798
+ vErrors.push(err16);
7741
7799
  }
7742
7800
  errors++;
7743
7801
  }
7744
7802
  }
7745
7803
  } else {
7746
- const err15 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7804
+ const err17 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7747
7805
  if (vErrors === null) {
7748
- vErrors = [err15];
7806
+ vErrors = [err17];
7749
7807
  } else {
7750
- vErrors.push(err15);
7808
+ vErrors.push(err17);
7751
7809
  }
7752
7810
  errors++;
7753
7811
  }
7754
7812
  }
7755
7813
  if (data.timezone !== void 0) {
7756
7814
  if (typeof data.timezone !== "string") {
7757
- const err16 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7815
+ const err18 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7758
7816
  if (vErrors === null) {
7759
- vErrors = [err16];
7817
+ vErrors = [err18];
7760
7818
  } else {
7761
- vErrors.push(err16);
7819
+ vErrors.push(err18);
7762
7820
  }
7763
7821
  errors++;
7764
7822
  }
7765
7823
  }
7766
7824
  if (data.refresh !== void 0) {
7767
- let data14 = data.refresh;
7768
- const _errs28 = errors;
7769
- let valid9 = false;
7770
- const _errs29 = errors;
7771
- if (typeof data14 !== "string") {
7772
- const err17 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7825
+ let data15 = data.refresh;
7826
+ const _errs31 = errors;
7827
+ let valid10 = false;
7828
+ const _errs32 = errors;
7829
+ if (typeof data15 !== "string") {
7830
+ const err19 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7773
7831
  if (vErrors === null) {
7774
- vErrors = [err17];
7832
+ vErrors = [err19];
7775
7833
  } else {
7776
- vErrors.push(err17);
7834
+ vErrors.push(err19);
7777
7835
  }
7778
7836
  errors++;
7779
7837
  }
7780
- var _valid0 = _errs29 === errors;
7781
- valid9 = valid9 || _valid0;
7782
- if (!valid9) {
7783
- const _errs31 = errors;
7784
- if (typeof data14 !== "boolean") {
7785
- const err18 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
7838
+ var _valid0 = _errs32 === errors;
7839
+ valid10 = valid10 || _valid0;
7840
+ if (!valid10) {
7841
+ const _errs34 = errors;
7842
+ if (typeof data15 !== "boolean") {
7843
+ const err20 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
7786
7844
  if (vErrors === null) {
7787
- vErrors = [err18];
7845
+ vErrors = [err20];
7788
7846
  } else {
7789
- vErrors.push(err18);
7847
+ vErrors.push(err20);
7790
7848
  }
7791
7849
  errors++;
7792
7850
  }
7793
- if (false !== data14) {
7794
- const err19 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/const", keyword: "const", params: { allowedValue: false }, message: "must be equal to constant" };
7851
+ if (false !== data15) {
7852
+ const err21 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/const", keyword: "const", params: { allowedValue: false }, message: "must be equal to constant" };
7795
7853
  if (vErrors === null) {
7796
- vErrors = [err19];
7854
+ vErrors = [err21];
7797
7855
  } else {
7798
- vErrors.push(err19);
7856
+ vErrors.push(err21);
7799
7857
  }
7800
7858
  errors++;
7801
7859
  }
7802
- var _valid0 = _errs31 === errors;
7803
- valid9 = valid9 || _valid0;
7860
+ var _valid0 = _errs34 === errors;
7861
+ valid10 = valid10 || _valid0;
7804
7862
  }
7805
- if (!valid9) {
7806
- const err20 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7863
+ if (!valid10) {
7864
+ const err22 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
7807
7865
  if (vErrors === null) {
7808
- vErrors = [err20];
7866
+ vErrors = [err22];
7809
7867
  } else {
7810
- vErrors.push(err20);
7868
+ vErrors.push(err22);
7811
7869
  }
7812
7870
  errors++;
7813
7871
  } else {
7814
- errors = _errs28;
7872
+ errors = _errs31;
7815
7873
  if (vErrors !== null) {
7816
- if (_errs28) {
7817
- vErrors.length = _errs28;
7874
+ if (_errs31) {
7875
+ vErrors.length = _errs31;
7818
7876
  } else {
7819
7877
  vErrors = null;
7820
7878
  }
@@ -7822,89 +7880,89 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
7822
7880
  }
7823
7881
  }
7824
7882
  if (data.__inputs !== void 0) {
7825
- let data15 = data.__inputs;
7826
- if (Array.isArray(data15)) {
7827
- const len3 = data15.length;
7883
+ let data16 = data.__inputs;
7884
+ if (Array.isArray(data16)) {
7885
+ const len3 = data16.length;
7828
7886
  for (let i3 = 0; i3 < len3; i3++) {
7829
- let data16 = data15[i3];
7830
- if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
7831
- if (data16.name === void 0) {
7832
- const err21 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
7887
+ let data17 = data16[i3];
7888
+ if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
7889
+ if (data17.name === void 0) {
7890
+ const err23 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
7833
7891
  if (vErrors === null) {
7834
- vErrors = [err21];
7892
+ vErrors = [err23];
7835
7893
  } else {
7836
- vErrors.push(err21);
7894
+ vErrors.push(err23);
7837
7895
  }
7838
7896
  errors++;
7839
7897
  }
7840
- if (data16.type === void 0) {
7841
- const err22 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
7898
+ if (data17.type === void 0) {
7899
+ const err24 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
7842
7900
  if (vErrors === null) {
7843
- vErrors = [err22];
7901
+ vErrors = [err24];
7844
7902
  } else {
7845
- vErrors.push(err22);
7903
+ vErrors.push(err24);
7846
7904
  }
7847
7905
  errors++;
7848
7906
  }
7849
- if (data16.name !== void 0) {
7850
- if (typeof data16.name !== "string") {
7851
- const err23 = { instancePath: instancePath + "/__inputs/" + i3 + "/name", schemaPath: "#/properties/__inputs/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7907
+ if (data17.name !== void 0) {
7908
+ if (typeof data17.name !== "string") {
7909
+ const err25 = { instancePath: instancePath + "/__inputs/" + i3 + "/name", schemaPath: "#/properties/__inputs/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7852
7910
  if (vErrors === null) {
7853
- vErrors = [err23];
7911
+ vErrors = [err25];
7854
7912
  } else {
7855
- vErrors.push(err23);
7913
+ vErrors.push(err25);
7856
7914
  }
7857
7915
  errors++;
7858
7916
  }
7859
7917
  }
7860
- if (data16.type !== void 0) {
7861
- if (typeof data16.type !== "string") {
7862
- const err24 = { instancePath: instancePath + "/__inputs/" + i3 + "/type", schemaPath: "#/properties/__inputs/items/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7918
+ if (data17.type !== void 0) {
7919
+ if (typeof data17.type !== "string") {
7920
+ const err26 = { instancePath: instancePath + "/__inputs/" + i3 + "/type", schemaPath: "#/properties/__inputs/items/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7863
7921
  if (vErrors === null) {
7864
- vErrors = [err24];
7922
+ vErrors = [err26];
7865
7923
  } else {
7866
- vErrors.push(err24);
7924
+ vErrors.push(err26);
7867
7925
  }
7868
7926
  errors++;
7869
7927
  }
7870
7928
  }
7871
- if (data16.pluginId !== void 0) {
7872
- if (typeof data16.pluginId !== "string") {
7873
- const err25 = { instancePath: instancePath + "/__inputs/" + i3 + "/pluginId", schemaPath: "#/properties/__inputs/items/properties/pluginId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7929
+ if (data17.pluginId !== void 0) {
7930
+ if (typeof data17.pluginId !== "string") {
7931
+ const err27 = { instancePath: instancePath + "/__inputs/" + i3 + "/pluginId", schemaPath: "#/properties/__inputs/items/properties/pluginId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
7874
7932
  if (vErrors === null) {
7875
- vErrors = [err25];
7933
+ vErrors = [err27];
7876
7934
  } else {
7877
- vErrors.push(err25);
7935
+ vErrors.push(err27);
7878
7936
  }
7879
7937
  errors++;
7880
7938
  }
7881
7939
  }
7882
7940
  } else {
7883
- const err26 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7941
+ const err28 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7884
7942
  if (vErrors === null) {
7885
- vErrors = [err26];
7943
+ vErrors = [err28];
7886
7944
  } else {
7887
- vErrors.push(err26);
7945
+ vErrors.push(err28);
7888
7946
  }
7889
7947
  errors++;
7890
7948
  }
7891
7949
  }
7892
7950
  } else {
7893
- const err27 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7951
+ const err29 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
7894
7952
  if (vErrors === null) {
7895
- vErrors = [err27];
7953
+ vErrors = [err29];
7896
7954
  } else {
7897
- vErrors.push(err27);
7955
+ vErrors.push(err29);
7898
7956
  }
7899
7957
  errors++;
7900
7958
  }
7901
7959
  }
7902
7960
  } else {
7903
- const err28 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7961
+ const err30 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
7904
7962
  if (vErrors === null) {
7905
- vErrors = [err28];
7963
+ vErrors = [err30];
7906
7964
  } else {
7907
- vErrors.push(err28);
7965
+ vErrors.push(err30);
7908
7966
  }
7909
7967
  errors++;
7910
7968
  }
@@ -8636,6 +8694,8 @@ function validateBundle(bundle, file = "manifest") {
8636
8694
  const doc = bundle.documents[ref.id];
8637
8695
  if (!doc && ref.id in bundle.manifest.documents) continue;
8638
8696
  if (!doc) issues.push({ severity: "error", path: `${file}: ${ref.path}`, message: `no document "${ref.id}" in documents` });
8697
+ else if (doc.kind && doc.kind !== ref.kind)
8698
+ issues.push({ severity: "warning", path: `${file}: ${ref.path}`, message: `"${ref.id}" is a ${doc.kind}, shown here as a ${ref.kind}` });
8639
8699
  else if (ref.kind === "form" && !inputPanels(doc).length)
8640
8700
  issues.push({ severity: "warning", path: `${file}: ${ref.path}`, message: `"${ref.id}" has no input-* panels to fill in` });
8641
8701
  }
@@ -10695,9 +10755,11 @@ function newPanel(type, metric = "value") {
10695
10755
  }
10696
10756
  function newDocument(kind, title) {
10697
10757
  const doc = kind === "form" ? {
10758
+ kind,
10698
10759
  title,
10699
10760
  panels: [{ id: 1, type: "input-number", title: "Value", gridPos: { x: 0, y: 0, w: 24, h: 3 }, options: { metric: "value", step: 1 } }]
10700
10761
  } : {
10762
+ kind,
10701
10763
  title,
10702
10764
  time: { from: "now-30d", to: "now" },
10703
10765
  panels: [
@@ -11378,7 +11440,7 @@ function tabsShowing(tabs, ids) {
11378
11440
  });
11379
11441
  }
11380
11442
  function makeTemplate(manifest, documents, ids, meta) {
11381
- const docs = ids.filter((id) => documents[id]).map((id) => ({ kind: inputPanels(documents[id]).length ? "form" : "dashboard", id, dashboard: structuredClone(documents[id]) }));
11443
+ const docs = ids.filter((id) => documents[id]).map((id) => ({ kind: documentKind(documents[id]), id, dashboard: structuredClone(documents[id]) }));
11382
11444
  return {
11383
11445
  $modelform: "template",
11384
11446
  version: TEMPLATE_VERSION,
@@ -11409,6 +11471,7 @@ function parseTemplate(text) {
11409
11471
  seen.add(d.id);
11410
11472
  const { dashboard, issues } = prepareDashboard(d.dashboard, d.id);
11411
11473
  if (!dashboard) return { error: `"${d.id}" can\u2019t be shown: ${_nullishCoalesce(_optionalChain([issues, 'access', _324 => _324.find, 'call', _325 => _325((x) => x.severity === "error"), 'optionalAccess', _326 => _326.message]), () => ( "it isn\u2019t a dashboard"))}` };
11474
+ if (dashboard.kind && dashboard.kind !== d.kind) return { error: `"${d.id}" is listed as a ${d.kind} but says it\u2019s a ${dashboard.kind}` };
11412
11475
  documents.push({ kind: d.kind, id: d.id, dashboard });
11413
11476
  }
11414
11477
  const tabs = Array.isArray(json.tabs) ? json.tabs.filter((t) => isObject5(t) && typeof t.id === "string" && typeof t.title === "string" && isObject5(t.screen)) : [];
@@ -11474,7 +11537,8 @@ function applyTemplate(manifestText, paths, template, options = {}) {
11474
11537
  taken.add(id);
11475
11538
  files.add(path);
11476
11539
  ids[doc.id] = id;
11477
- const dashboard = options.metrics ? { ...doc.dashboard, panels: renameMetrics(_nullishCoalesce(doc.dashboard.panels, () => ( [])), options.metrics) } : doc.dashboard;
11540
+ const { kind: _kind, ...rest } = doc.dashboard;
11541
+ const dashboard = { kind: doc.kind, ...rest, ...options.metrics && { panels: renameMetrics(_nullishCoalesce(doc.dashboard.panels, () => ( [])), options.metrics) } };
11478
11542
  out[path] = JSON.stringify(dashboard, null, 2) + "\n";
11479
11543
  if (manifest.documents) edits.push({ path: ["documents", id], value: path });
11480
11544
  else {
@@ -11503,6 +11567,236 @@ function applyTemplate(manifestText, paths, template, options = {}) {
11503
11567
  return { manifest: applyJsonEdits(manifestText, edits), files: out, ids, tabs: added };
11504
11568
  }
11505
11569
 
11570
+ // src/core/authoring.ts
11571
+ var AUTHORING_GUIDE = `# modelform templates
11572
+
11573
+ A template is JSON that adds forms (for recording entries) and dashboards (for charting them) to an app, plus tabs to show them.
11574
+
11575
+ \`\`\`
11576
+ {
11577
+ "$modelform": "template",
11578
+ "version": 1,
11579
+ "title": "Short name",
11580
+ "description": "One sentence on what it's for.",
11581
+ "documents": [ { "kind": "form" | "dashboard", "id": "letters-digits-dashes", "dashboard": { ...document } } ],
11582
+ "tabs": [ ...tabs ]
11583
+ }
11584
+ \`\`\`
11585
+
11586
+ ## Documents
11587
+
11588
+ A document is a subset of Grafana's dashboard JSON: \`{ "kind": "form" | "dashboard", "title": "\u2026", "panels": [ \u2026 ] }\`, and dashboards add \`"time": { "from": "now-30d", "to": "now" }\`. Its \`kind\` matches its entry in \`documents\`.
11589
+
11590
+ Every panel has an \`id\` (a number, unique in its document), a \`type\`, a \`title\`, and a \`gridPos\` \`{ "x", "y", "w", "h" }\` on a 24-column grid: \`w: 24\` is full width, \`w: 12\` half. Stack panels top to bottom with no gaps or overlaps (each \`y\` is the previous \`y + h\` unless they sit side by side). On phones panels show full width in that order.
11591
+
11592
+ A \`"row"\` panel (\`h: 1\`, no options) is a section heading for the panels under it, in forms and dashboards.
11593
+
11594
+ ## Forms
11595
+
11596
+ Forms hold input panels. Each records to a \`metric\` (lowercase words joined with dashes, e.g. \`"body-weight"\`), and charts read entries by that metric. Two inputs never share a metric. Use \`h: 3\` for inputs.
11597
+
11598
+ | type | what | options besides metric |
11599
+ |---|---|---|
11600
+ | input-number | a number typed or stepped with + and \u2212 | unit, step, min, max |
11601
+ | input-slider | a value dragged along a range | min, max, step, unit, labels (text spread along the track) |
11602
+ | input-select | one of a set of choices | choices: [{ "label", "value" }], multi (allow several) |
11603
+ | input-toggle | yes or no (records 1 or 0) | |
11604
+ | input-rating | a score, e.g. 1 to 5 | min, max |
11605
+ | input-text | free text | placeholder, suggest (offer earlier values) |
11606
+ | input-counter | taps that add up, e.g. glasses of water | increment, unit |
11607
+ | input-duration | a length of time, recorded in seconds | placeholder |
11608
+
11609
+ Any input (not counter) can also take \`required: true\`, \`default\` (a value, or \`"last"\` for the last one saved), and \`record: "always"\` to record its value on every save even when it wasn't changed.
11610
+
11611
+ \`input-group\` repeats fields once per item, for things like the sets of a workout or the dishes of a meal. Give it \`h: 12\` and options \`{ "itemTitle": "Set", "titleFrom": "<a field's metric>", "start": 1 | "last", "min", "max", "fields": [ { "type": "input-\u2026", "title", "span": 1\u201324, "options": { "metric", \u2026 } } ] }\`. Fields can be any input but input-counter.
11612
+
11613
+ ## Dashboards
11614
+
11615
+ Chart panels read the app's entries with \`"datasource": { "type": "modelform-local" }\` and \`"targets": [ { "refId": "A", "metric": "\u2026" } ]\` (refIds A, B, C\u2026 for more series). A target can also have:
11616
+
11617
+ - \`aggregate\`: "sum", "avg", "min", "max", "count" or "last", with \`bucket\`: "1h", "1d", "1w" or "1M". Without them each entry is a point.
11618
+ - \`groupBy\`: "text" for one series per text or choice value; \`{ "field": "<metric>" }\` for one series per value of another input saved at the same time (in an input-group, of the same item, e.g. weight per exercise).
11619
+ - \`alias\`: the series name. \`fillZero: false\` leaves empty buckets out.
11620
+
11621
+ | type | use for | h |
11622
+ |---|---|---|
11623
+ | timeseries | values over time | 7\u20138 |
11624
+ | barchart | totals per day, week or category | 7\u20138 |
11625
+ | stat | one big number; \`"options": { "reduceOptions": { "calcs": ["lastNotNull" or "mean" or "sum"] } }\` | 4 |
11626
+ | gauge, bargauge | a value against a range (set min and max) | 5\u20136 |
11627
+ | piechart | how a total splits, e.g. by choice with groupBy "text" and aggregate "count" | 8 |
11628
+ | table | rows of values | 8 |
11629
+ | text | markdown notes: \`"options": { "content": "\u2026" }\`, no targets | 3\u20134 |
11630
+
11631
+ Units and ranges go in \`"fieldConfig": { "defaults": { "unit": "\u2026", "min", "max", "decimals" } }\`. Units are Grafana's, e.g. "percent", "masskg", "lengthkm", "s", or "suffix: <text>" for anything else (\`"suffix: glasses"\`). Don't use trend, xychart or geomap panels.
11632
+
11633
+ Charts can't do arithmetic across metrics (weight \xD7 reps, a ratio of two inputs). Chart what's recorded instead, or add an input for the combined value, and say which you did in the sentence before the JSON.
11634
+
11635
+ ## Tabs
11636
+
11637
+ \`{ "id": "\u2026", "title": "\u2026", "icon": "\u2026", "screen": \u2026 }\`, where the screen is one of:
11638
+
11639
+ - \`{ "type": "forms", "forms": ["<form id>", \u2026] }\`
11640
+ - \`{ "type": "dashboard", "dashboard": "<dashboard id>" }\`
11641
+ - \`{ "type": "menu", "items": [ { "form": "<id>" } or { "dashboard": "<id>", "description": "\u2026" } ] }\`
11642
+
11643
+ Usually one tab for the forms and one per dashboard.
11644
+ `;
11645
+ var EXAMPLE = {
11646
+ $modelform: "template",
11647
+ version: 1,
11648
+ title: "Water and sleep",
11649
+ description: "Count glasses of water and log sleep, and see both by day.",
11650
+ documents: [
11651
+ {
11652
+ kind: "form",
11653
+ id: "today",
11654
+ dashboard: {
11655
+ kind: "form",
11656
+ title: "Today",
11657
+ panels: [
11658
+ { id: 1, type: "input-counter", title: "Water", gridPos: { x: 0, y: 0, w: 24, h: 3 }, options: { metric: "water", unit: "glasses" } },
11659
+ { id: 2, type: "input-duration", title: "Sleep", gridPos: { x: 0, y: 3, w: 12, h: 3 }, options: { metric: "sleep" } },
11660
+ { id: 3, type: "input-rating", title: "Sleep quality", gridPos: { x: 12, y: 3, w: 12, h: 3 }, options: { metric: "sleep-quality", min: 1, max: 5 } }
11661
+ ]
11662
+ }
11663
+ },
11664
+ {
11665
+ kind: "dashboard",
11666
+ id: "by-day",
11667
+ dashboard: {
11668
+ kind: "dashboard",
11669
+ title: "By day",
11670
+ time: { from: "now-30d", to: "now" },
11671
+ panels: [
11672
+ {
11673
+ id: 1,
11674
+ type: "stat",
11675
+ title: "Average sleep",
11676
+ gridPos: { x: 0, y: 0, w: 12, h: 4 },
11677
+ datasource: { type: "modelform-local" },
11678
+ targets: [{ refId: "A", metric: "sleep" }],
11679
+ fieldConfig: { defaults: { unit: "s" } },
11680
+ options: { reduceOptions: { calcs: ["mean"] } }
11681
+ },
11682
+ {
11683
+ id: 2,
11684
+ type: "stat",
11685
+ title: "Water today",
11686
+ gridPos: { x: 12, y: 0, w: 12, h: 4 },
11687
+ datasource: { type: "modelform-local" },
11688
+ targets: [{ refId: "A", metric: "water", aggregate: "sum", bucket: "1d" }],
11689
+ fieldConfig: { defaults: { unit: "suffix: glasses", decimals: 0 } },
11690
+ options: { reduceOptions: { calcs: ["lastNotNull"] } }
11691
+ },
11692
+ {
11693
+ id: 3,
11694
+ type: "barchart",
11695
+ title: "Water per day",
11696
+ gridPos: { x: 0, y: 4, w: 24, h: 7 },
11697
+ datasource: { type: "modelform-local" },
11698
+ targets: [{ refId: "A", metric: "water", alias: "Glasses", aggregate: "sum", bucket: "1d" }],
11699
+ fieldConfig: { defaults: { min: 0, decimals: 0 } }
11700
+ },
11701
+ {
11702
+ id: 4,
11703
+ type: "timeseries",
11704
+ title: "Sleep quality",
11705
+ gridPos: { x: 0, y: 11, w: 24, h: 7 },
11706
+ datasource: { type: "modelform-local" },
11707
+ targets: [{ refId: "A", metric: "sleep-quality", alias: "Quality", aggregate: "avg", bucket: "1d", fillZero: false }],
11708
+ fieldConfig: { defaults: { min: 1, max: 5 } }
11709
+ }
11710
+ ]
11711
+ }
11712
+ }
11713
+ ],
11714
+ tabs: [
11715
+ { id: "today", title: "Today", icon: "edit", screen: { type: "forms", forms: ["today"] } },
11716
+ { id: "by-day", title: "By day", icon: "chart", screen: { type: "dashboard", dashboard: "by-day" } }
11717
+ ],
11718
+ metrics: ["water", "sleep", "sleep-quality"]
11719
+ };
11720
+ var EXAMPLE_TEMPLATE = EXAMPLE;
11721
+ function templatePrompt(request, { recorded = [], icons = [] } = {}) {
11722
+ const context = [
11723
+ recorded.length ? `The app already records these metrics: ${recorded.map((m) => `\`${m}\``).join(", ")}. Charts can read them. A new form should only record one of them if it's for the same thing; otherwise pick new names.` : "The app doesn\u2019t record anything yet.",
11724
+ icons.length ? `Tab icons can be: ${icons.map((i) => `\`${i}\``).join(", ")}.` : ""
11725
+ ].filter(Boolean);
11726
+ return [
11727
+ "I\u2019m building an app with modelform studio. Make me a modelform template for this:",
11728
+ "",
11729
+ request.trim().replace(/^/gm, "> "),
11730
+ "",
11731
+ ...context,
11732
+ "",
11733
+ "Reply with the template as one ```json code block. A sentence before it is fine; nothing after it.",
11734
+ "",
11735
+ AUTHORING_GUIDE,
11736
+ "## Example",
11737
+ "",
11738
+ "```json",
11739
+ JSON.stringify(EXAMPLE),
11740
+ "```"
11741
+ ].join("\n");
11742
+ }
11743
+ function jsonFromAnswer(text) {
11744
+ const blocks = [...text.matchAll(/```(?:json|JSON)?[ \t]*\r?\n([\s\S]*?)```/g)].map((m) => m[1]);
11745
+ const start = text.indexOf("{");
11746
+ const end = text.lastIndexOf("}");
11747
+ if (start >= 0 && end > start) blocks.push(text.slice(start, end + 1));
11748
+ for (const block of blocks.reverse()) {
11749
+ try {
11750
+ return JSON.parse(block);
11751
+ } catch (e22) {
11752
+ }
11753
+ }
11754
+ throw new Error("There\u2019s no JSON in that answer");
11755
+ }
11756
+ function readTemplateAnswer(text) {
11757
+ let json;
11758
+ try {
11759
+ json = jsonFromAnswer(text);
11760
+ } catch (e) {
11761
+ return { error: e.message };
11762
+ }
11763
+ const parsed = parseTemplate(JSON.stringify(json));
11764
+ if ("error" in parsed) return parsed;
11765
+ const { template } = parsed;
11766
+ const raw = json;
11767
+ const warnings = raw.documents.flatMap(
11768
+ (d) => prepareDashboard(d.dashboard, d.id).issues.filter((i) => i.severity === "warning").map((i) => `${i.path}: ${i.message}`)
11769
+ );
11770
+ const kept = new Set(template.tabs.map((t) => t.id));
11771
+ for (const [i, tab] of (Array.isArray(raw.tabs) ? raw.tabs : []).entries()) {
11772
+ const id = _optionalChain([tab, 'optionalAccess', _332 => _332.id]);
11773
+ if (typeof id !== "string" || !kept.has(id)) warnings.push(`tabs[${i}] was left out: it needs an id, a title and a screen showing only this template\u2019s documents`);
11774
+ }
11775
+ const kinds = new Map(template.documents.map((d) => [d.id, d.kind]));
11776
+ for (const tab of template.tabs)
11777
+ for (const ref of screenDocuments(tab.screen)) {
11778
+ const kind = kinds.get(ref.id);
11779
+ if (kind && kind !== ref.kind) warnings.push(`tab "${tab.id}" shows "${ref.id}" as a ${ref.kind}, but it\u2019s a ${kind}`);
11780
+ }
11781
+ return { template, warnings };
11782
+ }
11783
+ function fixTemplatePrompt(problems) {
11784
+ return [
11785
+ "modelform couldn\u2019t use that template as it was:",
11786
+ "",
11787
+ ...problems.map((p) => `- ${p}`),
11788
+ "",
11789
+ "Fix these and reply with the whole corrected template as one ```json code block."
11790
+ ].join("\n");
11791
+ }
11792
+
11793
+
11794
+
11795
+
11796
+
11797
+
11798
+
11799
+
11506
11800
 
11507
11801
 
11508
11802
 
@@ -11726,4 +12020,4 @@ function applyTemplate(manifestText, paths, template, options = {}) {
11726
12020
 
11727
12021
 
11728
12022
 
11729
- exports.frameLength = frameLength; exports.timeField = timeField; exports.numberFields = numberFields; exports.fieldDisplayName = fieldDisplayName; exports.toSeries = toSeries; exports.toXYSeries = toXYSeries; exports.uniqueNames = uniqueNames; exports.toMillis = toMillis; exports.parseTime = parseTime; exports.parseRange = parseRange; exports.addTime = addTime; exports.startOf = startOf; exports.parseDuration = parseDuration; exports.calculateInterval = calculateInterval; exports.formatDuration = formatDuration; exports.TIME_PRESETS = TIME_PRESETS; exports.RELATIVE_RANGES = RELATIVE_RANGES; exports.parseLocalDateTime = parseLocalDateTime; exports.formatLocalDateTime = formatLocalDateTime; exports.timeExprError = timeExprError; exports.describeRange = describeRange; exports.zoomRange = zoomRange; exports.ALL = ALL; exports.initialVariableValues = initialVariableValues; exports.variableOptions = variableOptions; exports.variableInfo = variableInfo; exports.visibleVariables = visibleVariables; exports.isSqlDatasource = isSqlDatasource; exports.framesToOptions = framesToOptions; exports.refineOptions = refineOptions; exports.selectValue = selectValue; exports.variableReferences = variableReferences; exports.interpolate = interpolate; exports.queryParam = queryParam; exports.interpolateDeep = interpolateDeep; exports.resolveTimezone = resolveTimezone; exports.valueText = valueText; exports.GRID_COLUMNS = GRID_COLUMNS; exports.gridUnitsToPx = gridUnitsToPx; exports.gridOffsetPx = gridOffsetPx; exports.compactGrid = compactGrid; exports.isRow = isRow; exports.layoutDashboard = layoutDashboard; exports.repeatOptions = repeatOptions; exports.panelKey = panelKey; exports.panelSpan = panelSpan; exports.applyTransformations = applyTransformations; exports.DASHBOARD_DS = DASHBOARD_DS; exports.dashboardSourceIds = dashboardSourceIds; exports.panelHasQueries = panelHasQueries; exports.queryPanel = queryPanel; exports.normalizeRef = normalizeRef; exports.refreshedVariables = refreshedVariables; exports.variableDependents = variableDependents; exports.variableOrder = variableOrder; exports.resolveVariables = resolveVariables; exports.REDUCER_LABELS = REDUCER_LABELS; exports.isReducer = isReducer; exports.reduce = reduce; exports.INPUT_OPTION_KEYS = INPUT_OPTION_KEYS; exports.INPUT_TYPES = INPUT_TYPES; exports.isInputType = isInputType; exports.isInputPanel = isInputPanel; exports.INPUT_GROUP = INPUT_GROUP; exports.isFormPanelType = isFormPanelType; exports.isInputGroup = isInputGroup; exports.GROUP_FIELD_TYPES = GROUP_FIELD_TYPES; exports.groupFields = groupFields; exports.inputPanels = inputPanels; exports.inputGroups = inputGroups; exports.plainInputPanels = plainInputPanels; exports.parseClockDigits = parseClockDigits; exports.formatClock = formatClock; exports.toEntries = toEntries; exports.newSaveId = newSaveId; exports.isEmptyItem = isEmptyItem; exports.groupToEntries = groupToEntries; exports.entriesToItems = entriesToItems; exports.groupProblems = groupProblems; exports.sameSave = sameSave; exports.inputProblem = inputProblem; exports.entryToInputValue = entryToInputValue; exports.textSuggestions = textSuggestions; exports.entriesSavedWith = entriesSavedWith; exports.formatValue = formatValue; exports.thresholdStep = thresholdStep; exports.NAMED_COLORS = NAMED_COLORS; exports.resolveColor = resolveColor; exports.SERIES_PALETTE = SERIES_PALETTE; exports.seriesColor = seriesColor; exports.mappedResult = mappedResult; exports.formatDisplay = formatDisplay; exports.valueColor = valueColor; exports.resolveFieldConfig = resolveFieldConfig; exports.fieldMatches = fieldMatches; exports.GrafanaError = GrafanaError; exports.GrafanaClient = GrafanaClient; exports.GrafanaDataSource = GrafanaDataSource; exports.fromWire = fromWire; exports.LOCAL_DATASOURCE_TYPE = LOCAL_DATASOURCE_TYPE; exports.isLocalDatasource = isLocalDatasource; exports.LocalDataSource = LocalDataSource; exports.groupField = groupField; exports.buildFrames = buildFrames; exports.MemoryEntryStore = MemoryEntryStore; exports.DEFAULT_GAZETTEER = DEFAULT_GAZETTEER; exports.parseGazetteer = parseGazetteer; exports.loadGazetteer = loadGazetteer; exports.resolveLinks = resolveLinks; exports.parseDashboardLink = parseDashboardLink; exports.applyDashboardLink = applyDashboardLink; exports.appSchema = appSchema; exports.dashboardSchema = dashboardSchema; exports.pointerToPath = pointerToPath; exports.manifestSchemaIssues = manifestSchemaIssues; exports.dashboardSchemaIssues = dashboardSchemaIssues; exports.cleanDashboard = cleanDashboard; exports.MAPPING_TYPES = MAPPING_TYPES; exports.SPECIAL_MATCHES = SPECIAL_MATCHES; exports.mappingRows = mappingRows; exports.rowsToMappings = rowsToMappings; exports.mappingRow = mappingRow; exports.mappingProblem = mappingProblem; exports.OPTION_CATEGORIES = OPTION_CATEGORIES; exports.UNIT_CHOICES = UNIT_CHOICES; exports.panelOptions = panelOptions; exports.getPath = getPath; exports.optionValue = optionValue; exports.setOption = setOption; exports.setOptionValue = setOptionValue; exports.cleanPanelOptions = cleanPanelOptions; exports.OVERRIDE_MATCHERS = OVERRIDE_MATCHERS; exports.overrideProperties = overrideProperties; exports.panelOverrides = panelOverrides; exports.setOverrides = setOverrides; exports.MANIFEST_VERSION = MANIFEST_VERSION; exports.validateManifest = validateManifest; exports.prepareDashboard = prepareDashboard; exports.validateDashboard = validateDashboard2; exports.validateBundle = validateBundle; exports.resolveUrl = resolveUrl; exports.httpFetchJson = httpFetchJson; exports.defaultFetchJson = defaultFetchJson; exports.BUNDLE_TYPE = BUNDLE_TYPE; exports.BUNDLE_ACCEPT = BUNDLE_ACCEPT; exports.isBundleResponse = isBundleResponse; exports.bundleRoot = bundleRoot; exports.assembleFromResponse = assembleFromResponse; exports.assembleBundle = assembleBundle; exports.fetchBundle = fetchBundle; exports.revalidateBundle = revalidateBundle; exports.ConfigLoader = ConfigLoader; exports.tabIdFor = tabIdFor; exports.screenOfType = screenOfType; exports.screenDocuments = screenDocuments; exports.documentUses = documentUses; exports.stringifyCompact = stringifyCompact; exports.applyJsonEdits = applyJsonEdits; exports.diffJson = diffJson; exports.documentIdFor = documentIdFor; exports.removeDocumentFromManifest = removeDocumentFromManifest; exports.renameDocumentInManifest = renameDocumentInManifest; exports.metricChanges = metricChanges; exports.REFRESH_CHOICES = REFRESH_CHOICES; exports.EDITABLE_VARIABLE_TYPES = EDITABLE_VARIABLE_TYPES; exports.isEditableVariableType = isEditableVariableType; exports.variableNameError = variableNameError; exports.newVariable = newVariable; exports.variableWithType = variableWithType; exports.variableWithQuery = variableWithQuery; exports.variableWithCurrent = variableWithCurrent; exports.variableWithFlags = variableWithFlags; exports.variableUses = variableUses; exports.renameVariableInPanels = renameVariableInPanels; exports.lineColumn = lineColumn; exports.parseJsonText = parseJsonText; exports.splitPath = splitPath; exports.locate = locate; exports.checkFiles = checkFiles; exports.bundleFromFiles = bundleFromFiles; exports.formatJsonText = formatJsonText; exports.setJsonValue = setJsonValue; exports.PANEL_TYPES = PANEL_TYPES; exports.newPanel = newPanel; exports.newDocument = newDocument; exports.SaveConflictError = SaveConflictError; exports.HttpConfigFiles = HttpConfigFiles; exports.fetchJsonWithToken = fetchJsonWithToken; exports.readConfigFiles = readConfigFiles; exports.readingOrder = readingOrder; exports.repack = repack; exports.CANVAS_GAP = CANVAS_GAP; exports.CANVAS_ROW_HEADER = CANVAS_ROW_HEADER; exports.panelSize = panelSize; exports.layoutCanvas = layoutCanvas; exports.dropTarget = dropTarget; exports.movePanel = movePanel; exports.resizePanel = resizePanel; exports.setHiddenOnPhones = setHiddenOnPhones; exports.nextPanelId = nextPanelId; exports.insertPanel = insertPanel; exports.duplicatePanel = duplicatePanel; exports.removePanel = removePanel; exports.expandRow = expandRow; exports.collapseRow = collapseRow; exports.settleLayout = settleLayout; exports.placePanel = placePanel; exports.snapToGrid = snapToGrid; exports.panelEdits = panelEdits; exports.sampleEntries = sampleEntries; exports.SNIPPET_VERSION = SNIPPET_VERSION; exports.panelMetrics = panelMetrics; exports.renameMetrics = renameMetrics; exports.copyPanels = copyPanels; exports.parseSnippet = parseSnippet; exports.previewPaste = previewPaste; exports.pasteSnippet = pasteSnippet; exports.TEMPLATE_VERSION = TEMPLATE_VERSION; exports.makeTemplate = makeTemplate; exports.parseTemplate = parseTemplate; exports.templateNeeds = templateNeeds; exports.applyTemplate = applyTemplate;
12023
+ exports.frameLength = frameLength; exports.timeField = timeField; exports.numberFields = numberFields; exports.fieldDisplayName = fieldDisplayName; exports.toSeries = toSeries; exports.toXYSeries = toXYSeries; exports.uniqueNames = uniqueNames; exports.toMillis = toMillis; exports.parseTime = parseTime; exports.parseRange = parseRange; exports.addTime = addTime; exports.startOf = startOf; exports.parseDuration = parseDuration; exports.calculateInterval = calculateInterval; exports.formatDuration = formatDuration; exports.TIME_PRESETS = TIME_PRESETS; exports.RELATIVE_RANGES = RELATIVE_RANGES; exports.parseLocalDateTime = parseLocalDateTime; exports.formatLocalDateTime = formatLocalDateTime; exports.timeExprError = timeExprError; exports.describeRange = describeRange; exports.zoomRange = zoomRange; exports.ALL = ALL; exports.initialVariableValues = initialVariableValues; exports.variableOptions = variableOptions; exports.variableInfo = variableInfo; exports.visibleVariables = visibleVariables; exports.isSqlDatasource = isSqlDatasource; exports.framesToOptions = framesToOptions; exports.refineOptions = refineOptions; exports.selectValue = selectValue; exports.variableReferences = variableReferences; exports.interpolate = interpolate; exports.queryParam = queryParam; exports.interpolateDeep = interpolateDeep; exports.resolveTimezone = resolveTimezone; exports.valueText = valueText; exports.GRID_COLUMNS = GRID_COLUMNS; exports.gridUnitsToPx = gridUnitsToPx; exports.gridOffsetPx = gridOffsetPx; exports.compactGrid = compactGrid; exports.isRow = isRow; exports.layoutDashboard = layoutDashboard; exports.repeatOptions = repeatOptions; exports.panelKey = panelKey; exports.panelSpan = panelSpan; exports.applyTransformations = applyTransformations; exports.DASHBOARD_DS = DASHBOARD_DS; exports.dashboardSourceIds = dashboardSourceIds; exports.panelHasQueries = panelHasQueries; exports.queryPanel = queryPanel; exports.normalizeRef = normalizeRef; exports.refreshedVariables = refreshedVariables; exports.variableDependents = variableDependents; exports.variableOrder = variableOrder; exports.resolveVariables = resolveVariables; exports.REDUCER_LABELS = REDUCER_LABELS; exports.isReducer = isReducer; exports.reduce = reduce; exports.INPUT_OPTION_KEYS = INPUT_OPTION_KEYS; exports.INPUT_TYPES = INPUT_TYPES; exports.isInputType = isInputType; exports.isInputPanel = isInputPanel; exports.INPUT_GROUP = INPUT_GROUP; exports.isFormPanelType = isFormPanelType; exports.isInputGroup = isInputGroup; exports.GROUP_FIELD_TYPES = GROUP_FIELD_TYPES; exports.groupFields = groupFields; exports.inputPanels = inputPanels; exports.documentKind = documentKind; exports.inputGroups = inputGroups; exports.plainInputPanels = plainInputPanels; exports.parseClockDigits = parseClockDigits; exports.formatClock = formatClock; exports.toEntries = toEntries; exports.newSaveId = newSaveId; exports.isEmptyItem = isEmptyItem; exports.groupToEntries = groupToEntries; exports.entriesToItems = entriesToItems; exports.groupProblems = groupProblems; exports.sameSave = sameSave; exports.inputProblem = inputProblem; exports.entryToInputValue = entryToInputValue; exports.textSuggestions = textSuggestions; exports.entriesSavedWith = entriesSavedWith; exports.formatValue = formatValue; exports.thresholdStep = thresholdStep; exports.NAMED_COLORS = NAMED_COLORS; exports.resolveColor = resolveColor; exports.SERIES_PALETTE = SERIES_PALETTE; exports.seriesColor = seriesColor; exports.mappedResult = mappedResult; exports.formatDisplay = formatDisplay; exports.valueColor = valueColor; exports.resolveFieldConfig = resolveFieldConfig; exports.fieldMatches = fieldMatches; exports.GrafanaError = GrafanaError; exports.GrafanaClient = GrafanaClient; exports.GrafanaDataSource = GrafanaDataSource; exports.fromWire = fromWire; exports.LOCAL_DATASOURCE_TYPE = LOCAL_DATASOURCE_TYPE; exports.isLocalDatasource = isLocalDatasource; exports.LocalDataSource = LocalDataSource; exports.groupField = groupField; exports.buildFrames = buildFrames; exports.MemoryEntryStore = MemoryEntryStore; exports.DEFAULT_GAZETTEER = DEFAULT_GAZETTEER; exports.parseGazetteer = parseGazetteer; exports.loadGazetteer = loadGazetteer; exports.resolveLinks = resolveLinks; exports.parseDashboardLink = parseDashboardLink; exports.applyDashboardLink = applyDashboardLink; exports.appSchema = appSchema; exports.dashboardSchema = dashboardSchema; exports.pointerToPath = pointerToPath; exports.manifestSchemaIssues = manifestSchemaIssues; exports.dashboardSchemaIssues = dashboardSchemaIssues; exports.cleanDashboard = cleanDashboard; exports.MAPPING_TYPES = MAPPING_TYPES; exports.SPECIAL_MATCHES = SPECIAL_MATCHES; exports.mappingRows = mappingRows; exports.rowsToMappings = rowsToMappings; exports.mappingRow = mappingRow; exports.mappingProblem = mappingProblem; exports.OPTION_CATEGORIES = OPTION_CATEGORIES; exports.UNIT_CHOICES = UNIT_CHOICES; exports.panelOptions = panelOptions; exports.getPath = getPath; exports.optionValue = optionValue; exports.setOption = setOption; exports.setOptionValue = setOptionValue; exports.cleanPanelOptions = cleanPanelOptions; exports.OVERRIDE_MATCHERS = OVERRIDE_MATCHERS; exports.overrideProperties = overrideProperties; exports.panelOverrides = panelOverrides; exports.setOverrides = setOverrides; exports.MANIFEST_VERSION = MANIFEST_VERSION; exports.validateManifest = validateManifest; exports.prepareDashboard = prepareDashboard; exports.validateDashboard = validateDashboard2; exports.validateBundle = validateBundle; exports.resolveUrl = resolveUrl; exports.httpFetchJson = httpFetchJson; exports.defaultFetchJson = defaultFetchJson; exports.BUNDLE_TYPE = BUNDLE_TYPE; exports.BUNDLE_ACCEPT = BUNDLE_ACCEPT; exports.isBundleResponse = isBundleResponse; exports.bundleRoot = bundleRoot; exports.assembleFromResponse = assembleFromResponse; exports.assembleBundle = assembleBundle; exports.fetchBundle = fetchBundle; exports.revalidateBundle = revalidateBundle; exports.ConfigLoader = ConfigLoader; exports.tabIdFor = tabIdFor; exports.screenOfType = screenOfType; exports.screenDocuments = screenDocuments; exports.documentUses = documentUses; exports.stringifyCompact = stringifyCompact; exports.applyJsonEdits = applyJsonEdits; exports.diffJson = diffJson; exports.documentIdFor = documentIdFor; exports.removeDocumentFromManifest = removeDocumentFromManifest; exports.renameDocumentInManifest = renameDocumentInManifest; exports.metricChanges = metricChanges; exports.REFRESH_CHOICES = REFRESH_CHOICES; exports.EDITABLE_VARIABLE_TYPES = EDITABLE_VARIABLE_TYPES; exports.isEditableVariableType = isEditableVariableType; exports.variableNameError = variableNameError; exports.newVariable = newVariable; exports.variableWithType = variableWithType; exports.variableWithQuery = variableWithQuery; exports.variableWithCurrent = variableWithCurrent; exports.variableWithFlags = variableWithFlags; exports.variableUses = variableUses; exports.renameVariableInPanels = renameVariableInPanels; exports.lineColumn = lineColumn; exports.parseJsonText = parseJsonText; exports.splitPath = splitPath; exports.locate = locate; exports.checkFiles = checkFiles; exports.bundleFromFiles = bundleFromFiles; exports.formatJsonText = formatJsonText; exports.setJsonValue = setJsonValue; exports.PANEL_TYPES = PANEL_TYPES; exports.newPanel = newPanel; exports.newDocument = newDocument; exports.SaveConflictError = SaveConflictError; exports.HttpConfigFiles = HttpConfigFiles; exports.fetchJsonWithToken = fetchJsonWithToken; exports.readConfigFiles = readConfigFiles; exports.readingOrder = readingOrder; exports.repack = repack; exports.CANVAS_GAP = CANVAS_GAP; exports.CANVAS_ROW_HEADER = CANVAS_ROW_HEADER; exports.panelSize = panelSize; exports.layoutCanvas = layoutCanvas; exports.dropTarget = dropTarget; exports.movePanel = movePanel; exports.resizePanel = resizePanel; exports.setHiddenOnPhones = setHiddenOnPhones; exports.nextPanelId = nextPanelId; exports.insertPanel = insertPanel; exports.duplicatePanel = duplicatePanel; exports.removePanel = removePanel; exports.expandRow = expandRow; exports.collapseRow = collapseRow; exports.settleLayout = settleLayout; exports.placePanel = placePanel; exports.snapToGrid = snapToGrid; exports.panelEdits = panelEdits; exports.sampleEntries = sampleEntries; exports.SNIPPET_VERSION = SNIPPET_VERSION; exports.panelMetrics = panelMetrics; exports.renameMetrics = renameMetrics; exports.copyPanels = copyPanels; exports.parseSnippet = parseSnippet; exports.previewPaste = previewPaste; exports.pasteSnippet = pasteSnippet; exports.TEMPLATE_VERSION = TEMPLATE_VERSION; exports.makeTemplate = makeTemplate; exports.parseTemplate = parseTemplate; exports.templateNeeds = templateNeeds; exports.applyTemplate = applyTemplate; exports.AUTHORING_GUIDE = AUTHORING_GUIDE; exports.EXAMPLE_TEMPLATE = EXAMPLE_TEMPLATE; exports.templatePrompt = templatePrompt; exports.jsonFromAnswer = jsonFromAnswer; exports.readTemplateAnswer = readTemplateAnswer; exports.fixTemplatePrompt = fixTemplatePrompt;