@cloudcannon/configuration-types 0.0.50 → 0.0.51

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.
@@ -50376,7 +50376,9 @@
50376
50376
  "appears_in": [
50377
50377
  "type.snippet.params.*.(argument-list-parser-config).options.models",
50378
50378
  "type.snippet.params.*.(argument-parser-config).options",
50379
- "type.snippet.params.*.(key-value-list-parser-config).options.models"
50379
+ "type.snippet.params.*.(key-value-list-parser-config).options.models",
50380
+ "type.snippet-definition-value",
50381
+ "type.snippet-definition-value.(parser-model-array)"
50380
50382
  ],
50381
50383
  "properties": {
50382
50384
  "source_key": {
@@ -50908,7 +50910,8 @@
50908
50910
  "appears_in": [
50909
50911
  "type.snippet.params.*.(argument-list-parser-config).options",
50910
50912
  "type.snippet.params.*.(argument-parser-config).options",
50911
- "type.snippet.params.*.(key-value-list-parser-config).options"
50913
+ "type.snippet.params.*.(key-value-list-parser-config).options",
50914
+ "type.snippet-definition-value"
50912
50915
  ],
50913
50916
  "properties": {
50914
50917
  "root_boundary": {
@@ -57015,19 +57018,64 @@
57015
57018
  "type._snippets_definitions": {
57016
57019
  "gid": "type._snippets_definitions",
57017
57020
  "title": "",
57018
- "description": "This key defines extended options used when creating more complex custom snippets.",
57021
+ "description": "A record of reusable values that can be referenced in snippet templates. Values are substituted using `{ ref: \"key\" }` for direct replacement or `{ spread_ref: \"key\" }` for spreading arrays/objects. Common definition types include parser formats, argument models, select option lists, and simple string values like shortcode names.",
57022
+ "examples": [
57023
+ {
57024
+ "description": "Define reusable values like shortcode names, argument models, and parser formats that can be referenced in snippet templates.",
57025
+ "language": "yaml",
57026
+ "code": "_snippets_definitions:\n # Simple string value for the shortcode name\n shortcode_name: \"highlight\"\n content_key: \"content\"\n\n # Array of argument models for positional arguments\n positional_args:\n - editor_key: \"language\"\n type: \"string\"\n - editor_key: \"linenos\"\n type: \"boolean\"\n optional: true\n default: false\n\n # Parser format configuration\n custom_format:\n root_pair_delimiter:\n - \" \"\n root_value_delimiter: \"=\"\n string_boundary:\n - '\"'\n - \"'\"\n - \"\"\n allow_booleans: true\n allow_numbers: true",
57027
+ "annotations": [],
57028
+ "source": "/cloudcannon.config.yml"
57029
+ },
57030
+ {
57031
+ "description": "Reference definitions in snippet templates using `{ ref: \"key\" }` syntax. This allows you to reuse common configurations across multiple snippets.",
57032
+ "language": "yaml",
57033
+ "code": "_snippets_definitions:\n shortcode_name: \"figure\"\n named_args:\n - editor_key: \"src\"\n type: \"string\"\n - editor_key: \"alt\"\n type: \"string\"\n optional: true\n\n_snippets_templates:\n my_shortcode_template:\n snippet: \"{{< [[name]] [[args]] >}}\"\n params:\n name:\n parser: \"literal\"\n options:\n literal:\n ref: \"shortcode_name\"\n args:\n parser: \"key_values\"\n options:\n models:\n ref: \"named_args\"\n\n_snippets:\n figure:\n template: \"my_shortcode_template\"\n definitions:\n shortcode_name: \"figure\"\n named_args:\n - editor_key: \"src\"\n type: \"string\"\n - editor_key: \"alt\"\n type: \"string\"",
57034
+ "annotations": [],
57035
+ "source": "/cloudcannon.config.yml"
57036
+ },
57037
+ {
57038
+ "description": "Define a list of select options for use in snippet inputs, such as a list of programming languages for a code highlighting snippet.",
57039
+ "language": "yaml",
57040
+ "code": "_snippets_definitions:\n languages:\n - name: \"JavaScript\"\n value: \"js\"\n - name: \"Python\"\n value: \"python\"\n - name: \"Ruby\"\n value: \"ruby\"\n - name: \"HTML\"\n value: \"html\"\n - name: \"CSS\"\n value: \"css\"",
57041
+ "annotations": [],
57042
+ "source": "/cloudcannon.config.yml"
57043
+ }
57044
+ ],
57019
57045
  "type": "object",
57020
57046
  "documentation": {
57021
57047
  "gid": "type._snippets_definitions",
57022
57048
  "url": "/configuration-file/types/_snippets_definitions/",
57023
57049
  "title": "",
57024
- "description": "This key defines extended options used when creating more complex custom snippets.",
57025
- "examples": [],
57026
- "show_in_navigation": true
57050
+ "description": "A record of reusable values that can be referenced in snippet templates. Values are substituted using `{ ref: \"key\" }` for direct replacement or `{ spread_ref: \"key\" }` for spreading arrays/objects. Common definition types include parser formats, argument models, select option lists, and simple string values like shortcode names.",
57051
+ "examples": [
57052
+ {
57053
+ "description": "Define reusable values like shortcode names, argument models, and parser formats that can be referenced in snippet templates.",
57054
+ "language": "yaml",
57055
+ "code": "_snippets_definitions:\n # Simple string value for the shortcode name\n shortcode_name: \"highlight\"\n content_key: \"content\"\n\n # Array of argument models for positional arguments\n positional_args:\n - editor_key: \"language\"\n type: \"string\"\n - editor_key: \"linenos\"\n type: \"boolean\"\n optional: true\n default: false\n\n # Parser format configuration\n custom_format:\n root_pair_delimiter:\n - \" \"\n root_value_delimiter: \"=\"\n string_boundary:\n - '\"'\n - \"'\"\n - \"\"\n allow_booleans: true\n allow_numbers: true",
57056
+ "annotations": [],
57057
+ "source": "/cloudcannon.config.yml"
57058
+ },
57059
+ {
57060
+ "description": "Reference definitions in snippet templates using `{ ref: \"key\" }` syntax. This allows you to reuse common configurations across multiple snippets.",
57061
+ "language": "yaml",
57062
+ "code": "_snippets_definitions:\n shortcode_name: \"figure\"\n named_args:\n - editor_key: \"src\"\n type: \"string\"\n - editor_key: \"alt\"\n type: \"string\"\n optional: true\n\n_snippets_templates:\n my_shortcode_template:\n snippet: \"{{< [[name]] [[args]] >}}\"\n params:\n name:\n parser: \"literal\"\n options:\n literal:\n ref: \"shortcode_name\"\n args:\n parser: \"key_values\"\n options:\n models:\n ref: \"named_args\"\n\n_snippets:\n figure:\n template: \"my_shortcode_template\"\n definitions:\n shortcode_name: \"figure\"\n named_args:\n - editor_key: \"src\"\n type: \"string\"\n - editor_key: \"alt\"\n type: \"string\"",
57063
+ "annotations": [],
57064
+ "source": "/cloudcannon.config.yml"
57065
+ },
57066
+ {
57067
+ "description": "Define a list of select options for use in snippet inputs, such as a list of programming languages for a code highlighting snippet.",
57068
+ "language": "yaml",
57069
+ "code": "_snippets_definitions:\n languages:\n - name: \"JavaScript\"\n value: \"js\"\n - name: \"Python\"\n value: \"python\"\n - name: \"Ruby\"\n value: \"ruby\"\n - name: \"HTML\"\n value: \"html\"\n - name: \"CSS\"\n value: \"css\"",
57070
+ "annotations": [],
57071
+ "source": "/cloudcannon.config.yml"
57072
+ }
57073
+ ],
57074
+ "show_in_navigation": false
57027
57075
  },
57028
57076
  "developer_documentation": {
57029
57077
  "title": "Snippets Definitions",
57030
- "description": "Extended option used when creating more complex custom snippets."
57078
+ "description": "A record of reusable values that can be referenced in snippet templates. Values are substituted using { ref: \"key\" } for direct replacement or { spread_ref: \"key\" } for spreading arrays/objects."
57031
57079
  },
57032
57080
  "url": "/configuration-file/types/_snippets_definitions/",
57033
57081
  "required": false,
@@ -57038,10 +57086,395 @@
57038
57086
  ],
57039
57087
  "additionalProperties": [
57040
57088
  {
57041
- "type": "unknown"
57089
+ "gid": "type.snippet-definition-value"
57090
+ }
57091
+ ]
57092
+ },
57093
+ "type.snippet-definition-value": {
57094
+ "gid": "type.snippet-definition-value",
57095
+ "title": "Snippet Definition Value",
57096
+ "description": "A reusable value that can be referenced in snippet templates via `{ ref: \"key\" }` or `{ spread_ref: \"key\" }`. Can be a string, number, boolean, parser format, parser model, array of models, or array of select options.",
57097
+ "documentation": {
57098
+ "gid": "type.snippet-definition-value",
57099
+ "url": "/configuration-file/types/snippet-definition-value/",
57100
+ "title": "Snippet Definition Value",
57101
+ "description": "A reusable value that can be referenced in snippet templates via `{ ref: \"key\" }` or `{ spread_ref: \"key\" }`. Can be a string, number, boolean, parser format, parser model, array of models, or array of select options.",
57102
+ "examples": [],
57103
+ "show_in_navigation": true
57104
+ },
57105
+ "developer_documentation": {
57106
+ "title": "Snippet Definition Value",
57107
+ "description": "A reusable value that can be referenced in snippet templates via { ref: \"key\" } or { spread_ref: \"key\" }."
57108
+ },
57109
+ "url": "/configuration-file/types/snippet-definition-value/",
57110
+ "required": false,
57111
+ "key": "snippet-definition-value",
57112
+ "full_key": "snippet-definition-value",
57113
+ "appears_in": [
57114
+ "type._snippets_definitions"
57115
+ ],
57116
+ "anyOf": [
57117
+ {
57118
+ "gid": "type.snippet-format"
57119
+ },
57120
+ {
57121
+ "gid": "type.snippet-model"
57122
+ },
57123
+ {
57124
+ "gid": "type.snippet-definition-value.(parser-model-array)"
57125
+ },
57126
+ {
57127
+ "gid": "type.snippet-definition-value.(select-values-array)"
57128
+ },
57129
+ {
57130
+ "gid": "type.snippet-definition-value.(string-value)"
57131
+ },
57132
+ {
57133
+ "gid": "type.snippet-definition-value.(number-value)"
57134
+ },
57135
+ {
57136
+ "gid": "type.snippet-definition-value.(boolean-value)"
57137
+ },
57138
+ {
57139
+ "gid": "type.snippet-definition-value.(string-array)"
57140
+ }
57141
+ ]
57142
+ },
57143
+ "type.snippet-definition-value.(parser-model-array)": {
57144
+ "gid": "type.snippet-definition-value.(parser-model-array)",
57145
+ "title": "Parser Model Array",
57146
+ "description": "An array of parser model configurations. Typically used for `positional_args` or `named_args` definitions that specify the arguments a snippet accepts. Each model defines an argument's editor key, type, default value, and whether it's optional.",
57147
+ "type": "array",
57148
+ "documentation": {
57149
+ "gid": "type.snippet-definition-value.(parser-model-array)",
57150
+ "url": "/configuration-file/types/snippet-definition-value/(parser-model-array)/",
57151
+ "title": "Parser Model Array",
57152
+ "description": "An array of parser model configurations. Typically used for `positional_args` or `named_args` definitions that specify the arguments a snippet accepts. Each model defines an argument's editor key, type, default value, and whether it's optional.",
57153
+ "examples": [],
57154
+ "show_in_navigation": false
57155
+ },
57156
+ "developer_documentation": {
57157
+ "title": "Parser Model Array",
57158
+ "description": "An array of model configurations, typically used for positional_args or named_args."
57159
+ },
57160
+ "url": "/configuration-file/types/snippet-definition-value/(parser-model-array)/",
57161
+ "required": false,
57162
+ "key": "snippet-definition-value(parser-model-array)",
57163
+ "full_key": "snippet-definition-value(parser-model-array)",
57164
+ "parent": "type.snippet-definition-value",
57165
+ "appears_in": [],
57166
+ "items": [
57167
+ {
57168
+ "gid": "type.snippet-model"
57169
+ }
57170
+ ]
57171
+ },
57172
+ "type.snippet-definition-value.(select-values-array)": {
57173
+ "gid": "type.snippet-definition-value.(select-values-array)",
57174
+ "title": "Select Values Array",
57175
+ "description": "An array of select option values. Commonly used for language lists in code highlighting snippets, where each option has a display name and a value. For example: `[{ name: \"JavaScript\", value: \"js\" }, { name: \"Python\", value: \"python\" }]`.",
57176
+ "type": "array",
57177
+ "documentation": {
57178
+ "gid": "type.snippet-definition-value.(select-values-array)",
57179
+ "url": "/configuration-file/types/snippet-definition-value/(select-values-array)/",
57180
+ "title": "Select Values Array",
57181
+ "description": "An array of select option values. Commonly used for language lists in code highlighting snippets, where each option has a display name and a value. For example: `[{ name: \"JavaScript\", value: \"js\" }, { name: \"Python\", value: \"python\" }]`.",
57182
+ "examples": [],
57183
+ "show_in_navigation": false
57184
+ },
57185
+ "developer_documentation": {
57186
+ "title": "Select Values Array",
57187
+ "description": "An array of select options, typically used for language lists."
57188
+ },
57189
+ "url": "/configuration-file/types/snippet-definition-value/(select-values-array)/",
57190
+ "required": false,
57191
+ "key": "snippet-definition-value(select-values-array)",
57192
+ "full_key": "snippet-definition-value(select-values-array)",
57193
+ "parent": "type.snippet-definition-value",
57194
+ "appears_in": [],
57195
+ "items": [
57196
+ {
57197
+ "gid": "type.snippet-definition-select-value"
57198
+ }
57199
+ ]
57200
+ },
57201
+ "type.snippet-definition-select-value": {
57202
+ "gid": "type.snippet-definition-select-value",
57203
+ "title": "Snippet Definition Select Value",
57204
+ "description": "A value option for select inputs, typically used in language lists. Contains a display name and the actual value to use.",
57205
+ "type": "object",
57206
+ "documentation": {
57207
+ "gid": "type.snippet-definition-select-value",
57208
+ "url": "/configuration-file/types/snippet-definition-select-value/",
57209
+ "title": "Snippet Definition Select Value",
57210
+ "description": "A value option for select inputs, typically used in language lists. Contains a display name and the actual value to use.",
57211
+ "examples": [],
57212
+ "show_in_navigation": true
57213
+ },
57214
+ "developer_documentation": {
57215
+ "title": "Snippet Definition Select Value",
57216
+ "description": "A value option for select inputs, typically used in language lists."
57217
+ },
57218
+ "url": "/configuration-file/types/snippet-definition-select-value/",
57219
+ "required": false,
57220
+ "key": "snippet-definition-select-value",
57221
+ "full_key": "snippet-definition-select-value",
57222
+ "appears_in": [
57223
+ "type.snippet-definition-value.(select-values-array)"
57224
+ ],
57225
+ "properties": {
57226
+ "name": {
57227
+ "gid": "type.snippet-definition-select-value.name"
57228
+ },
57229
+ "value": {
57230
+ "gid": "type.snippet-definition-select-value.value"
57231
+ }
57232
+ }
57233
+ },
57234
+ "type.snippet-definition-select-value.name": {
57235
+ "gid": "type.snippet-definition-select-value.name",
57236
+ "title": "",
57237
+ "description": "The display name shown to users when selecting this option. For example, \"JavaScript\" for a language with value \"js\".",
57238
+ "type": "string",
57239
+ "documentation": {
57240
+ "gid": "type.snippet-definition-select-value.name",
57241
+ "url": "/configuration-file/types/snippet-definition-select-value/name/",
57242
+ "title": "",
57243
+ "description": "The display name shown to users when selecting this option. For example, \"JavaScript\" for a language with value \"js\".",
57244
+ "examples": [],
57245
+ "show_in_navigation": false
57246
+ },
57247
+ "developer_documentation": {
57248
+ "description": "The display name for this option."
57249
+ },
57250
+ "url": "/configuration-file/types/snippet-definition-select-value/name/",
57251
+ "required": false,
57252
+ "key": "name",
57253
+ "full_key": "snippet-definition-select-value.name",
57254
+ "parent": "type.snippet-definition-select-value",
57255
+ "appears_in": []
57256
+ },
57257
+ "type.snippet-definition-select-value.value": {
57258
+ "gid": "type.snippet-definition-select-value.value",
57259
+ "title": "",
57260
+ "description": "The actual value used when this option is selected. Can be a string, number, or boolean. For example, \"js\" for JavaScript or 4 for an indentation level.",
57261
+ "documentation": {
57262
+ "gid": "type.snippet-definition-select-value.value",
57263
+ "url": "/configuration-file/types/snippet-definition-select-value/value/",
57264
+ "title": "",
57265
+ "description": "The actual value used when this option is selected. Can be a string, number, or boolean. For example, \"js\" for JavaScript or 4 for an indentation level.",
57266
+ "examples": [],
57267
+ "show_in_navigation": false
57268
+ },
57269
+ "developer_documentation": {
57270
+ "description": "The value for this option."
57271
+ },
57272
+ "url": "/configuration-file/types/snippet-definition-select-value/value/",
57273
+ "required": true,
57274
+ "key": "value",
57275
+ "full_key": "snippet-definition-select-value.value",
57276
+ "parent": "type.snippet-definition-select-value",
57277
+ "appears_in": [],
57278
+ "anyOf": [
57279
+ {
57280
+ "gid": "type.snippet-definition-select-value.value.(string)"
57281
+ },
57282
+ {
57283
+ "gid": "type.snippet-definition-select-value.value.(number)"
57284
+ },
57285
+ {
57286
+ "gid": "type.snippet-definition-select-value.value.(boolean)"
57287
+ }
57288
+ ]
57289
+ },
57290
+ "type.snippet-definition-select-value.value.(string)": {
57291
+ "gid": "type.snippet-definition-select-value.value.(string)",
57292
+ "title": "String Select Value",
57293
+ "type": "string",
57294
+ "documentation": {
57295
+ "gid": "type.snippet-definition-select-value.value.(string)",
57296
+ "url": "/configuration-file/types/snippet-definition-select-value/value/(string)/",
57297
+ "title": "String Select Value",
57298
+ "description": "",
57299
+ "examples": [],
57300
+ "show_in_navigation": false
57301
+ },
57302
+ "developer_documentation": {
57303
+ "title": "String"
57304
+ },
57305
+ "url": "/configuration-file/types/snippet-definition-select-value/value/(string)/",
57306
+ "required": false,
57307
+ "key": "value(string)",
57308
+ "full_key": "snippet-definition-select-value.value(string)",
57309
+ "parent": "type.snippet-definition-select-value.value",
57310
+ "appears_in": []
57311
+ },
57312
+ "type.snippet-definition-select-value.value.(number)": {
57313
+ "gid": "type.snippet-definition-select-value.value.(number)",
57314
+ "title": "Number Select Value",
57315
+ "type": "number",
57316
+ "documentation": {
57317
+ "gid": "type.snippet-definition-select-value.value.(number)",
57318
+ "url": "/configuration-file/types/snippet-definition-select-value/value/(number)/",
57319
+ "title": "Number Select Value",
57320
+ "description": "",
57321
+ "examples": [],
57322
+ "show_in_navigation": false
57323
+ },
57324
+ "developer_documentation": {
57325
+ "title": "Number"
57326
+ },
57327
+ "url": "/configuration-file/types/snippet-definition-select-value/value/(number)/",
57328
+ "required": false,
57329
+ "key": "value(number)",
57330
+ "full_key": "snippet-definition-select-value.value(number)",
57331
+ "parent": "type.snippet-definition-select-value.value",
57332
+ "appears_in": []
57333
+ },
57334
+ "type.snippet-definition-select-value.value.(boolean)": {
57335
+ "gid": "type.snippet-definition-select-value.value.(boolean)",
57336
+ "title": "Boolean Select Value",
57337
+ "type": "boolean",
57338
+ "documentation": {
57339
+ "gid": "type.snippet-definition-select-value.value.(boolean)",
57340
+ "url": "/configuration-file/types/snippet-definition-select-value/value/(boolean)/",
57341
+ "title": "Boolean Select Value",
57342
+ "description": "",
57343
+ "examples": [],
57344
+ "show_in_navigation": false
57345
+ },
57346
+ "developer_documentation": {
57347
+ "title": "Boolean"
57348
+ },
57349
+ "url": "/configuration-file/types/snippet-definition-select-value/value/(boolean)/",
57350
+ "required": false,
57351
+ "key": "value(boolean)",
57352
+ "full_key": "snippet-definition-select-value.value(boolean)",
57353
+ "parent": "type.snippet-definition-select-value.value",
57354
+ "appears_in": []
57355
+ },
57356
+ "type.snippet-definition-value.(string-value)": {
57357
+ "gid": "type.snippet-definition-value.(string-value)",
57358
+ "title": "String Value",
57359
+ "description": "A string value definition. Commonly used for `shortcode_name`, `tag_name`, `content_key`, `include_name`, and similar definitions that identify snippet components by name.",
57360
+ "type": "string",
57361
+ "documentation": {
57362
+ "gid": "type.snippet-definition-value.(string-value)",
57363
+ "url": "/configuration-file/types/snippet-definition-value/(string-value)/",
57364
+ "title": "String Value",
57365
+ "description": "A string value definition. Commonly used for `shortcode_name`, `tag_name`, `content_key`, `include_name`, and similar definitions that identify snippet components by name.",
57366
+ "examples": [],
57367
+ "show_in_navigation": false
57368
+ },
57369
+ "developer_documentation": {
57370
+ "title": "String Value",
57371
+ "description": "A string value, commonly used for shortcode_name, tag_name, content_key, and similar definitions."
57372
+ },
57373
+ "url": "/configuration-file/types/snippet-definition-value/(string-value)/",
57374
+ "required": false,
57375
+ "key": "snippet-definition-value(string-value)",
57376
+ "full_key": "snippet-definition-value(string-value)",
57377
+ "parent": "type.snippet-definition-value",
57378
+ "appears_in": []
57379
+ },
57380
+ "type.snippet-definition-value.(number-value)": {
57381
+ "gid": "type.snippet-definition-value.(number-value)",
57382
+ "title": "Number Value",
57383
+ "description": "A numeric value definition. Use for counts, sizes, or other numeric values that can be referenced in snippet templates.",
57384
+ "type": "number",
57385
+ "documentation": {
57386
+ "gid": "type.snippet-definition-value.(number-value)",
57387
+ "url": "/configuration-file/types/snippet-definition-value/(number-value)/",
57388
+ "title": "Number Value",
57389
+ "description": "A numeric value definition. Use for counts, sizes, or other numeric values that can be referenced in snippet templates.",
57390
+ "examples": [],
57391
+ "show_in_navigation": false
57392
+ },
57393
+ "developer_documentation": {
57394
+ "title": "Number Value",
57395
+ "description": "A numeric value."
57396
+ },
57397
+ "url": "/configuration-file/types/snippet-definition-value/(number-value)/",
57398
+ "required": false,
57399
+ "key": "snippet-definition-value(number-value)",
57400
+ "full_key": "snippet-definition-value(number-value)",
57401
+ "parent": "type.snippet-definition-value",
57402
+ "appears_in": []
57403
+ },
57404
+ "type.snippet-definition-value.(boolean-value)": {
57405
+ "gid": "type.snippet-definition-value.(boolean-value)",
57406
+ "title": "Boolean Value",
57407
+ "description": "A boolean value definition. Use for flags and toggles that can be referenced in snippet templates.",
57408
+ "type": "boolean",
57409
+ "documentation": {
57410
+ "gid": "type.snippet-definition-value.(boolean-value)",
57411
+ "url": "/configuration-file/types/snippet-definition-value/(boolean-value)/",
57412
+ "title": "Boolean Value",
57413
+ "description": "A boolean value definition. Use for flags and toggles that can be referenced in snippet templates.",
57414
+ "examples": [],
57415
+ "show_in_navigation": false
57416
+ },
57417
+ "developer_documentation": {
57418
+ "title": "Boolean Value",
57419
+ "description": "A boolean value."
57420
+ },
57421
+ "url": "/configuration-file/types/snippet-definition-value/(boolean-value)/",
57422
+ "required": false,
57423
+ "key": "snippet-definition-value(boolean-value)",
57424
+ "full_key": "snippet-definition-value(boolean-value)",
57425
+ "parent": "type.snippet-definition-value",
57426
+ "appears_in": []
57427
+ },
57428
+ "type.snippet-definition-value.(string-array)": {
57429
+ "gid": "type.snippet-definition-value.(string-array)",
57430
+ "title": "String Array",
57431
+ "description": "An array of string values. Useful for defining lists of allowed values, delimiters, or other string collections that can be referenced in snippet templates.",
57432
+ "type": "array",
57433
+ "documentation": {
57434
+ "gid": "type.snippet-definition-value.(string-array)",
57435
+ "url": "/configuration-file/types/snippet-definition-value/(string-array)/",
57436
+ "title": "String Array",
57437
+ "description": "An array of string values. Useful for defining lists of allowed values, delimiters, or other string collections that can be referenced in snippet templates.",
57438
+ "examples": [],
57439
+ "show_in_navigation": false
57440
+ },
57441
+ "developer_documentation": {
57442
+ "title": "String Array",
57443
+ "description": "An array of strings."
57444
+ },
57445
+ "url": "/configuration-file/types/snippet-definition-value/(string-array)/",
57446
+ "required": false,
57447
+ "key": "snippet-definition-value(string-array)",
57448
+ "full_key": "snippet-definition-value(string-array)",
57449
+ "parent": "type.snippet-definition-value",
57450
+ "appears_in": [],
57451
+ "items": [
57452
+ {
57453
+ "gid": "type.snippet-definition-value.(string-array).[*]"
57042
57454
  }
57043
57455
  ]
57044
57456
  },
57457
+ "type.snippet-definition-value.(string-array).[*]": {
57458
+ "gid": "type.snippet-definition-value.(string-array).[*]",
57459
+ "title": "",
57460
+ "description": "A string item in the array.",
57461
+ "type": "string",
57462
+ "documentation": {
57463
+ "gid": "type.snippet-definition-value.(string-array).[*]",
57464
+ "url": "/configuration-file/types/snippet-definition-value/(string-array)/[*]/",
57465
+ "title": "",
57466
+ "description": "A string item in the array.",
57467
+ "examples": [],
57468
+ "show_in_navigation": false
57469
+ },
57470
+ "developer_documentation": {},
57471
+ "url": "/configuration-file/types/snippet-definition-value/(string-array)/[*]/",
57472
+ "required": false,
57473
+ "key": "snippet-definition-value(string-array)[*]",
57474
+ "full_key": "snippet-definition-value(string-array)[*]",
57475
+ "parent": "type.snippet-definition-value.(string-array)",
57476
+ "appears_in": []
57477
+ },
57045
57478
  "_snippets_definitions_from_glob": {
57046
57479
  "gid": "_snippets_definitions_from_glob",
57047
57480
  "title": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
6
6
  "author": "CloudCannon <support@cloudcannon.com>",
@@ -4,7 +4,11 @@ import { CollectionGroupSchema, CollectionsConfigSchema } from './collections.ts
4
4
  import { InputsSchema } from './inputs.ts';
5
5
  import { MarkdownSettingsSchema } from './markdown.ts';
6
6
  import { PathsSchema } from './paths.ts';
7
- import { SnippetConfigSchema, SnippetsImportsSchema } from './snippets.ts';
7
+ import {
8
+ SnippetConfigSchema,
9
+ SnippetDefinitionsSchema,
10
+ SnippetsImportsSchema,
11
+ } from './snippets.ts';
8
12
  import { SourceEditorSchema } from './source-editor.ts';
9
13
  import { TimezoneSchema } from './timezone.ts';
10
14
 
@@ -111,11 +115,7 @@ export const ConfigurationSchema = z
111
115
  description: 'Extended option used when creating more complex custom snippets.',
112
116
  }),
113
117
  _snippets_templates_from_glob: z.array(z.string()).optional(),
114
- _snippets_definitions: z.record(z.string(), z.unknown()).optional().meta({
115
- id: 'type._snippets_definitions',
116
- title: 'Snippets Definitions',
117
- description: 'Extended option used when creating more complex custom snippets.',
118
- }),
118
+ _snippets_definitions: SnippetDefinitionsSchema,
119
119
  _snippets_definitions_from_glob: z.array(z.string()).optional(),
120
120
  })
