From c5c98f2d25e9e5a67c7d3f84ec8f21337ae00032 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Thu, 10 Oct 2024 08:41:34 -0700 Subject: [PATCH 1/5] drop brand-color.emphasis --- src/resources/editor/tools/vs-code.mjs | 16 ++++------------ src/resources/editor/tools/yaml/web-worker.js | 16 ++++------------ .../tools/yaml/yaml-intelligence-resources.json | 16 ++++------------ src/resources/schema/definitions.yml | 9 ++------- src/resources/schema/json-schemas.json | 3 --- src/resources/types/schema-types.ts | 3 +-- 6 files changed, 15 insertions(+), 48 deletions(-) diff --git a/src/resources/editor/tools/vs-code.mjs b/src/resources/editor/tools/vs-code.mjs index 03199c2964..0035ea94e1 100644 --- a/src/resources/editor/tools/vs-code.mjs +++ b/src/resources/editor/tools/vs-code.mjs @@ -11889,9 +11889,7 @@ var require_yaml_intelligence_resources = __commonJS({ schema: { object: { additionalProperties: { - schema: { - ref: "brand-string-light-dark" - } + schema: "string" } } } @@ -12044,12 +12042,6 @@ var require_yaml_intelligence_resources = __commonJS({ ref: "brand-color-value" } }, - emphasis: { - description: "A color used to emphasize or highlight text or elements.\n", - schema: { - ref: "brand-color-value" - } - }, link: { description: "The color used for hyperlinks. If not defined, the `primary` color is used.\n", schema: { @@ -24011,12 +24003,12 @@ var require_yaml_intelligence_resources = __commonJS({ mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190350, + _internalId: 190344, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190342, + _internalId: 190336, type: "enum", enum: [ "png", @@ -24032,7 +24024,7 @@ var require_yaml_intelligence_resources = __commonJS({ exhaustiveCompletions: true }, theme: { - _internalId: 190349, + _internalId: 190343, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/web-worker.js b/src/resources/editor/tools/yaml/web-worker.js index 83170a9d09..9e48907a9a 100644 --- a/src/resources/editor/tools/yaml/web-worker.js +++ b/src/resources/editor/tools/yaml/web-worker.js @@ -11890,9 +11890,7 @@ try { schema: { object: { additionalProperties: { - schema: { - ref: "brand-string-light-dark" - } + schema: "string" } } } @@ -12045,12 +12043,6 @@ try { ref: "brand-color-value" } }, - emphasis: { - description: "A color used to emphasize or highlight text or elements.\n", - schema: { - ref: "brand-color-value" - } - }, link: { description: "The color used for hyperlinks. If not defined, the `primary` color is used.\n", schema: { @@ -24012,12 +24004,12 @@ try { mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190350, + _internalId: 190344, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190342, + _internalId: 190336, type: "enum", enum: [ "png", @@ -24033,7 +24025,7 @@ try { exhaustiveCompletions: true }, theme: { - _internalId: 190349, + _internalId: 190343, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json index b8c8001474..8db03edb5b 100644 --- a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json +++ b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json @@ -4861,9 +4861,7 @@ "schema": { "object": { "additionalProperties": { - "schema": { - "ref": "brand-string-light-dark" - } + "schema": "string" } } } @@ -5016,12 +5014,6 @@ "ref": "brand-color-value" } }, - "emphasis": { - "description": "A color used to emphasize or highlight text or elements.\n", - "schema": { - "ref": "brand-color-value" - } - }, "link": { "description": "The color used for hyperlinks. If not defined, the `primary` color is used.\n", "schema": { @@ -16983,12 +16975,12 @@ "mermaid": "%%" }, "handlers/mermaid/schema.yml": { - "_internalId": 190350, + "_internalId": 190344, "type": "object", "description": "be an object", "properties": { "mermaid-format": { - "_internalId": 190342, + "_internalId": 190336, "type": "enum", "enum": [ "png", @@ -17004,7 +16996,7 @@ "exhaustiveCompletions": true }, "theme": { - "_internalId": 190349, + "_internalId": 190343, "type": "anyOf", "anyOf": [ { diff --git a/src/resources/schema/definitions.yml b/src/resources/schema/definitions.yml index a194826135..419c33c505 100644 --- a/src/resources/schema/definitions.yml +++ b/src/resources/schema/definitions.yml @@ -2525,8 +2525,8 @@ schema: object: additionalProperties: - schema: - ref: brand-string-light-dark + schema: string + # ref: brand-string-light-dark small: description: > A link or path to the brand's small-sized logo or icon, or a link or path @@ -2646,11 +2646,6 @@ or high-contrast background color on light elements. schema: ref: brand-color-value - emphasis: - description: > - A color used to emphasize or highlight text or elements. - schema: - ref: brand-color-value link: description: > The color used for hyperlinks. If not defined, the `primary` color is used. diff --git a/src/resources/schema/json-schemas.json b/src/resources/schema/json-schemas.json index 735f56ae50..7591a62f8e 100644 --- a/src/resources/schema/json-schemas.json +++ b/src/resources/schema/json-schemas.json @@ -3339,9 +3339,6 @@ "dark": { "$ref": "#/$defs/BrandColorValue" }, - "emphasis": { - "$ref": "#/$defs/BrandColorValue" - }, "link": { "$ref": "#/$defs/BrandColorValue" } diff --git a/src/resources/types/schema-types.ts b/src/resources/types/schema-types.ts index a89436c87d..4ebf430e3d 100644 --- a/src/resources/types/schema-types.ts +++ b/src/resources/types/schema-types.ts @@ -1284,7 +1284,7 @@ export type BrandMeta = { export type BrandStringLightDark = string | { dark?: string; light?: string }; export type BrandLogo = { - images?: { [key: string]: BrandStringLightDark }; + images?: { [key: string]: string }; large?: BrandStringLightDark; medium?: BrandStringLightDark; small?: BrandStringLightDark; @@ -1308,7 +1308,6 @@ export type BrandColor = { background?: BrandColorValue; danger?: BrandColorValue; dark?: BrandColorValue; - emphasis?: BrandColorValue; foreground?: BrandColorValue; info?: BrandColorValue; light?: BrandColorValue; From c0c320d9433dc6b0065e88186d0f2f9f1e5afa07 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Thu, 10 Oct 2024 09:06:21 -0700 Subject: [PATCH 2/5] adjust schemas to https://github.com/posit-dev/brand-yaml/issues/21#issuecomment-2403402888 --- src/core/brand/brand.ts | 1 - src/resources/editor/tools/vs-code.mjs | 242 +++++++++------- src/resources/editor/tools/yaml/web-worker.js | 242 +++++++++------- .../yaml/yaml-intelligence-resources.json | 242 +++++++++------- src/resources/schema/definitions.yml | 160 ++++++----- src/resources/schema/json-schemas.json | 260 +++++++++++------- src/resources/types/schema-types.ts | 19 +- 7 files changed, 705 insertions(+), 461 deletions(-) diff --git a/src/core/brand/brand.ts b/src/core/brand/brand.ts index 672bace81e..edc2e077da 100644 --- a/src/core/brand/brand.ts +++ b/src/core/brand/brand.ts @@ -32,7 +32,6 @@ export const defaultColorNames: BrandNamedThemeColor[] = [ "danger", "light", "dark", - "emphasis", "link", ]; diff --git a/src/resources/editor/tools/vs-code.mjs b/src/resources/editor/tools/vs-code.mjs index 0035ea94e1..6d69882aee 100644 --- a/src/resources/editor/tools/vs-code.mjs +++ b/src/resources/editor/tools/vs-code.mjs @@ -12124,84 +12124,104 @@ var require_yaml_intelligence_resources = __commonJS({ { id: "brand-typography-options-base", description: "Typographic options.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "line-height": { - ref: "line-height-number-string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "line-height": { + ref: "line-height-number-string" + } + } } } - } + ] }, { id: "brand-typography-options-headings", description: "Typographic options without a font size.", - object: { - closed: true, - properties: { - family: "string", - weight: { - ref: "brand-font-weight" - }, - style: { - ref: "brand-font-style" - }, - color: { - ref: "brand-maybe-named-color" - }, - "line-height": { - ref: "line-height-number-string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + weight: { + ref: "brand-font-weight" + }, + style: { + ref: "brand-font-style" + }, + color: { + ref: "brand-maybe-named-color" + }, + "line-height": { + ref: "line-height-number-string" + } + } } } - } + ] }, { id: "brand-typography-options-monospace", description: "Typographic options for monospace elements.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + } + } } } - } + ] }, { id: "brand-typography-options-monospace-inline", description: "Typographic options for inline monospace elements.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + } + } } } - } + ] }, { id: "line-height-number-string", @@ -12214,44 +12234,54 @@ var require_yaml_intelligence_resources = __commonJS({ { id: "brand-typography-options-monospace-block", description: "Typographic options for block monospace elements.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" - }, - "line-height": { - ref: "line-height-number-string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + }, + "line-height": { + ref: "line-height-number-string" + } + } } } - } + ] }, { id: "brand-typography-options-link", description: "Typographic options for inline monospace elements.", - object: { - closed: true, - properties: { - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" - }, - decoration: "string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + }, + decoration: "string" + } + } } - } + ] }, { id: "brand-named-font", @@ -12274,6 +12304,9 @@ var require_yaml_intelligence_resources = __commonJS({ }, { ref: "brand-font-file" + }, + { + ref: "brand-font-system" } ] }, @@ -12361,6 +12394,23 @@ var require_yaml_intelligence_resources = __commonJS({ } } }, + { + id: "brand-font-system", + description: "A system font definition.", + object: { + super: { + resolveRef: "brand-font-common" + }, + closed: true, + properties: { + source: { + enum: [ + "system" + ] + } + } + } + }, { id: "brand-font-google", description: "A font definition from Google Fonts.", @@ -21679,7 +21729,6 @@ var require_yaml_intelligence_resources = __commonJS({ "The color used for errors, dangerous actions, or negative\ninformation.", "A bright color, used as a high-contrast foreground color on dark\nelements or low-contrast background color on light elements.", "A dark color, used as a high-contrast foreground color on light\nelements or high-contrast background color on light elements.", - "A color used to emphasize or highlight text or elements.", "The color used for hyperlinks. If not defined, the\nprimary color is used.", "A color, which may be a named brand color.", "A named brand color, taken either from color.theme or\ncolor.palette (in that order).", @@ -23774,7 +23823,12 @@ var require_yaml_intelligence_resources = __commonJS({ }, "Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).", "Manuscript configuration", - "internal-schema-hack" + "internal-schema-hack", + "A system font definition.", + "The font family name, which must match the name of the font on the\nfoundry website.", + "The font weights to include.", + "The font styles to include.", + "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use." ], "schema/external-schemas.yml": [ { @@ -24003,12 +24057,12 @@ var require_yaml_intelligence_resources = __commonJS({ mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190344, + _internalId: 190379, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190336, + _internalId: 190371, type: "enum", enum: [ "png", @@ -24024,7 +24078,7 @@ var require_yaml_intelligence_resources = __commonJS({ exhaustiveCompletions: true }, theme: { - _internalId: 190343, + _internalId: 190378, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/web-worker.js b/src/resources/editor/tools/yaml/web-worker.js index 9e48907a9a..6262f8a361 100644 --- a/src/resources/editor/tools/yaml/web-worker.js +++ b/src/resources/editor/tools/yaml/web-worker.js @@ -12125,84 +12125,104 @@ try { { id: "brand-typography-options-base", description: "Typographic options.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "line-height": { - ref: "line-height-number-string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "line-height": { + ref: "line-height-number-string" + } + } } } - } + ] }, { id: "brand-typography-options-headings", description: "Typographic options without a font size.", - object: { - closed: true, - properties: { - family: "string", - weight: { - ref: "brand-font-weight" - }, - style: { - ref: "brand-font-style" - }, - color: { - ref: "brand-maybe-named-color" - }, - "line-height": { - ref: "line-height-number-string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + weight: { + ref: "brand-font-weight" + }, + style: { + ref: "brand-font-style" + }, + color: { + ref: "brand-maybe-named-color" + }, + "line-height": { + ref: "line-height-number-string" + } + } } } - } + ] }, { id: "brand-typography-options-monospace", description: "Typographic options for monospace elements.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + } + } } } - } + ] }, { id: "brand-typography-options-monospace-inline", description: "Typographic options for inline monospace elements.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + } + } } } - } + ] }, { id: "line-height-number-string", @@ -12215,44 +12235,54 @@ try { { id: "brand-typography-options-monospace-block", description: "Typographic options for block monospace elements.", - object: { - closed: true, - properties: { - family: "string", - size: "string", - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" - }, - "line-height": { - ref: "line-height-number-string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + family: "string", + size: "string", + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + }, + "line-height": { + ref: "line-height-number-string" + } + } } } - } + ] }, { id: "brand-typography-options-link", description: "Typographic options for inline monospace elements.", - object: { - closed: true, - properties: { - weight: { - ref: "brand-font-weight" - }, - color: { - ref: "brand-maybe-named-color" - }, - "background-color": { - ref: "brand-maybe-named-color" - }, - decoration: "string" + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + weight: { + ref: "brand-font-weight" + }, + color: { + ref: "brand-maybe-named-color" + }, + "background-color": { + ref: "brand-maybe-named-color" + }, + decoration: "string" + } + } } - } + ] }, { id: "brand-named-font", @@ -12275,6 +12305,9 @@ try { }, { ref: "brand-font-file" + }, + { + ref: "brand-font-system" } ] }, @@ -12362,6 +12395,23 @@ try { } } }, + { + id: "brand-font-system", + description: "A system font definition.", + object: { + super: { + resolveRef: "brand-font-common" + }, + closed: true, + properties: { + source: { + enum: [ + "system" + ] + } + } + } + }, { id: "brand-font-google", description: "A font definition from Google Fonts.", @@ -21680,7 +21730,6 @@ try { "The color used for errors, dangerous actions, or negative\ninformation.", "A bright color, used as a high-contrast foreground color on dark\nelements or low-contrast background color on light elements.", "A dark color, used as a high-contrast foreground color on light\nelements or high-contrast background color on light elements.", - "A color used to emphasize or highlight text or elements.", "The color used for hyperlinks. If not defined, the\nprimary color is used.", "A color, which may be a named brand color.", "A named brand color, taken either from color.theme or\ncolor.palette (in that order).", @@ -23775,7 +23824,12 @@ try { }, "Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).", "Manuscript configuration", - "internal-schema-hack" + "internal-schema-hack", + "A system font definition.", + "The font family name, which must match the name of the font on the\nfoundry website.", + "The font weights to include.", + "The font styles to include.", + "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use." ], "schema/external-schemas.yml": [ { @@ -24004,12 +24058,12 @@ try { mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190344, + _internalId: 190379, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190336, + _internalId: 190371, type: "enum", enum: [ "png", @@ -24025,7 +24079,7 @@ try { exhaustiveCompletions: true }, theme: { - _internalId: 190343, + _internalId: 190378, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json index 8db03edb5b..3448db999e 100644 --- a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json +++ b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json @@ -5096,84 +5096,104 @@ { "id": "brand-typography-options-base", "description": "Typographic options.", - "object": { - "closed": true, - "properties": { - "family": "string", - "size": "string", - "weight": { - "ref": "brand-font-weight" - }, - "color": { - "ref": "brand-maybe-named-color" - }, - "line-height": { - "ref": "line-height-number-string" + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "family": "string", + "size": "string", + "weight": { + "ref": "brand-font-weight" + }, + "color": { + "ref": "brand-maybe-named-color" + }, + "line-height": { + "ref": "line-height-number-string" + } + } } } - } + ] }, { "id": "brand-typography-options-headings", "description": "Typographic options without a font size.", - "object": { - "closed": true, - "properties": { - "family": "string", - "weight": { - "ref": "brand-font-weight" - }, - "style": { - "ref": "brand-font-style" - }, - "color": { - "ref": "brand-maybe-named-color" - }, - "line-height": { - "ref": "line-height-number-string" + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "family": "string", + "weight": { + "ref": "brand-font-weight" + }, + "style": { + "ref": "brand-font-style" + }, + "color": { + "ref": "brand-maybe-named-color" + }, + "line-height": { + "ref": "line-height-number-string" + } + } } } - } + ] }, { "id": "brand-typography-options-monospace", "description": "Typographic options for monospace elements.", - "object": { - "closed": true, - "properties": { - "family": "string", - "size": "string", - "weight": { - "ref": "brand-font-weight" - }, - "color": { - "ref": "brand-maybe-named-color" - }, - "background-color": { - "ref": "brand-maybe-named-color" + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "family": "string", + "size": "string", + "weight": { + "ref": "brand-font-weight" + }, + "color": { + "ref": "brand-maybe-named-color" + }, + "background-color": { + "ref": "brand-maybe-named-color" + } + } } } - } + ] }, { "id": "brand-typography-options-monospace-inline", "description": "Typographic options for inline monospace elements.", - "object": { - "closed": true, - "properties": { - "family": "string", - "size": "string", - "weight": { - "ref": "brand-font-weight" - }, - "color": { - "ref": "brand-maybe-named-color" - }, - "background-color": { - "ref": "brand-maybe-named-color" + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "family": "string", + "size": "string", + "weight": { + "ref": "brand-font-weight" + }, + "color": { + "ref": "brand-maybe-named-color" + }, + "background-color": { + "ref": "brand-maybe-named-color" + } + } } } - } + ] }, { "id": "line-height-number-string", @@ -5186,44 +5206,54 @@ { "id": "brand-typography-options-monospace-block", "description": "Typographic options for block monospace elements.", - "object": { - "closed": true, - "properties": { - "family": "string", - "size": "string", - "weight": { - "ref": "brand-font-weight" - }, - "color": { - "ref": "brand-maybe-named-color" - }, - "background-color": { - "ref": "brand-maybe-named-color" - }, - "line-height": { - "ref": "line-height-number-string" + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "family": "string", + "size": "string", + "weight": { + "ref": "brand-font-weight" + }, + "color": { + "ref": "brand-maybe-named-color" + }, + "background-color": { + "ref": "brand-maybe-named-color" + }, + "line-height": { + "ref": "line-height-number-string" + } + } } } - } + ] }, { "id": "brand-typography-options-link", "description": "Typographic options for inline monospace elements.", - "object": { - "closed": true, - "properties": { - "weight": { - "ref": "brand-font-weight" - }, - "color": { - "ref": "brand-maybe-named-color" - }, - "background-color": { - "ref": "brand-maybe-named-color" - }, - "decoration": "string" + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "weight": { + "ref": "brand-font-weight" + }, + "color": { + "ref": "brand-maybe-named-color" + }, + "background-color": { + "ref": "brand-maybe-named-color" + }, + "decoration": "string" + } + } } - } + ] }, { "id": "brand-named-font", @@ -5246,6 +5276,9 @@ }, { "ref": "brand-font-file" + }, + { + "ref": "brand-font-system" } ] }, @@ -5333,6 +5366,23 @@ } } }, + { + "id": "brand-font-system", + "description": "A system font definition.", + "object": { + "super": { + "resolveRef": "brand-font-common" + }, + "closed": true, + "properties": { + "source": { + "enum": [ + "system" + ] + } + } + } + }, { "id": "brand-font-google", "description": "A font definition from Google Fonts.", @@ -14651,7 +14701,6 @@ "The color used for errors, dangerous actions, or negative\ninformation.", "A bright color, used as a high-contrast foreground color on dark\nelements or low-contrast background color on light elements.", "A dark color, used as a high-contrast foreground color on light\nelements or high-contrast background color on light elements.", - "A color used to emphasize or highlight text or elements.", "The color used for hyperlinks. If not defined, the\nprimary color is used.", "A color, which may be a named brand color.", "A named brand color, taken either from color.theme or\ncolor.palette (in that order).", @@ -16746,7 +16795,12 @@ }, "Disambiguating year suffix in author-date styles (e.g. “a” in “Doe,\n1999a”).", "Manuscript configuration", - "internal-schema-hack" + "internal-schema-hack", + "A system font definition.", + "The font family name, which must match the name of the font on the\nfoundry website.", + "The font weights to include.", + "The font styles to include.", + "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use." ], "schema/external-schemas.yml": [ { @@ -16975,12 +17029,12 @@ "mermaid": "%%" }, "handlers/mermaid/schema.yml": { - "_internalId": 190344, + "_internalId": 190379, "type": "object", "description": "be an object", "properties": { "mermaid-format": { - "_internalId": 190336, + "_internalId": 190371, "type": "enum", "enum": [ "png", @@ -16996,7 +17050,7 @@ "exhaustiveCompletions": true }, "theme": { - "_internalId": 190343, + "_internalId": 190378, "type": "anyOf", "anyOf": [ { diff --git a/src/resources/schema/definitions.yml b/src/resources/schema/definitions.yml index 419c33c505..e5b3218ca7 100644 --- a/src/resources/schema/definitions.yml +++ b/src/resources/schema/definitions.yml @@ -2713,60 +2713,68 @@ - id: brand-typography-options-base description: Typographic options. - object: - closed: true - properties: - family: string - size: string - weight: - ref: brand-font-weight - color: - ref: brand-maybe-named-color - line-height: - ref: line-height-number-string + anyOf: + - string + - object: + closed: true + properties: + family: string + size: string + weight: + ref: brand-font-weight + color: + ref: brand-maybe-named-color + line-height: + ref: line-height-number-string - id: brand-typography-options-headings description: Typographic options without a font size. - object: - closed: true - properties: - family: string - weight: - ref: brand-font-weight - style: - ref: brand-font-style - color: - ref: brand-maybe-named-color - line-height: - ref: line-height-number-string + anyOf: + - string + - object: + closed: true + properties: + family: string + weight: + ref: brand-font-weight + style: + ref: brand-font-style + color: + ref: brand-maybe-named-color + line-height: + ref: line-height-number-string - id: brand-typography-options-monospace description: Typographic options for monospace elements. - object: - closed: true - properties: - family: string - size: string - weight: - ref: brand-font-weight - color: - ref: brand-maybe-named-color - background-color: - ref: brand-maybe-named-color + anyOf: + - string + - object: + closed: true + properties: + family: string + size: string + weight: + ref: brand-font-weight + color: + ref: brand-maybe-named-color + background-color: + ref: brand-maybe-named-color - id: brand-typography-options-monospace-inline description: Typographic options for inline monospace elements. - object: - closed: true - properties: - family: string - size: string - weight: - ref: brand-font-weight - color: - ref: brand-maybe-named-color - background-color: - ref: brand-maybe-named-color + anyOf: + - string + - object: + closed: true + properties: + family: string + size: string + weight: + ref: brand-font-weight + color: + ref: brand-maybe-named-color + background-color: + ref: brand-maybe-named-color - id: line-height-number-string description: Line height @@ -2774,32 +2782,36 @@ - id: brand-typography-options-monospace-block description: Typographic options for block monospace elements. - object: - closed: true - properties: - family: string - size: string - weight: - ref: brand-font-weight - color: - ref: brand-maybe-named-color - background-color: - ref: brand-maybe-named-color - line-height: - ref: line-height-number-string + anyOf: + - string + - object: + closed: true + properties: + family: string + size: string + weight: + ref: brand-font-weight + color: + ref: brand-maybe-named-color + background-color: + ref: brand-maybe-named-color + line-height: + ref: line-height-number-string - id: brand-typography-options-link description: Typographic options for inline monospace elements. - object: - closed: true - properties: - weight: - ref: brand-font-weight - color: - ref: brand-maybe-named-color - background-color: - ref: brand-maybe-named-color - decoration: string + anyOf: + - string + - object: + closed: true + properties: + weight: + ref: brand-font-weight + color: + ref: brand-maybe-named-color + background-color: + ref: brand-maybe-named-color + decoration: string - id: brand-named-font description: Names of customizeable fonts @@ -2811,7 +2823,7 @@ - ref: brand-font-google - ref: brand-font-bunny - ref: brand-font-file - # - ref: brand-font-family + - ref: brand-font-system - id: brand-font-weight description: A font weight. @@ -2872,6 +2884,16 @@ enum: [auto, block, swap, fallback, optional] default: swap +- id: brand-font-system + description: A system font definition. + object: + super: + resolveRef: brand-font-common + closed: true + properties: + source: + enum: [system] + - id: brand-font-google description: A font definition from Google Fonts. object: diff --git a/src/resources/schema/json-schemas.json b/src/resources/schema/json-schemas.json index 7591a62f8e..cd333925d7 100644 --- a/src/resources/schema/json-schemas.json +++ b/src/resources/schema/json-schemas.json @@ -3403,88 +3403,116 @@ } }, "BrandTypographyOptionsBase": { - "object": { - "properties": { - "family": { - "type": "string" - }, - "size": { - "type": "string" - }, - "weight": { - "$ref": "#/$defs/BrandFontWeight" - }, - "color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "line-height": { - "$ref": "#/$defs/LineHeightNumberString" + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "family": { + "type": "string" + }, + "size": { + "type": "string" + }, + "weight": { + "$ref": "#/$defs/BrandFontWeight" + }, + "color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "line-height": { + "$ref": "#/$defs/LineHeightNumberString" + } + } } } - } + ] }, "BrandTypographyOptionsHeadings": { - "object": { - "properties": { - "family": { - "type": "string" - }, - "weight": { - "$ref": "#/$defs/BrandFontWeight" - }, - "style": { - "$ref": "#/$defs/BrandFontStyle" - }, - "color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "line-height": { - "$ref": "#/$defs/LineHeightNumberString" + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "family": { + "type": "string" + }, + "weight": { + "$ref": "#/$defs/BrandFontWeight" + }, + "style": { + "$ref": "#/$defs/BrandFontStyle" + }, + "color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "line-height": { + "$ref": "#/$defs/LineHeightNumberString" + } + } } } - } + ] }, "BrandTypographyOptionsMonospace": { - "object": { - "properties": { - "family": { - "type": "string" - }, - "size": { - "type": "string" - }, - "weight": { - "$ref": "#/$defs/BrandFontWeight" - }, - "color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "background-color": { - "$ref": "#/$defs/BrandMaybeNamedColor" + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "family": { + "type": "string" + }, + "size": { + "type": "string" + }, + "weight": { + "$ref": "#/$defs/BrandFontWeight" + }, + "color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "background-color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + } + } } } - } + ] }, "BrandTypographyOptionsMonospaceInline": { - "object": { - "properties": { - "family": { - "type": "string" - }, - "size": { - "type": "string" - }, - "weight": { - "$ref": "#/$defs/BrandFontWeight" - }, - "color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "background-color": { - "$ref": "#/$defs/BrandMaybeNamedColor" + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "family": { + "type": "string" + }, + "size": { + "type": "string" + }, + "weight": { + "$ref": "#/$defs/BrandFontWeight" + }, + "color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "background-color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + } + } } } - } + ] }, "LineHeightNumberString": { "anyOf": [ @@ -3497,46 +3525,60 @@ ] }, "BrandTypographyOptionsMonospaceBlock": { - "object": { - "properties": { - "family": { - "type": "string" - }, - "size": { - "type": "string" - }, - "weight": { - "$ref": "#/$defs/BrandFontWeight" - }, - "color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "background-color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "line-height": { - "$ref": "#/$defs/LineHeightNumberString" + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "family": { + "type": "string" + }, + "size": { + "type": "string" + }, + "weight": { + "$ref": "#/$defs/BrandFontWeight" + }, + "color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "background-color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "line-height": { + "$ref": "#/$defs/LineHeightNumberString" + } + } } } - } + ] }, "BrandTypographyOptionsLink": { - "object": { - "properties": { - "weight": { - "$ref": "#/$defs/BrandFontWeight" - }, - "color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "background-color": { - "$ref": "#/$defs/BrandMaybeNamedColor" - }, - "decoration": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "weight": { + "$ref": "#/$defs/BrandFontWeight" + }, + "color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "background-color": { + "$ref": "#/$defs/BrandMaybeNamedColor" + }, + "decoration": { + "type": "string" + } + } } } - } + ] }, "BrandNamedFont": { "enum": [ @@ -3555,6 +3597,9 @@ }, { "$ref": "#/$defs/BrandFontFile" + }, + { + "$ref": "#/$defs/BrandFontSystem" } ] }, @@ -3635,6 +3680,17 @@ } } }, + "BrandFontSystem": { + "object": { + "properties": { + "source": { + "enum": [ + "system" + ] + } + } + } + }, "BrandFontGoogle": { "object": { "properties": { diff --git a/src/resources/types/schema-types.ts b/src/resources/types/schema-types.ts index 4ebf430e3d..72b83264bf 100644 --- a/src/resources/types/schema-types.ts +++ b/src/resources/types/schema-types.ts @@ -1351,7 +1351,7 @@ export type BrandTypography = { monospace?: BrandTypographyOptionsMonospace; }; /* Typography definitions for the brand. */ -export type BrandTypographyOptionsBase = { +export type BrandTypographyOptionsBase = string | { "line-height"?: LineHeightNumberString; color?: BrandMaybeNamedColor; family?: string; @@ -1359,7 +1359,7 @@ export type BrandTypographyOptionsBase = { weight?: BrandFontWeight; }; /* Typographic options. */ -export type BrandTypographyOptionsHeadings = { +export type BrandTypographyOptionsHeadings = string | { "line-height"?: LineHeightNumberString; color?: BrandMaybeNamedColor; family?: string; @@ -1367,7 +1367,7 @@ export type BrandTypographyOptionsHeadings = { weight?: BrandFontWeight; }; /* Typographic options without a font size. */ -export type BrandTypographyOptionsMonospace = { +export type BrandTypographyOptionsMonospace = string | { "background-color"?: BrandMaybeNamedColor; color?: BrandMaybeNamedColor; family?: string; @@ -1375,7 +1375,7 @@ export type BrandTypographyOptionsMonospace = { weight?: BrandFontWeight; }; /* Typographic options for monospace elements. */ -export type BrandTypographyOptionsMonospaceInline = { +export type BrandTypographyOptionsMonospaceInline = string | { "background-color"?: BrandMaybeNamedColor; color?: BrandMaybeNamedColor; family?: string; @@ -1385,7 +1385,7 @@ export type BrandTypographyOptionsMonospaceInline = { export type LineHeightNumberString = number | string; /* Line height */ -export type BrandTypographyOptionsMonospaceBlock = { +export type BrandTypographyOptionsMonospaceBlock = string | { "background-color"?: BrandMaybeNamedColor; "line-height"?: LineHeightNumberString; color?: BrandMaybeNamedColor; @@ -1394,7 +1394,7 @@ export type BrandTypographyOptionsMonospaceBlock = { weight?: BrandFontWeight; }; /* Typographic options for block monospace elements. */ -export type BrandTypographyOptionsLink = { +export type BrandTypographyOptionsLink = string | { "background-color"?: BrandMaybeNamedColor; color?: BrandMaybeNamedColor; decoration?: string; @@ -1409,7 +1409,8 @@ export type BrandNamedFont = export type BrandFont = | BrandFontGoogle | BrandFontBunny - | BrandFontFile; /* Font files and definitions for the brand. */ + | BrandFontFile + | BrandFontSystem; /* Font files and definitions for the brand. */ export type BrandFontWeight = | 100 @@ -1452,6 +1453,10 @@ export type BrandFontCommon = { weight?: MaybeArrayOf; /* The font weights to include. */ }; +export type BrandFontSystem = + & { source?: "system" } + & BrandFontCommon; /* A system font definition. */ + export type BrandFontGoogle = & { source?: "google" } & BrandFontCommon; /* A font definition from Google Fonts. */ From 5c83513a78ded63ed3f6faaf6a7ecba5f1ec2ce0 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Thu, 10 Oct 2024 09:38:57 -0700 Subject: [PATCH 3/5] update schema to https://github.com/posit-dev/brand-yaml/issues/19#issuecomment-2403381865 --- src/core/brand/brand.ts | 35 +++++++++++++-- src/core/sass/brand.ts | 4 +- src/resources/editor/tools/vs-code.mjs | 43 ++++++++++++++----- src/resources/editor/tools/yaml/web-worker.js | 43 ++++++++++++++----- .../yaml/yaml-intelligence-resources.json | 43 ++++++++++++++----- src/resources/schema/definitions.yml | 17 ++++++-- src/resources/schema/json-schemas.json | 20 ++++++++- src/resources/types/schema-types.ts | 5 ++- 8 files changed, 170 insertions(+), 40 deletions(-) diff --git a/src/core/brand/brand.ts b/src/core/brand/brand.ts index edc2e077da..80874c76bd 100644 --- a/src/core/brand/brand.ts +++ b/src/core/brand/brand.ts @@ -16,6 +16,7 @@ import { BrandTypographyOptionsBase, BrandTypographyOptionsHeadings, } from "../../resources/types/schema-types.ts"; +import { InternalError } from "../lib/error.ts"; // we can't programmatically convert typescript types to string arrays, // so we have to define this manually. They should match `BrandNamedThemeColor` in schema-types.ts @@ -85,18 +86,46 @@ export class Brand { if (link) { typography.link = link; } - const monospace = this.getFont("monospace"); + let monospace = this.getFont("monospace"); + let monospaceInline = this.getFont("monospace-inline"); + let monospaceBlock = this.getFont("monospace-block"); + if (monospace) { + if (typeof monospace === "string") { + monospace = { family: monospace }; + } typography.monospace = monospace; } - const monospaceInline = this.getFont("monospace-inline"); + if (monospaceInline && typeof monospaceInline === "string") { + monospaceInline = { family: monospaceInline }; + } + if (monospaceBlock && typeof monospaceBlock === "string") { + monospaceBlock = { family: monospaceBlock }; + } + + // cut off control flow here so the type checker knows these + // are not strings + if (typeof monospace === "string") { + throw new InternalError("should never happen"); + } + if (typeof monospaceInline === "string") { + throw new InternalError("should never happen"); + } + if (typeof monospaceBlock === "string") { + throw new InternalError("should never happen"); + } + if (monospace || monospaceInline) { typography["monospace-inline"] = { ...(monospace ?? {}), ...(monospaceInline ?? {}), }; } - const monospaceBlock = this.getFont("monospace-block"); + if (monospaceBlock) { + if (typeof monospaceBlock === "string") { + monospaceBlock = { family: monospaceBlock }; + } + } if (monospace || monospaceBlock) { typography["monospace-block"] = { ...(monospace ?? {}), diff --git a/src/core/sass/brand.ts b/src/core/sass/brand.ts index 34e268d643..59fe9083b1 100644 --- a/src/core/sass/brand.ts +++ b/src/core/sass/brand.ts @@ -285,9 +285,11 @@ const brandTypographyBundle = ( const resolveHTMLFontInformation = ( kind: FontKind, ): HTMLFontInformation | undefined => { - const resolvedFontOptions = brand.data.typography?.[kind]; + let resolvedFontOptions = brand.data.typography?.[kind]; if (!resolvedFontOptions) { return undefined; + } else if (typeof resolvedFontOptions === "string") { + resolvedFontOptions = { family: resolvedFontOptions }; } const family = resolvedFontOptions.family; const font = getFontFamilies(family); diff --git a/src/resources/editor/tools/vs-code.mjs b/src/resources/editor/tools/vs-code.mjs index 6d69882aee..62db72ef7b 100644 --- a/src/resources/editor/tools/vs-code.mjs +++ b/src/resources/editor/tools/vs-code.mjs @@ -11879,6 +11879,27 @@ var require_yaml_intelligence_resources = __commonJS({ } ] }, + { + id: "brand-logo-resource", + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + path: "path", + alt: { + schema: "string", + description: "Alternative text for the logo, used for accessibility.\n" + } + }, + required: [ + "path" + ] + } + } + ] + }, { id: "brand-logo", description: "Provide definitions and defaults for brand's logo in various formats and sizes.\n", @@ -11889,7 +11910,9 @@ var require_yaml_intelligence_resources = __commonJS({ schema: { object: { additionalProperties: { - schema: "string" + schema: { + ref: "brand-logo-resource" + } } } } @@ -12078,7 +12101,6 @@ var require_yaml_intelligence_resources = __commonJS({ "danger", "light", "dark", - "emphasis", "link" ] }, @@ -21755,6 +21777,11 @@ var require_yaml_intelligence_resources = __commonJS({ "The font weights to include.", "The font styles to include.", "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use.", + "A system font definition.", + "The font family name, which must match the name of the font on the\nfoundry website.", + "The font weights to include.", + "The font styles to include.", + "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use.", "A font definition from Google Fonts.", "The font family name, which must match the name of the font on the\nfoundry website.", "The font weights to include.", @@ -23824,11 +23851,7 @@ var require_yaml_intelligence_resources = __commonJS({ "Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).", "Manuscript configuration", "internal-schema-hack", - "A system font definition.", - "The font family name, which must match the name of the font on the\nfoundry website.", - "The font weights to include.", - "The font styles to include.", - "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use." + "Alternative text for the logo, used for accessibility." ], "schema/external-schemas.yml": [ { @@ -24057,12 +24080,12 @@ var require_yaml_intelligence_resources = __commonJS({ mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190379, + _internalId: 190435, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190371, + _internalId: 190427, type: "enum", enum: [ "png", @@ -24078,7 +24101,7 @@ var require_yaml_intelligence_resources = __commonJS({ exhaustiveCompletions: true }, theme: { - _internalId: 190378, + _internalId: 190434, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/web-worker.js b/src/resources/editor/tools/yaml/web-worker.js index 6262f8a361..6dfa823ebe 100644 --- a/src/resources/editor/tools/yaml/web-worker.js +++ b/src/resources/editor/tools/yaml/web-worker.js @@ -11880,6 +11880,27 @@ try { } ] }, + { + id: "brand-logo-resource", + anyOf: [ + "string", + { + object: { + closed: true, + properties: { + path: "path", + alt: { + schema: "string", + description: "Alternative text for the logo, used for accessibility.\n" + } + }, + required: [ + "path" + ] + } + } + ] + }, { id: "brand-logo", description: "Provide definitions and defaults for brand's logo in various formats and sizes.\n", @@ -11890,7 +11911,9 @@ try { schema: { object: { additionalProperties: { - schema: "string" + schema: { + ref: "brand-logo-resource" + } } } } @@ -12079,7 +12102,6 @@ try { "danger", "light", "dark", - "emphasis", "link" ] }, @@ -21756,6 +21778,11 @@ try { "The font weights to include.", "The font styles to include.", "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use.", + "A system font definition.", + "The font family name, which must match the name of the font on the\nfoundry website.", + "The font weights to include.", + "The font styles to include.", + "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use.", "A font definition from Google Fonts.", "The font family name, which must match the name of the font on the\nfoundry website.", "The font weights to include.", @@ -23825,11 +23852,7 @@ try { "Disambiguating year suffix in author-date styles (e.g. \u201Ca\u201D in \u201CDoe,\n1999a\u201D).", "Manuscript configuration", "internal-schema-hack", - "A system font definition.", - "The font family name, which must match the name of the font on the\nfoundry website.", - "The font weights to include.", - "The font styles to include.", - "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use." + "Alternative text for the logo, used for accessibility." ], "schema/external-schemas.yml": [ { @@ -24058,12 +24081,12 @@ try { mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190379, + _internalId: 190435, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190371, + _internalId: 190427, type: "enum", enum: [ "png", @@ -24079,7 +24102,7 @@ try { exhaustiveCompletions: true }, theme: { - _internalId: 190378, + _internalId: 190434, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json index 3448db999e..18dc84f374 100644 --- a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json +++ b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json @@ -4851,6 +4851,27 @@ } ] }, + { + "id": "brand-logo-resource", + "anyOf": [ + "string", + { + "object": { + "closed": true, + "properties": { + "path": "path", + "alt": { + "schema": "string", + "description": "Alternative text for the logo, used for accessibility.\n" + } + }, + "required": [ + "path" + ] + } + } + ] + }, { "id": "brand-logo", "description": "Provide definitions and defaults for brand's logo in various formats and sizes.\n", @@ -4861,7 +4882,9 @@ "schema": { "object": { "additionalProperties": { - "schema": "string" + "schema": { + "ref": "brand-logo-resource" + } } } } @@ -5050,7 +5073,6 @@ "danger", "light", "dark", - "emphasis", "link" ] }, @@ -14727,6 +14749,11 @@ "The font weights to include.", "The font styles to include.", "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use.", + "A system font definition.", + "The font family name, which must match the name of the font on the\nfoundry website.", + "The font weights to include.", + "The font styles to include.", + "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use.", "A font definition from Google Fonts.", "The font family name, which must match the name of the font on the\nfoundry website.", "The font weights to include.", @@ -16796,11 +16823,7 @@ "Disambiguating year suffix in author-date styles (e.g. “a” in “Doe,\n1999a”).", "Manuscript configuration", "internal-schema-hack", - "A system font definition.", - "The font family name, which must match the name of the font on the\nfoundry website.", - "The font weights to include.", - "The font styles to include.", - "The font display method, determines how a font face is font face is\nshown depending on its download status and readiness for use." + "Alternative text for the logo, used for accessibility." ], "schema/external-schemas.yml": [ { @@ -17029,12 +17052,12 @@ "mermaid": "%%" }, "handlers/mermaid/schema.yml": { - "_internalId": 190379, + "_internalId": 190435, "type": "object", "description": "be an object", "properties": { "mermaid-format": { - "_internalId": 190371, + "_internalId": 190427, "type": "enum", "enum": [ "png", @@ -17050,7 +17073,7 @@ "exhaustiveCompletions": true }, "theme": { - "_internalId": 190378, + "_internalId": 190434, "type": "anyOf", "anyOf": [ { diff --git a/src/resources/schema/definitions.yml b/src/resources/schema/definitions.yml index e5b3218ca7..c7b8291d37 100644 --- a/src/resources/schema/definitions.yml +++ b/src/resources/schema/definitions.yml @@ -2515,6 +2515,19 @@ description: > A link or path to the brand's dark-colored logo or icon. +- id: brand-logo-resource + anyOf: + - string + - object: + closed: true + properties: + path: path + alt: + schema: string + description: > + Alternative text for the logo, used for accessibility. + required: [path] + - id: brand-logo description: > Provide definitions and defaults for brand's logo in various formats and sizes. @@ -2525,8 +2538,7 @@ schema: object: additionalProperties: - schema: string - # ref: brand-string-light-dark + schema: { ref: brand-logo-resource } small: description: > A link or path to the brand's small-sized logo or icon, or a link or path @@ -2675,7 +2687,6 @@ danger, light, dark, - emphasis, link, ] diff --git a/src/resources/schema/json-schemas.json b/src/resources/schema/json-schemas.json index cd333925d7..f315e2d4ea 100644 --- a/src/resources/schema/json-schemas.json +++ b/src/resources/schema/json-schemas.json @@ -3243,6 +3243,25 @@ } ] }, + "BrandLogoResource": { + "anyOf": [ + { + "type": "string" + }, + { + "object": { + "properties": { + "path": { + "type": "string" + }, + "alt": { + "type": "string" + } + } + } + } + ] + }, "BrandLogo": { "object": { "properties": { @@ -3368,7 +3387,6 @@ "danger", "light", "dark", - "emphasis", "link" ] }, diff --git a/src/resources/types/schema-types.ts b/src/resources/types/schema-types.ts index 72b83264bf..0d1aaf7a3e 100644 --- a/src/resources/types/schema-types.ts +++ b/src/resources/types/schema-types.ts @@ -1283,8 +1283,10 @@ export type BrandMeta = { export type BrandStringLightDark = string | { dark?: string; light?: string }; +export type BrandLogoResource = string | { alt?: string; path: string }; + export type BrandLogo = { - images?: { [key: string]: string }; + images?: { [key: string]: BrandLogoResource }; large?: BrandStringLightDark; medium?: BrandStringLightDark; small?: BrandStringLightDark; @@ -1338,7 +1340,6 @@ export type BrandNamedThemeColor = | "danger" | "light" | "dark" - | "emphasis" | "link"; /* A named brand color, taken either from `color.theme` or `color.palette` (in that order). */ export type BrandTypography = { From 4fe762b922baa397434c1c2709047235dd64604b Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Thu, 10 Oct 2024 12:35:51 -0700 Subject: [PATCH 4/5] use canonical logo info --- src/core/brand/brand.ts | 116 ++++++++---------- src/format/reveal/format-reveal.ts | 2 +- src/project/types/website/website-shared.ts | 14 +-- src/resources/editor/tools/vs-code.mjs | 37 +++--- src/resources/editor/tools/yaml/web-worker.js | 37 +++--- .../yaml/yaml-intelligence-resources.json | 37 +++--- src/resources/schema/definitions.yml | 21 ++-- src/resources/schema/json-schemas.json | 23 ++-- src/resources/types/schema-types.ts | 4 +- 9 files changed, 151 insertions(+), 140 deletions(-) diff --git a/src/core/brand/brand.ts b/src/core/brand/brand.ts index 80874c76bd..afeed6a309 100644 --- a/src/core/brand/brand.ts +++ b/src/core/brand/brand.ts @@ -9,6 +9,7 @@ import { Brand as BrandJson, BrandFont, + BrandLogoExplicitResource, BrandNamedLogo, BrandNamedThemeColor, BrandStringLightDark, @@ -42,10 +43,15 @@ const defaultLogoNames: string[] = [ "large", ]; +type CanonicalLogoInfo = { + light: BrandLogoExplicitResource; + dark: BrandLogoExplicitResource; +}; + type ProcessedBrandData = { color: Record; typography: BrandTypography; - logo: Record; + logo: Record; }; export class Brand { @@ -133,15 +139,18 @@ export class Brand { }; } - const logo: Record = {}; - for (const logoName of Object.keys(data.logo?.images ?? {})) { - logo[logoName] = this.getLogo(logoName); - } - for (const logoName of Object.keys(data.logo ?? {})) { - if (logoName === "images") { - continue; + const logo: Record = {}; + for ( + const size of [ + "small", + "medium", + "large", + ] as ("small" | "medium" | "large")[] + ) { + const v = this.getLogo(size); + if (v) { + logo[size] = v; } - logo[logoName] = this.getLogo(logoName); } return { @@ -223,61 +232,42 @@ export class Brand { return fonts ?? []; } + getLogoResource(name: string): BrandLogoExplicitResource { + const entry = this.data.logo?.images?.[name]; + if (!entry) { + return { path: name }; + } + if (typeof entry === "string") { + return { path: entry }; + } + return entry; + } + // the same implementation as getColor except we can also return {light,dark} // assuming for now that with only contains strings, not {light,dark} - getLogo(name: string): BrandStringLightDark { - const seenValues = new Set(); - do { - if (seenValues.has(name)) { - throw new Error( - `Circular reference in _brand.yml color definitions: ${ - Array.from(seenValues).join( - " -> ", - ) - }`, - ); - } - seenValues.add(name); - if (this.data.logo?.images?.[name]) { - name = this.data.logo.images[name] as string; - } else if ( - defaultLogoNames.includes(name as BrandNamedLogo) && - this.data.logo?.[name as BrandNamedLogo] - ) { - const brandSLD: BrandStringLightDark = this.data - .logo[name as BrandNamedLogo]!; - if (typeof brandSLD == "string") { - name = brandSLD; - } else { - const ret: BrandStringLightDark = {}; - // we need to actually-recurse and not just use the loop - // because two paths light/dark - const light = brandSLD.light; - if (light) { - const brandSLD2 = this.getLogo(light); - if (typeof brandSLD2 == "string") { - ret.light = brandSLD2; - } else { - ret.light = brandSLD2.light; - } - } - const dark = brandSLD.dark; - if (dark) { - const brandSLD2 = this.getLogo(dark); - if (typeof brandSLD2 == "string") { - ret.dark = brandSLD2; - } else { - ret.dark = brandSLD2.light; - } - } - return ret; - } - } else { - return name; - } - } while (seenValues.size < 100); // 100 ought to be enough for anyone, with apologies to Bill Gates - throw new Error( - "Recursion depth exceeded 100 in _brand.yml logo definitions", - ); + getLogo(name: "small" | "medium" | "large"): CanonicalLogoInfo | undefined { + const entry = this.data.logo?.[name]; + if (!entry) { + return undefined; + } + if (typeof entry === "string") { + const res = this.getLogoResource(entry); + return { + light: res, + dark: res, + }; + } + const lightEntry = entry?.light + ? this.getLogoResource(entry.light) + : undefined; + const darkEntry = entry?.dark + ? this.getLogoResource(entry.dark) + : undefined; + if (lightEntry && darkEntry) { + return { + light: lightEntry, + dark: darkEntry, + }; + } } } diff --git a/src/format/reveal/format-reveal.ts b/src/format/reveal/format-reveal.ts index 8cca8875ee..596ed529f7 100644 --- a/src/format/reveal/format-reveal.ts +++ b/src/format/reveal/format-reveal.ts @@ -335,7 +335,7 @@ const determineRevealLogo = (format: Format): string | undefined => { return logoInfo; } else { // what to do about light vs dark? - return logoInfo.light ?? logoInfo.dark; + return logoInfo?.light.path ?? logoInfo?.dark.path; } } } diff --git a/src/project/types/website/website-shared.ts b/src/project/types/website/website-shared.ts index 6fff5d2196..a5e3bf35ad 100644 --- a/src/project/types/website/website-shared.ts +++ b/src/project/types/website/website-shared.ts @@ -172,10 +172,9 @@ export async function websiteNavigationConfig(project: ProjectContext) { const logo = projectBrand.processedData.logo.medium ?? projectBrand.processedData.logo.small ?? projectBrand.processedData.logo.large; - if (typeof logo === "string") { - sidebars[0].logo = logo; - } else if (typeof logo === "object") { - sidebars[0].logo = logo.light; // TODO: This needs smarts to work on light+dark themes + if (logo) { + sidebars[0].logo = logo.light.path; // TODO: This needs smarts to work on light+dark themes + sidebars[0]["logo-alt"] = logo.light.alt; } } } @@ -186,10 +185,9 @@ export async function websiteNavigationConfig(project: ProjectContext) { const logo = projectBrand.processedData.logo.small ?? projectBrand.processedData.logo.medium ?? projectBrand.processedData.logo.large; - if (typeof logo === "string") { - navbar.logo = logo; - } else if (typeof logo === "object") { - navbar.logo = logo.light; // TODO: This needs smarts to work on light+dark themes + if (logo) { + navbar.logo = logo.light.path; // TODO: This needs smarts to work on light+dark themes + navbar["logo-alt"] = logo.light.alt; } } diff --git a/src/resources/editor/tools/vs-code.mjs b/src/resources/editor/tools/vs-code.mjs index 62db72ef7b..1f7fdee55b 100644 --- a/src/resources/editor/tools/vs-code.mjs +++ b/src/resources/editor/tools/vs-code.mjs @@ -11879,24 +11879,28 @@ var require_yaml_intelligence_resources = __commonJS({ } ] }, + { + id: "brand-logo-explicit-resource", + object: { + closed: true, + properties: { + path: "path", + alt: { + schema: "string", + description: "Alternative text for the logo, used for accessibility.\n" + } + }, + required: [ + "path" + ] + } + }, { id: "brand-logo-resource", anyOf: [ "string", { - object: { - closed: true, - properties: { - path: "path", - alt: { - schema: "string", - description: "Alternative text for the logo, used for accessibility.\n" - } - }, - required: [ - "path" - ] - } + ref: "brand-logo-explicit-resource" } ] }, @@ -21728,6 +21732,7 @@ var require_yaml_intelligence_resources = __commonJS({ "The brand\u2019s Facebook URL.", "A link or path to the brand\u2019s light-colored logo or icon.", "A link or path to the brand\u2019s dark-colored logo or icon.", + "Alternative text for the logo, used for accessibility.", "Provide definitions and defaults for brand\u2019s logo in various formats\nand sizes.", "A link or path to the brand\u2019s small-sized logo or icon, or a link or\npath to both the light and dark versions.", "A link or path to the brand\u2019s medium-sized logo, or a link or path to\nboth the light and dark versions.", @@ -24080,12 +24085,12 @@ var require_yaml_intelligence_resources = __commonJS({ mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190435, + _internalId: 190453, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190427, + _internalId: 190445, type: "enum", enum: [ "png", @@ -24101,7 +24106,7 @@ var require_yaml_intelligence_resources = __commonJS({ exhaustiveCompletions: true }, theme: { - _internalId: 190434, + _internalId: 190452, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/web-worker.js b/src/resources/editor/tools/yaml/web-worker.js index 6dfa823ebe..86fac6c2a7 100644 --- a/src/resources/editor/tools/yaml/web-worker.js +++ b/src/resources/editor/tools/yaml/web-worker.js @@ -11880,24 +11880,28 @@ try { } ] }, + { + id: "brand-logo-explicit-resource", + object: { + closed: true, + properties: { + path: "path", + alt: { + schema: "string", + description: "Alternative text for the logo, used for accessibility.\n" + } + }, + required: [ + "path" + ] + } + }, { id: "brand-logo-resource", anyOf: [ "string", { - object: { - closed: true, - properties: { - path: "path", - alt: { - schema: "string", - description: "Alternative text for the logo, used for accessibility.\n" - } - }, - required: [ - "path" - ] - } + ref: "brand-logo-explicit-resource" } ] }, @@ -21729,6 +21733,7 @@ try { "The brand\u2019s Facebook URL.", "A link or path to the brand\u2019s light-colored logo or icon.", "A link or path to the brand\u2019s dark-colored logo or icon.", + "Alternative text for the logo, used for accessibility.", "Provide definitions and defaults for brand\u2019s logo in various formats\nand sizes.", "A link or path to the brand\u2019s small-sized logo or icon, or a link or\npath to both the light and dark versions.", "A link or path to the brand\u2019s medium-sized logo, or a link or path to\nboth the light and dark versions.", @@ -24081,12 +24086,12 @@ try { mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 190435, + _internalId: 190453, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 190427, + _internalId: 190445, type: "enum", enum: [ "png", @@ -24102,7 +24107,7 @@ try { exhaustiveCompletions: true }, theme: { - _internalId: 190434, + _internalId: 190452, type: "anyOf", anyOf: [ { diff --git a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json index 18dc84f374..c6a710059a 100644 --- a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json +++ b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json @@ -4851,24 +4851,28 @@ } ] }, + { + "id": "brand-logo-explicit-resource", + "object": { + "closed": true, + "properties": { + "path": "path", + "alt": { + "schema": "string", + "description": "Alternative text for the logo, used for accessibility.\n" + } + }, + "required": [ + "path" + ] + } + }, { "id": "brand-logo-resource", "anyOf": [ "string", { - "object": { - "closed": true, - "properties": { - "path": "path", - "alt": { - "schema": "string", - "description": "Alternative text for the logo, used for accessibility.\n" - } - }, - "required": [ - "path" - ] - } + "ref": "brand-logo-explicit-resource" } ] }, @@ -14700,6 +14704,7 @@ "The brand’s Facebook URL.", "A link or path to the brand’s light-colored logo or icon.", "A link or path to the brand’s dark-colored logo or icon.", + "Alternative text for the logo, used for accessibility.", "Provide definitions and defaults for brand’s logo in various formats\nand sizes.", "A link or path to the brand’s small-sized logo or icon, or a link or\npath to both the light and dark versions.", "A link or path to the brand’s medium-sized logo, or a link or path to\nboth the light and dark versions.", @@ -17052,12 +17057,12 @@ "mermaid": "%%" }, "handlers/mermaid/schema.yml": { - "_internalId": 190435, + "_internalId": 190453, "type": "object", "description": "be an object", "properties": { "mermaid-format": { - "_internalId": 190427, + "_internalId": 190445, "type": "enum", "enum": [ "png", @@ -17073,7 +17078,7 @@ "exhaustiveCompletions": true }, "theme": { - "_internalId": 190434, + "_internalId": 190452, "type": "anyOf", "anyOf": [ { diff --git a/src/resources/schema/definitions.yml b/src/resources/schema/definitions.yml index c7b8291d37..fa5705b408 100644 --- a/src/resources/schema/definitions.yml +++ b/src/resources/schema/definitions.yml @@ -2515,18 +2515,21 @@ description: > A link or path to the brand's dark-colored logo or icon. +- id: brand-logo-explicit-resource + object: + closed: true + properties: + path: path + alt: + schema: string + description: > + Alternative text for the logo, used for accessibility. + required: [path] + - id: brand-logo-resource anyOf: - string - - object: - closed: true - properties: - path: path - alt: - schema: string - description: > - Alternative text for the logo, used for accessibility. - required: [path] + - ref: brand-logo-explicit-resource - id: brand-logo description: > diff --git a/src/resources/schema/json-schemas.json b/src/resources/schema/json-schemas.json index f315e2d4ea..7c895d22d8 100644 --- a/src/resources/schema/json-schemas.json +++ b/src/resources/schema/json-schemas.json @@ -3243,22 +3243,25 @@ } ] }, + "BrandLogoExplicitResource": { + "object": { + "properties": { + "path": { + "type": "string" + }, + "alt": { + "type": "string" + } + } + } + }, "BrandLogoResource": { "anyOf": [ { "type": "string" }, { - "object": { - "properties": { - "path": { - "type": "string" - }, - "alt": { - "type": "string" - } - } - } + "$ref": "#/$defs/BrandLogoExplicitResource" } ] }, diff --git a/src/resources/types/schema-types.ts b/src/resources/types/schema-types.ts index 0d1aaf7a3e..4c215554df 100644 --- a/src/resources/types/schema-types.ts +++ b/src/resources/types/schema-types.ts @@ -1283,7 +1283,9 @@ export type BrandMeta = { export type BrandStringLightDark = string | { dark?: string; light?: string }; -export type BrandLogoResource = string | { alt?: string; path: string }; +export type BrandLogoExplicitResource = { alt?: string; path: string }; + +export type BrandLogoResource = string | BrandLogoExplicitResource; export type BrandLogo = { images?: { [key: string]: BrandLogoResource }; From b2d4797701ed4928df1e66a796e093e02109072a Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Fri, 11 Oct 2024 13:26:38 -0400 Subject: [PATCH 5/5] update typst for final schema, add image.alt --- src/resources/filters/modules/brand/brand.lua | 1 - .../filters/quarto-post/typst-brand-yaml.lua | 38 +++++++++---------- .../typst/brand-yaml/logo/posit/_brand.yml | 10 ++--- .../brand-yaml/logo/posit/brand-logo.qmd | 2 +- .../typst/brand-yaml/logo/quarto/_brand.yml | 4 +- 5 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/resources/filters/modules/brand/brand.lua b/src/resources/filters/modules/brand/brand.lua index f46a597974..83109abed9 100644 --- a/src/resources/filters/modules/brand/brand.lua +++ b/src/resources/filters/modules/brand/brand.lua @@ -56,7 +56,6 @@ local function get_logo(name) local brand = param("brand") brand = brand and brand.processedData -- from src/core/brand/brand.ts if not brand then return nil end - -- todo convert logo options from CSS to Typst return brand.logo and brand.logo[name] end diff --git a/src/resources/filters/quarto-post/typst-brand-yaml.lua b/src/resources/filters/quarto-post/typst-brand-yaml.lua index 794358ec6f..52b6176403 100644 --- a/src/resources/filters/quarto-post/typst-brand-yaml.lua +++ b/src/resources/filters/quarto-post/typst-brand-yaml.lua @@ -216,44 +216,42 @@ function render_typst_brand_yaml() -- logo local logo = param('logo') local logoOptions = {} - local foundSrc = null + local foundLogo = null if logo then if type(logo) == 'string' then - foundSrc = _quarto.modules.brand.get_logo(logo) or logo + foundLogo = _quarto.modules.brand.get_logo(logo) or {light={path=logo}} elseif type(logo) == 'table' then for k, v in pairs(logo) do logoOptions[k] = v end - if logo.src then - foundSrc = _quarto.modules.brand.get_logo(logo.src) or logo.src + if logo.path then + foundLogo = _quarto.modules.brand.get_logo(logo.path) or {light={path=logo}} end end end - if not foundSrc and brand.processedData.logo then + if not foundLogo and brand.processedData.logo then local tries = {'large', 'small', 'medium'} -- low to high priority - for _, try in ipairs(tries) do - local src = _quarto.modules.brand.get_logo(try) - if src then - foundSrc = src - end - end + foundLogo = _quarto.modules.brand.get_logo('medium') + or _quarto.modules.brand.get_logo('small') + or _quarto.modules.brand.get_logo('large') end - if foundSrc then - if type(foundSrc) == "string" then - logoOptions.src = foundSrc - elseif foundSrc.light then - logoOptions.src = foundSrc.light - elseif foundSrc.dark then - logoOptions.src = foundSrc.dark + if foundLogo then + if foundLogo.light then + logoOptions.path = foundLogo.light.path + logoOptions.alt = foundLogo.light.alt + elseif foundLogo.dark then + logoOptions.path = foundLogo.dark.path + logoOptions.alt = foundLogo.dark.alt end - -- todo: resolve logoOptions.src path + -- todo: path relative to brand.yaml logoOptions.padding = _quarto.modules.typst.css.translate_length(logoOptions.padding or '0.5in') logoOptions.width = _quarto.modules.typst.css.translate_length(logoOptions.width or '2in') logoOptions.location = logoOptions.location and location_to_typst_align(logoOptions.location) or 'left+top' quarto.log.debug('logo options', logoOptions) + local altProp = logoOptions.alt and (', alt: "' .. logoOptions.alt .. '"') or '' quarto.doc.include_text('in-header', - '#set page(background: align(' .. logoOptions.location .. ', box(inset: ' .. logoOptions.padding .. ', image("' .. logoOptions.src .. '", width: ' .. logoOptions.width .. '))))') + '#set page(background: align(' .. logoOptions.location .. ', box(inset: ' .. logoOptions.padding .. ', image("' .. logoOptions.path .. '", width: ' .. logoOptions.width .. altProp .. '))))') end end end, diff --git a/tests/docs/smoke-all/typst/brand-yaml/logo/posit/_brand.yml b/tests/docs/smoke-all/typst/brand-yaml/logo/posit/_brand.yml index 2f88d5e56d..f7b1ca8516 100644 --- a/tests/docs/smoke-all/typst/brand-yaml/logo/posit/_brand.yml +++ b/tests/docs/smoke-all/typst/brand-yaml/logo/posit/_brand.yml @@ -1,12 +1,10 @@ logo: images: + posit-logo-light-medium: + path: posit-logo-2024.svg + alt: Posit Logo brand-typst-with-good-padding: good-padding.png - - small: posit-icon.png - medium: - light: posit-logo-2024.svg - dark: posit-reverse.png - large: posit-logo-2024.svg + medium: posit-logo-light-medium defaults: quarto: format: diff --git a/tests/docs/smoke-all/typst/brand-yaml/logo/posit/brand-logo.qmd b/tests/docs/smoke-all/typst/brand-yaml/logo/posit/brand-logo.qmd index 481853c914..01ee6823db 100644 --- a/tests/docs/smoke-all/typst/brand-yaml/logo/posit/brand-logo.qmd +++ b/tests/docs/smoke-all/typst/brand-yaml/logo/posit/brand-logo.qmd @@ -9,7 +9,7 @@ _quarto: typst: ensureTypstFileRegexMatches: - - - '#set page\(background: align\(left\+top, box\(inset: 0.5in, image\("posit-logo-2024.svg", width: 2in\)\)\)\)' + - '#set page\(background: align\(left\+top, box\(inset: 0.5in, image\("posit-logo-2024.svg", width: 2in, alt: "Posit Logo"\)\)\)\)' - [] --- diff --git a/tests/docs/smoke-all/typst/brand-yaml/logo/quarto/_brand.yml b/tests/docs/smoke-all/typst/brand-yaml/logo/quarto/_brand.yml index 09258765f9..20a0a3456e 100644 --- a/tests/docs/smoke-all/typst/brand-yaml/logo/quarto/_brand.yml +++ b/tests/docs/smoke-all/typst/brand-yaml/logo/quarto/_brand.yml @@ -1,5 +1,7 @@ logo: - large: quarto.png + images: + large-light: quarto.png + large: large-light defaults: quarto: format: