Skip to content

Commit

Permalink
support text_alignment completions
Browse files Browse the repository at this point in the history
fixes #180
  • Loading branch information
panoply committed Mar 15, 2024
1 parent 363c6b1 commit c2756cb
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion extension/data/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,13 @@ export const schema = {
"title": "Inline RichText",
"markdownDescription": "A setting of type `inline_richtext` outputs HTML markup that isn't wrapped in paragraph tags (`<p>`). The setting includes the following basic formatting options:\n\n- Bold\n- Italic\n- Link\n\n> **NOTE**\n>\n> The `inline_richtext` setting doesn't support the following features:\n>\n> - Line breaks (`<br>`)\n> - An underline option in the rich text editor. Merchants can underline text using the `CMD`+`U` or `CTRL`+`U` keyboard shortcut.\n\nYou can use these fields to capture formatted text content, such as introductory brand content on the homepage.\n\nWhen accessing the value of a `inline_richtext` type setting, data is returned as one of the following:\n\n- A [string](https://shopify.dev/api/liquid/basics/types#string) that contains the entered content.\n- An [empty object](https://shopify.dev/api/liquid/basics/types#emptydrop), if nothing has been entered.\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/themes/architecture/settings/input-settings#inline_richtext)\n"
},
{
"enum": [
"text_alignment"
],
"title": "Text Alignment",
"markdownDescription": "A setting of type `text_alignment` outputs a `SegmentedControl` field with icons. In addition to the standard [attributes](https://shopify.dev/docs/themes/architecture/settings/input-settings#standard-attributes) of an input setting.\n\nWhen you access the value of a `text_alignment` type setting, data is returned as a string.\n\n> **NOTE**\n>\n> If you don't specify the default attribute, then the `left` option is selected by default.\n> Note\nIf you don't specify the default attribute, then the left option is selected by default.\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/docs/themes/architecture/settings/input-settings#text_alignment)\n\n\n"
},
{
"enum": [
"html"
Expand Down Expand Up @@ -737,6 +744,7 @@ export const schema = {
"url",
"richtext",
"inline_richtext",
"text_alignment",
"html",
"article",
"liquid",
Expand All @@ -755,6 +763,7 @@ export const schema = {
"id": {
"type": "string",
"default": "",
"minLength": 1,
"markdownDescription": "The setting ID, which is used to access the setting value. The id is exposed to the liquid templates via the settings object. It must only contain alphanumeric characters, underscores, and dashes.\n\n> **REQUIRED**\n>\n> The `id` attribute is required for all settings.\n\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/docs/themes/architecture/settings/input-settings#standard-attributes)\n"
},
"label": {
Expand All @@ -775,7 +784,6 @@ export const schema = {
"number",
"boolean"
],
"default": "",
"markdownDescription": "The default value for the setting.\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/docs/themes/architecture/settings/input-settings#standard-attributes)\n"
},
"info": {
Expand Down Expand Up @@ -844,6 +852,22 @@ export const schema = {
"$ref": "#/definitions/select"
}
},
{
"if": {
"required": [
"type"
],
"type": "object",
"properties": {
"type": {
"const": "text_alignment"
}
}
},
"then": {
"$ref": "#/definitions/text_alignment"
}
},
{
"if": {
"required": [
Expand Down Expand Up @@ -1005,6 +1029,16 @@ export const schema = {
"${4|default,placeholder,info|}": "$5"
}
},
{
"label": "Text Alignment",
"markdownDescription": "A setting of type `text_alignment` outputs a `SegmentedControl` field with icons. In addition to the standard [attributes](https://shopify.dev/docs/themes/architecture/settings/input-settings#standard-attributes) of an input setting.\n\nWhen you access the value of a `text_alignment` type setting, data is returned as a string.\n\n> **NOTE**\n>\n> If you don't specify the default attribute, then the `left` option is selected by default.\n> Note\nIf you don't specify the default attribute, then the left option is selected by default.\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/docs/themes/architecture/settings/input-settings#text_alignment)\n\n\n",
"body": {
"type": "text_alignment",
"id": "$2",
"label": "${2/([^_]+)(_*)/${1:/capitalize}${2:+ }/g}$3",
"default": "${4|left,center,right|}"
}
},
{
"label": "Number",
"markdownDescription": "A setting of type `number` outputs a single number field. In addition to the [standard attributes](https://shopify.dev/themes/architecture/settings/input-settings#standard-attributes) of an input setting.\n\nWhen accessing the value of a `number` type setting, data is returned as one of the following:\n\n- A [number](https://shopify.dev/api/liquid/basics/types#number).\n- [nil](https://shopify.dev/api/liquid/basics/types#nil), if nothing has been entered.\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/themes/architecture/settings/input-settings#number)\n\n\n",
Expand Down Expand Up @@ -1733,6 +1767,20 @@ export const schema = {
"section"
]
},
"text_alignment": {
"type": "object",
"properties": {
"default": {
"type": "string",
"default": "left",
"enum": [
"left",
"center",
"right"
]
}
}
},
"enabled_on": {
"title": "Enabled On",
"markdownDescription": "You can restrict a section to certain template page types and section group types by specifying them through the `enabled_on` attribute.\n\n`enabled_on`, along with `disabled_on`, replaces the templates attribute.\n\n> **CAUTION**\n>\n> You can use only one of `enabled_on` or [`disabled_on`](https://shopify.dev/docs/themes/architecture/sections/section-schema#disabled_on).\n\n#\n\n---\n\n[Shopify Documentation](https://shopify.dev/docs/themes/architecture/sections/section-schema#enabled_on)\n",
Expand Down

0 comments on commit c2756cb

Please sign in to comment.