121
121
  .meta({
package/src/snippets.ts CHANGED
@@ -298,5 +298,85 @@ export const SnippetsImportsSchema = z
298
298
  })
299
299
  .meta({ id: 'type._snippets_imports', title: 'Snippets Imports' });
300
300
 
301
+ // Definition values that can be referenced via { ref: "key" } or { spread_ref: "key" }
302
+ // These are reusable values that get substituted into snippet templates at runtime
303
+
304
+ export const SnippetDefinitionSelectValueSchema = z
305
+ .object({
306
+ name: z.string().optional().meta({ description: 'The display name for this option.' }),
307
+ value: z
308
+ .union([
309
+ z.string().meta({ title: 'String' }),
310
+ z.number().meta({ title: 'Number' }),
311
+ z.boolean().meta({ title: 'Boolean' }),
312
+ ])
313
+ .meta({
314
+ description: 'The value for this option.',
315
+ }),
316
+ })
317
+ .meta({
318
+ id: 'type.snippet-definition-select-value',
319
+ title: 'Snippet Definition Select Value',
320
+ description: 'A value option for select inputs, typically used in language lists.',
321
+ });
322
+
323
+ export const SnippetDefinitionValueSchema = z
324
+ .union([
325
+ // Parser format - for format definitions like hugo_shortcode_format
326
+ ParserFormatSchema,
327
+ // Parser model - for single model definitions
328
+ ParserModelSchema,
329
+ // Array of parser models - for positional_args, named_args
330
+ z.array(ParserModelSchema).meta({
331
+ title: 'Parser Model Array',
332
+ description:
333
+ 'An array of model configurations, typically used for positional_args or named_args.',
334
+ }),
335
+ // Array of select values - for language lists
336
+ z.array(SnippetDefinitionSelectValueSchema).meta({
337
+ title: 'Select Values Array',
338
+ description: 'An array of select options, typically used for language lists.',
339
+ }),
340
+ // Simple string value - for shortcode_name, tag_name, content_key, etc.
341
+ z.string().meta({
342
+ title: 'String Value',
343
+ description:
344
+ 'A string value, commonly used for shortcode_name, tag_name, content_key, and similar definitions.',
345
+ }),
346
+ // Simple number value
347
+ z.number().meta({
348
+ title: 'Number Value',
349
+ description: 'A numeric value.',
350
+ }),
351
+ // Simple boolean value
352
+ z.boolean().meta({
353
+ title: 'Boolean Value',
354
+ description: 'A boolean value.',
355
+ }),
356
+ // Array of strings
357
+ z.array(z.string()).meta({
358
+ title: 'String Array',
359
+ description: 'An array of strings.',
360
+ }),
361
+ ])
362
+ .meta({
363
+ id: 'type.snippet-definition-value',
364
+ title: 'Snippet Definition Value',
365
+ description:
366
+ 'A reusable value that can be referenced in snippet templates via { ref: "key" } or { spread_ref: "key" }.',
367
+ });
368
+
369
+ export const SnippetDefinitionsSchema = z
370
+ .record(z.string(), SnippetDefinitionValueSchema)
371
+ .optional()
372
+ .meta({
373
+ id: 'type._snippets_definitions',
374
+ title: 'Snippets Definitions',
375
+ description:
376
+ 'A record of reusable values that can be referenced in snippet templates. Values are substituted using { ref: "key" } for direct replacement or { spread_ref: "key" } for spreading arrays/objects.',
377
+ });
378
+
301
379
  export type SnippetConfig = z.infer<typeof SnippetConfigSchema>;
302
380
  export type SnippetsImports = z.infer<typeof SnippetsImportsSchema>;
381
+ export type SnippetDefinitionValue = z.infer<typeof SnippetDefinitionValueSchema>;
382
+ export type SnippetDefinitions = NonNullable<z.infer<typeof SnippetDefinitionsSchema>>;