diff --git a/ai/claude/CLAUDE.md b/ai/claude/CLAUDE.md index 24ceca0..aef06d2 100644 --- a/ai/claude/CLAUDE.md +++ b/ai/claude/CLAUDE.md @@ -869,6 +869,7 @@ iterate over an array that has more than 50 items. The following arrays can be p - [`all_products`](https://shopify.dev/docs/api/liquid/objects/all_products) - [`article.comments`](https://shopify.dev/docs/api/liquid/objects/article#article-comments) +- [`article_list` settings](/themes/architecture/settings/input-settings#article_list) - [`blog.articles`](https://shopify.dev/docs/api/liquid/objects/blog#blog-articles) - [`collections`](https://shopify.dev/docs/api/liquid/objects/collections) - [`collection.products`](https://shopify.dev/docs/api/liquid/objects/collection#collection-products) diff --git a/ai/github/copilot-instructions.md b/ai/github/copilot-instructions.md index 24ceca0..aef06d2 100644 --- a/ai/github/copilot-instructions.md +++ b/ai/github/copilot-instructions.md @@ -869,6 +869,7 @@ iterate over an array that has more than 50 items. The following arrays can be p - [`all_products`](https://shopify.dev/docs/api/liquid/objects/all_products) - [`article.comments`](https://shopify.dev/docs/api/liquid/objects/article#article-comments) +- [`article_list` settings](/themes/architecture/settings/input-settings#article_list) - [`blog.articles`](https://shopify.dev/docs/api/liquid/objects/blog#blog-articles) - [`collections`](https://shopify.dev/docs/api/liquid/objects/collections) - [`collection.products`](https://shopify.dev/docs/api/liquid/objects/collection#collection-products) diff --git a/data/tags.json b/data/tags.json index 7dff70b..029156b 100644 --- a/data/tags.json +++ b/data/tags.json @@ -1040,7 +1040,7 @@ }, { "name": "Paginating setting arrays", - "description": "To allow the pagination of `product_list` and `collection_list` settings to operate independently from other paginated lists on a page, these lists use a pagination query parameter with a unique key. The key is automatically assigned by the `paginate` tag, and you don't need to reference the key in your code. However, you can access the key using [`paginate.page_param`](/docs/api/liquid/objects/paginate#paginate-page_param).\n\n> Tip:\n> To paginate two arrays independently without refreshing the entire page, you can use the [Section Rendering API](/docs/api/ajax/section-rendering).\n", + "description": "To allow the pagination of `product_list`, `article_list` and `collection_list` settings to operate independently from other paginated lists on a page, these lists use a pagination query parameter with a unique key. The key is automatically assigned by the `paginate` tag, and you don't need to reference the key in your code. However, you can access the key using [`paginate.page_param`](/docs/api/liquid/objects/paginate#paginate-page_param).\n\n> Tip:\n> To paginate two arrays independently without refreshing the entire page, you can use the [Section Rendering API](/docs/api/ajax/section-rendering).\n", "syntax": "", "path": "/", "raw_liquid": "", diff --git a/package.json b/package.json index 941be54..b672237 100644 --- a/package.json +++ b/package.json @@ -16,5 +16,6 @@ "prettier": "^2.8.8", "vitest": "^0.32.2", "vscode-json-languageservice": "^5.3.10" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/schemas/theme/setting.json b/schemas/theme/setting.json index bacad44..bd2e273 100644 --- a/schemas/theme/setting.json +++ b/schemas/theme/setting.json @@ -7,6 +7,7 @@ "markdownDescription": "The type of the input or sidebar setting. This value determines the type of field that gets rendered into the editor.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/settings)", "enum": [ "article", + "article_list", "blog", "checkbox", "collection", @@ -57,6 +58,10 @@ "if": { "required": ["type"], "properties": { "type": { "const": "article" } } }, "then": { "$ref": "#/definitions/article" } }, + { + "if": { "required": ["type"], "properties": { "type": { "const": "article_list" } } }, + "then": { "$ref": "#/definitions/article_list" } + }, { "if": { "required": ["type"], "properties": { "type": { "const": "blog" } } }, "then": { "$ref": "#/definitions/blog" } @@ -196,6 +201,26 @@ "additionalProperties": false }, + "article_list": { + "allOf": [{ "$ref": "#/definitions/inputSettingsStandardAttributes" }], + "properties": { + "type": { + "const": "article_list", + "description": "A setting of type article_list outputs an article picker field that's automatically populated with the available articles for the store. You can use these fields to capture multiple articles, such as a group of articles to feature on the homepage.", + "markdownDescription": "A setting of type `article_list` outputs an article picker field that's automatically populated with the available products for the store. You can use these fields to capture multiple articles, such as a group of articles to feature on the homepage.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/settings/input-settings#article_list)" + }, + "limit": { + "type": "integer", + "description": "The maximum number that the merchant can select. The default limit, and the maximum limit you can set, is 50." + }, + "default": true, + "label": true, + "info": true, + "id": true + }, + "additionalProperties": false + }, + "blog": { "allOf": [{ "$ref": "#/definitions/inputSettingsStandardAttributes" }], "properties": { diff --git a/tests/fixtures/theme-settings-all-settings.json b/tests/fixtures/theme-settings-all-settings.json index 3448b55..f879095 100644 --- a/tests/fixtures/theme-settings-all-settings.json +++ b/tests/fixtures/theme-settings-all-settings.json @@ -80,6 +80,12 @@ "info": "This is an article", "label": "the article's label" }, + { + "type": "article_list", + "id": "article_list", + "label": "Articles", + "limit": 12 + }, { "type": "blog", "id": "my-blog", diff --git a/tests/section.spec.ts b/tests/section.spec.ts index 5739f71..b3452ad 100644 --- a/tests/section.spec.ts +++ b/tests/section.spec.ts @@ -70,7 +70,7 @@ describe('JSON Schema validation of Liquid theme section schema tags', () => { expect(diagnostics).toStrictEqual([ { code: 1, - message: expect.stringContaining('Value is not accepted. Valid values: "article", "blog"'), + message: expect.stringContaining('Value is not accepted. Valid values: "article", "article_list", "blog"'), severity: 1, range: expect.objectContaining({ start: expect.objectContaining({ diff --git a/tests/test-constants.ts b/tests/test-constants.ts index 34fb051..7444d39 100644 --- a/tests/test-constants.ts +++ b/tests/test-constants.ts @@ -1,5 +1,6 @@ export const SETTINGS_TYPES_NOT_SUPPORTING_VISIBLE_IF = [ 'article', + 'article_list', 'blog', 'collection', 'collection_list', @@ -14,6 +15,7 @@ export const SETTINGS_TYPES_NOT_SUPPORTING_VISIBLE_IF = [ export const INPUT_SETTING_TYPES = [ 'article', + 'article_list', 'blog', 'checkbox', 'collection_list', @@ -48,4 +50,4 @@ export const INPUT_SETTING_TYPES = [ export const SIDEBAR_SETTING_TYPES = ['header', 'paragraph']; -export const RESOURCE_LIST_SETTING_TYPES = ['product_list', 'collection_list', 'metaobject_list']; +export const RESOURCE_LIST_SETTING_TYPES = ['product_list', 'collection_list', 'metaobject_list', 'article_list']; diff --git a/tests/theme-settings/general.spec.ts b/tests/theme-settings/general.spec.ts index 04c47ac..a681217 100644 --- a/tests/theme-settings/general.spec.ts +++ b/tests/theme-settings/general.spec.ts @@ -59,7 +59,7 @@ describe('Module: theme settings validation (config/settings_schema.json)', () = { code: 1, message: expect.stringContaining( - 'Value is not accepted. Valid values: "article", "blog"', + 'Value is not accepted. Valid values: "article", "article_list", "blog"', ), severity: 1, range: expect.objectContaining({