diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2601677b..d0ab6645 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.0" + ".": "1.2.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7aefc872..a0614e16 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml -openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-56a21db16ac3a797f86daca01a2ea115a0365db4b2f9d8accdec4f4d3ee2eb83.yml +openapi_spec_hash: bfcef090896da96023c4485a3d69e350 config_hash: 38268bb88fc4dcbb8f2f94dd138b5910 diff --git a/CHANGELOG.md b/CHANGELOG.md index dccc7cf1..ec0f68af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 1.2.0 (2026-04-03) + +Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.1.0...v1.2.0) + +### Features + +* **api:** api update ([5f00bc0](https://github.com/context-dot-dev/context-ruby-sdk/commit/5f00bc076f0081065bc274ce9f28cd26a7daa944)) + + +### Bug Fixes + +* align path encoding with RFC 3986 section 3.3 ([2c4072d](https://github.com/context-dot-dev/context-ruby-sdk/commit/2c4072df7df531933f5352c611183b1d152e3ec2)) +* variable name typo ([10e1853](https://github.com/context-dot-dev/context-ruby-sdk/commit/10e185365b3196732fc5e0649975ab696f80e893)) + ## 1.1.0 (2026-03-28) Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.0.0...v1.1.0) diff --git a/Gemfile.lock b/Gemfile.lock index b79b6f0c..56504d77 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (1.1.0) + context.dev (1.2.0) cgi connection_pool diff --git a/README.md b/README.md index 6928affc..e82cc712 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "context.dev", "~> 1.1.0" +gem "context.dev", "~> 1.2.0" ``` diff --git a/lib/context_dev/internal/util.rb b/lib/context_dev/internal/util.rb index bee1bf0e..edb11891 100644 --- a/lib/context_dev/internal/util.rb +++ b/lib/context_dev/internal/util.rb @@ -157,7 +157,7 @@ def coerce_hash!(input) in Hash | nil => coerced coerced else - message = "Expected a #{Hash} or #{ContextDev::Internal::Type::BaseModel}, got #{data.inspect}" + message = "Expected a #{Hash} or #{ContextDev::Internal::Type::BaseModel}, got #{input.inspect}" raise ArgumentError.new(message) end end @@ -237,6 +237,11 @@ def dig(data, pick, &blk) end end + # @type [Regexp] + # + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/ + class << self # @api private # @@ -247,6 +252,15 @@ def uri_origin(uri) "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" end + # @api private + # + # @param path [String, Integer] + # + # @return [String] + def encode_path(path) + path.to_s.gsub(ContextDev::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) } + end + # @api private # # @param path [String, Array] @@ -259,7 +273,7 @@ def interpolate_path(path) in [] "" in [String => p, *interpolations] - encoded = interpolations.map { ERB::Util.url_encode(_1) } + encoded = interpolations.map { encode_path(_1) } format(p, *encoded) end end @@ -576,10 +590,10 @@ def encode_query_params(query) case val in ContextDev::FilePart unless val.filename.nil? - filename = ERB::Util.url_encode(val.filename) + filename = encode_path(val.filename) y << "; filename=\"#{filename}\"" in Pathname | IO - filename = ERB::Util.url_encode(::File.basename(val.to_path)) + filename = encode_path(::File.basename(val.to_path)) y << "; filename=\"#{filename}\"" else end diff --git a/lib/context_dev/models/style_extract_styleguide_params.rb b/lib/context_dev/models/style_extract_styleguide_params.rb index 82c93ac5..ec82e7ef 100644 --- a/lib/context_dev/models/style_extract_styleguide_params.rb +++ b/lib/context_dev/models/style_extract_styleguide_params.rb @@ -21,15 +21,6 @@ class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :domain, String - # @!attribute prioritize - # Optional parameter to prioritize screenshot capture for styleguide extraction. - # If 'speed', optimizes for faster capture with basic quality. If 'quality', - # optimizes for higher quality with longer wait times. Defaults to 'quality' if - # not provided. - # - # @return [Symbol, ContextDev::Models::StyleExtractStyleguideParams::Prioritize, nil] - optional :prioritize, enum: -> { ContextDev::StyleExtractStyleguideParams::Prioritize } - # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -38,7 +29,7 @@ class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(direct_url: nil, domain: nil, prioritize: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::StyleExtractStyleguideParams} for more details. # @@ -46,25 +37,9 @@ class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The # - # @param prioritize [Symbol, ContextDev::Models::StyleExtractStyleguideParams::Prioritize] Optional parameter to prioritize screenshot capture for styleguide extraction. I - # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - - # Optional parameter to prioritize screenshot capture for styleguide extraction. - # If 'speed', optimizes for faster capture with basic quality. If 'quality', - # optimizes for higher quality with longer wait times. Defaults to 'quality' if - # not provided. - module Prioritize - extend ContextDev::Internal::Type::Enum - - SPEED = :speed - QUALITY = :quality - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/context_dev/models/style_extract_styleguide_response.rb b/lib/context_dev/models/style_extract_styleguide_response.rb index 057ed40a..72ef6390 100644 --- a/lib/context_dev/models/style_extract_styleguide_response.rb +++ b/lib/context_dev/models/style_extract_styleguide_response.rb @@ -42,42 +42,42 @@ class Styleguide < ContextDev::Internal::Type::BaseModel # @!attribute colors # Primary colors used on the website # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, nil] - optional :colors, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors } + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors] + required :colors, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors } # @!attribute components # UI component styles # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, nil] - optional :components, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components } + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components] + required :components, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components } # @!attribute element_spacing # Spacing system used on the website # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, nil] - optional :element_spacing, + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing] + required :element_spacing, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing }, api_name: :elementSpacing # @!attribute mode # The primary color mode of the website design # - # @return [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode, nil] - optional :mode, enum: -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode } + # @return [Symbol, ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode] + required :mode, enum: -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode } # @!attribute shadows # Shadow styles used on the website # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, nil] - optional :shadows, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows } + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows] + required :shadows, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows } # @!attribute typography # Typography styles used on the website # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography, nil] - optional :typography, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography } + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography] + required :typography, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography } - # @!method initialize(colors: nil, components: nil, element_spacing: nil, mode: nil, shadows: nil, typography: nil) + # @!method initialize(colors:, components:, element_spacing:, mode:, shadows:, typography:) # Comprehensive styleguide data extracted from the website # # @param colors [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors] Primary colors used on the website @@ -95,31 +95,31 @@ class Styleguide < ContextDev::Internal::Type::BaseModel # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#colors class Colors < ContextDev::Internal::Type::BaseModel # @!attribute accent - # Accent color of the website (hex format) + # Accent color (hex format) # - # @return [String, nil] - optional :accent, String + # @return [String] + required :accent, String # @!attribute background - # Background color of the website (hex format) + # Background color (hex format) # - # @return [String, nil] - optional :background, String + # @return [String] + required :background, String # @!attribute text - # Text color of the website (hex format) + # Text color (hex format) # - # @return [String, nil] - optional :text, String + # @return [String] + required :text, String - # @!method initialize(accent: nil, background: nil, text: nil) + # @!method initialize(accent:, background:, text:) # Primary colors used on the website # - # @param accent [String] Accent color of the website (hex format) + # @param accent [String] Accent color (hex format) # - # @param background [String] Background color of the website (hex format) + # @param background [String] Background color (hex format) # - # @param text [String] Text color of the website (hex format) + # @param text [String] Text color (hex format) end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#components @@ -127,8 +127,8 @@ class Components < ContextDev::Internal::Type::BaseModel # @!attribute button # Button component styles # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, nil] - optional :button, + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button] + required :button, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button } # @!attribute card @@ -137,7 +137,7 @@ class Components < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card, nil] optional :card, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card } - # @!method initialize(button: nil, card: nil) + # @!method initialize(button:, card: nil) # UI component styles # # @param button [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button] Button component styles @@ -147,21 +147,18 @@ class Components < ContextDev::Internal::Type::BaseModel # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components#button class Button < ContextDev::Internal::Type::BaseModel # @!attribute link - # Link button style # # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link, nil] optional :link, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link } # @!attribute primary - # Primary button style # # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary, nil] optional :primary, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary } # @!attribute secondary - # Secondary button style # # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary, nil] optional :secondary, @@ -170,229 +167,416 @@ class Button < ContextDev::Internal::Type::BaseModel # @!method initialize(link: nil, primary: nil, secondary: nil) # Button component styles # - # @param link [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link] Link button style - # - # @param primary [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary] Primary button style - # - # @param secondary [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary] Secondary button style + # @param link [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link] + # @param primary [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary] + # @param secondary [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary] # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button#link class Link < ContextDev::Internal::Type::BaseModel # @!attribute background_color # - # @return [String, nil] - optional :background_color, String, api_name: :backgroundColor + # @return [String] + required :background_color, String, api_name: :backgroundColor # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) # - # @return [String, nil] - optional :border_color, String, api_name: :borderColor + # @return [String] + required :border_color, String, api_name: :borderColor # @!attribute border_radius # - # @return [String, nil] - optional :border_radius, String, api_name: :borderRadius + # @return [String] + required :border_radius, String, api_name: :borderRadius # @!attribute border_style # - # @return [String, nil] - optional :border_style, String, api_name: :borderStyle + # @return [String] + required :border_style, String, api_name: :borderStyle # @!attribute border_width # - # @return [String, nil] - optional :border_width, String, api_name: :borderWidth + # @return [String] + required :border_width, String, api_name: :borderWidth # @!attribute box_shadow + # Computed box-shadow (comma-separated layers when present) # - # @return [String, nil] - optional :box_shadow, String, api_name: :boxShadow + # @return [String] + required :box_shadow, String, api_name: :boxShadow # @!attribute color # - # @return [String, nil] - optional :color, String + # @return [String] + required :color, String + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute min_height + # Sampled minimum height of the button box (typically px) + # + # @return [String] + required :min_height, String, api_name: :minHeight + + # @!attribute min_width + # Sampled minimum width of the button box (typically px) + # + # @return [String] + required :min_width, String, api_name: :minWidth # @!attribute padding # - # @return [String, nil] - optional :padding, String + # @return [String] + required :padding, String # @!attribute text_decoration # + # @return [String] + required :text_decoration, String, api_name: :textDecoration + + # @!attribute font_fallbacks + # Full ordered font list from computed font-family + # + # @return [Array, nil] + optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary button typeface (first in fontFallbacks) + # # @return [String, nil] - optional :text_decoration, String, api_name: :textDecoration + optional :font_family, String, api_name: :fontFamily - # @!method initialize(background_color: nil, border_color: nil, border_radius: nil, border_style: nil, border_width: nil, box_shadow: nil, color: nil, font_size: nil, font_weight: nil, padding: nil, text_decoration: nil) - # Link button style + # @!attribute text_decoration_color + # Hex color of the underline when it differs from the text color + # + # @return [String, nil] + optional :text_decoration_color, String, api_name: :textDecorationColor + + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Link} + # for more details. # # @param background_color [String] - # @param border_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # # @param border_radius [String] + # # @param border_style [String] + # # @param border_width [String] - # @param box_shadow [String] + # + # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) + # # @param color [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # # @param font_size [String] + # # @param font_weight [Float] + # + # @param min_height [String] Sampled minimum height of the button box (typically px) + # + # @param min_width [String] Sampled minimum width of the button box (typically px) + # # @param padding [String] + # # @param text_decoration [String] + # + # @param font_fallbacks [Array] Full ordered font list from computed font-family + # + # @param font_family [String] Primary button typeface (first in fontFallbacks) + # + # @param text_decoration_color [String] Hex color of the underline when it differs from the text color end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button#primary class Primary < ContextDev::Internal::Type::BaseModel # @!attribute background_color # - # @return [String, nil] - optional :background_color, String, api_name: :backgroundColor + # @return [String] + required :background_color, String, api_name: :backgroundColor # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) # - # @return [String, nil] - optional :border_color, String, api_name: :borderColor + # @return [String] + required :border_color, String, api_name: :borderColor # @!attribute border_radius # - # @return [String, nil] - optional :border_radius, String, api_name: :borderRadius + # @return [String] + required :border_radius, String, api_name: :borderRadius # @!attribute border_style # - # @return [String, nil] - optional :border_style, String, api_name: :borderStyle + # @return [String] + required :border_style, String, api_name: :borderStyle # @!attribute border_width # - # @return [String, nil] - optional :border_width, String, api_name: :borderWidth + # @return [String] + required :border_width, String, api_name: :borderWidth # @!attribute box_shadow + # Computed box-shadow (comma-separated layers when present) # - # @return [String, nil] - optional :box_shadow, String, api_name: :boxShadow + # @return [String] + required :box_shadow, String, api_name: :boxShadow # @!attribute color # - # @return [String, nil] - optional :color, String + # @return [String] + required :color, String + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute min_height + # Sampled minimum height of the button box (typically px) + # + # @return [String] + required :min_height, String, api_name: :minHeight + + # @!attribute min_width + # Sampled minimum width of the button box (typically px) + # + # @return [String] + required :min_width, String, api_name: :minWidth # @!attribute padding # - # @return [String, nil] - optional :padding, String + # @return [String] + required :padding, String # @!attribute text_decoration # + # @return [String] + required :text_decoration, String, api_name: :textDecoration + + # @!attribute font_fallbacks + # Full ordered font list from computed font-family + # + # @return [Array, nil] + optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary button typeface (first in fontFallbacks) + # # @return [String, nil] - optional :text_decoration, String, api_name: :textDecoration + optional :font_family, String, api_name: :fontFamily + + # @!attribute text_decoration_color + # Hex color of the underline when it differs from the text color + # + # @return [String, nil] + optional :text_decoration_color, String, api_name: :textDecorationColor - # @!method initialize(background_color: nil, border_color: nil, border_radius: nil, border_style: nil, border_width: nil, box_shadow: nil, color: nil, font_size: nil, font_weight: nil, padding: nil, text_decoration: nil) - # Primary button style + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Primary} + # for more details. # # @param background_color [String] - # @param border_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # # @param border_radius [String] + # # @param border_style [String] + # # @param border_width [String] - # @param box_shadow [String] + # + # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) + # # @param color [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # # @param font_size [String] + # # @param font_weight [Float] + # + # @param min_height [String] Sampled minimum height of the button box (typically px) + # + # @param min_width [String] Sampled minimum width of the button box (typically px) + # # @param padding [String] + # # @param text_decoration [String] + # + # @param font_fallbacks [Array] Full ordered font list from computed font-family + # + # @param font_family [String] Primary button typeface (first in fontFallbacks) + # + # @param text_decoration_color [String] Hex color of the underline when it differs from the text color end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button#secondary class Secondary < ContextDev::Internal::Type::BaseModel # @!attribute background_color # - # @return [String, nil] - optional :background_color, String, api_name: :backgroundColor + # @return [String] + required :background_color, String, api_name: :backgroundColor # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) # - # @return [String, nil] - optional :border_color, String, api_name: :borderColor + # @return [String] + required :border_color, String, api_name: :borderColor # @!attribute border_radius # - # @return [String, nil] - optional :border_radius, String, api_name: :borderRadius + # @return [String] + required :border_radius, String, api_name: :borderRadius # @!attribute border_style # - # @return [String, nil] - optional :border_style, String, api_name: :borderStyle + # @return [String] + required :border_style, String, api_name: :borderStyle # @!attribute border_width # - # @return [String, nil] - optional :border_width, String, api_name: :borderWidth + # @return [String] + required :border_width, String, api_name: :borderWidth # @!attribute box_shadow + # Computed box-shadow (comma-separated layers when present) # - # @return [String, nil] - optional :box_shadow, String, api_name: :boxShadow + # @return [String] + required :box_shadow, String, api_name: :boxShadow # @!attribute color # - # @return [String, nil] - optional :color, String + # @return [String] + required :color, String + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight + + # @!attribute min_height + # Sampled minimum height of the button box (typically px) + # + # @return [String] + required :min_height, String, api_name: :minHeight + + # @!attribute min_width + # Sampled minimum width of the button box (typically px) + # + # @return [String] + required :min_width, String, api_name: :minWidth # @!attribute padding # - # @return [String, nil] - optional :padding, String + # @return [String] + required :padding, String # @!attribute text_decoration # + # @return [String] + required :text_decoration, String, api_name: :textDecoration + + # @!attribute font_fallbacks + # Full ordered font list from computed font-family + # + # @return [Array, nil] + optional :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + + # @!attribute font_family + # Primary button typeface (first in fontFallbacks) + # # @return [String, nil] - optional :text_decoration, String, api_name: :textDecoration + optional :font_family, String, api_name: :fontFamily - # @!method initialize(background_color: nil, border_color: nil, border_radius: nil, border_style: nil, border_width: nil, box_shadow: nil, color: nil, font_size: nil, font_weight: nil, padding: nil, text_decoration: nil) - # Secondary button style + # @!attribute text_decoration_color + # Hex color of the underline when it differs from the text color + # + # @return [String, nil] + optional :text_decoration_color, String, api_name: :textDecorationColor + + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, color:, css:, font_size:, font_weight:, min_height:, min_width:, padding:, text_decoration:, font_fallbacks: nil, font_family: nil, text_decoration_color: nil) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary} + # for more details. # # @param background_color [String] - # @param border_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # # @param border_radius [String] + # # @param border_style [String] + # # @param border_width [String] - # @param box_shadow [String] + # + # @param box_shadow [String] Computed box-shadow (comma-separated layers when present) + # # @param color [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # # @param font_size [String] + # # @param font_weight [Float] + # + # @param min_height [String] Sampled minimum height of the button box (typically px) + # + # @param min_width [String] Sampled minimum width of the button box (typically px) + # # @param padding [String] + # # @param text_decoration [String] + # + # @param font_fallbacks [Array] Full ordered font list from computed font-family + # + # @param font_family [String] Primary button typeface (first in fontFallbacks) + # + # @param text_decoration_color [String] Hex color of the underline when it differs from the text color end end @@ -400,54 +584,75 @@ class Secondary < ContextDev::Internal::Type::BaseModel class Card < ContextDev::Internal::Type::BaseModel # @!attribute background_color # - # @return [String, nil] - optional :background_color, String, api_name: :backgroundColor + # @return [String] + required :background_color, String, api_name: :backgroundColor # @!attribute border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) # - # @return [String, nil] - optional :border_color, String, api_name: :borderColor + # @return [String] + required :border_color, String, api_name: :borderColor # @!attribute border_radius # - # @return [String, nil] - optional :border_radius, String, api_name: :borderRadius + # @return [String] + required :border_radius, String, api_name: :borderRadius # @!attribute border_style # - # @return [String, nil] - optional :border_style, String, api_name: :borderStyle + # @return [String] + required :border_style, String, api_name: :borderStyle # @!attribute border_width # - # @return [String, nil] - optional :border_width, String, api_name: :borderWidth + # @return [String] + required :border_width, String, api_name: :borderWidth # @!attribute box_shadow # - # @return [String, nil] - optional :box_shadow, String, api_name: :boxShadow + # @return [String] + required :box_shadow, String, api_name: :boxShadow + + # @!attribute css + # Ready-to-use CSS declaration block for this component style + # + # @return [String] + required :css, String # @!attribute padding # - # @return [String, nil] - optional :padding, String + # @return [String] + required :padding, String # @!attribute text_color # - # @return [String, nil] - optional :text_color, String, api_name: :textColor + # @return [String] + required :text_color, String, api_name: :textColor - # @!method initialize(background_color: nil, border_color: nil, border_radius: nil, border_style: nil, border_width: nil, box_shadow: nil, padding: nil, text_color: nil) + # @!method initialize(background_color:, border_color:, border_radius:, border_style:, border_width:, box_shadow:, css:, padding:, text_color:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card} + # for more details. + # # Card component style # # @param background_color [String] - # @param border_color [String] + # + # @param border_color [String] Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alp + # # @param border_radius [String] + # # @param border_style [String] + # # @param border_width [String] + # # @param box_shadow [String] + # + # @param css [String] Ready-to-use CSS declaration block for this component style + # # @param padding [String] + # # @param text_color [String] end end @@ -455,47 +660,38 @@ class Card < ContextDev::Internal::Type::BaseModel # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#element_spacing class ElementSpacing < ContextDev::Internal::Type::BaseModel # @!attribute lg - # Large spacing value # - # @return [String, nil] - optional :lg, String + # @return [String] + required :lg, String # @!attribute md - # Medium spacing value # - # @return [String, nil] - optional :md, String + # @return [String] + required :md, String # @!attribute sm - # Small spacing value # - # @return [String, nil] - optional :sm, String + # @return [String] + required :sm, String # @!attribute xl - # Extra large spacing value # - # @return [String, nil] - optional :xl, String + # @return [String] + required :xl, String # @!attribute xs - # Extra small spacing value # - # @return [String, nil] - optional :xs, String + # @return [String] + required :xs, String - # @!method initialize(lg: nil, md: nil, sm: nil, xl: nil, xs: nil) + # @!method initialize(lg:, md:, sm:, xl:, xs:) # Spacing system used on the website # - # @param lg [String] Large spacing value - # - # @param md [String] Medium spacing value - # - # @param sm [String] Small spacing value - # - # @param xl [String] Extra large spacing value - # - # @param xs [String] Extra small spacing value + # @param lg [String] + # @param md [String] + # @param sm [String] + # @param xl [String] + # @param xs [String] end # The primary color mode of the website design @@ -514,47 +710,38 @@ module Mode # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#shadows class Shadows < ContextDev::Internal::Type::BaseModel # @!attribute inner - # Inner shadow value # - # @return [String, nil] - optional :inner, String + # @return [String] + required :inner, String # @!attribute lg - # Large shadow value # - # @return [String, nil] - optional :lg, String + # @return [String] + required :lg, String # @!attribute md - # Medium shadow value # - # @return [String, nil] - optional :md, String + # @return [String] + required :md, String # @!attribute sm - # Small shadow value # - # @return [String, nil] - optional :sm, String + # @return [String] + required :sm, String # @!attribute xl - # Extra large shadow value # - # @return [String, nil] - optional :xl, String + # @return [String] + required :xl, String - # @!method initialize(inner: nil, lg: nil, md: nil, sm: nil, xl: nil) + # @!method initialize(inner:, lg:, md:, sm:, xl:) # Shadow styles used on the website # - # @param inner [String] Inner shadow value - # - # @param lg [String] Large shadow value - # - # @param md [String] Medium shadow value - # - # @param sm [String] Small shadow value - # - # @param xl [String] Extra large shadow value + # @param inner [String] + # @param lg [String] + # @param md [String] + # @param sm [String] + # @param xl [String] end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide#typography @@ -562,24 +749,23 @@ class Typography < ContextDev::Internal::Type::BaseModel # @!attribute headings # Heading styles # - # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, nil] - optional :headings, + # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings] + required :headings, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings } # @!attribute p_ - # Paragraph text styles # # @return [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P, nil] optional :p_, -> { ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P }, api_name: :p - # @!method initialize(headings: nil, p_: nil) + # @!method initialize(headings:, p_: nil) # Typography styles used on the website # # @param headings [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings] Heading styles # - # @param p_ [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P] Paragraph text styles + # @param p_ [ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P] # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography#headings class Headings < ContextDev::Internal::Type::BaseModel @@ -617,179 +803,242 @@ class Headings < ContextDev::Internal::Type::BaseModel # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h1 class H1 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + # @!attribute font_family + # Primary face (first family in the computed stack) # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily + # @return [String] + required :font_family, String, api_name: :fontFamily # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight # @!attribute letter_spacing # - # @return [String, nil] - optional :letter_spacing, String, api_name: :letterSpacing + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing # @!attribute line_height # - # @return [String, nil] - optional :line_height, String, api_name: :lineHeight + # @return [String] + required :line_height, String, api_name: :lineHeight - # @!method initialize(font_family: nil, font_size: nil, font_weight: nil, letter_spacing: nil, line_height: nil) - # @param font_family [String] + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # # @param font_size [String] + # # @param font_weight [Float] + # # @param letter_spacing [String] + # # @param line_height [String] end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h2 class H2 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + # @!attribute font_family + # Primary face (first family in the computed stack) # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily + # @return [String] + required :font_family, String, api_name: :fontFamily # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight # @!attribute letter_spacing # - # @return [String, nil] - optional :letter_spacing, String, api_name: :letterSpacing + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing # @!attribute line_height # - # @return [String, nil] - optional :line_height, String, api_name: :lineHeight + # @return [String] + required :line_height, String, api_name: :lineHeight - # @!method initialize(font_family: nil, font_size: nil, font_weight: nil, letter_spacing: nil, line_height: nil) - # @param font_family [String] + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # # @param font_size [String] + # # @param font_weight [Float] + # # @param letter_spacing [String] + # # @param line_height [String] end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h3 class H3 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + # @!attribute font_family + # Primary face (first family in the computed stack) # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily + # @return [String] + required :font_family, String, api_name: :fontFamily # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight # @!attribute letter_spacing # - # @return [String, nil] - optional :letter_spacing, String, api_name: :letterSpacing + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing # @!attribute line_height # - # @return [String, nil] - optional :line_height, String, api_name: :lineHeight + # @return [String] + required :line_height, String, api_name: :lineHeight - # @!method initialize(font_family: nil, font_size: nil, font_weight: nil, letter_spacing: nil, line_height: nil) - # @param font_family [String] + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # # @param font_size [String] + # # @param font_weight [Float] + # # @param letter_spacing [String] + # # @param line_height [String] end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings#h4 class H4 < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + # @!attribute font_family + # Primary face (first family in the computed stack) # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily + # @return [String] + required :font_family, String, api_name: :fontFamily # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight # @!attribute letter_spacing # - # @return [String, nil] - optional :letter_spacing, String, api_name: :letterSpacing + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing # @!attribute line_height # - # @return [String, nil] - optional :line_height, String, api_name: :lineHeight + # @return [String] + required :line_height, String, api_name: :lineHeight - # @!method initialize(font_family: nil, font_size: nil, font_weight: nil, letter_spacing: nil, line_height: nil) - # @param font_family [String] + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) + # # @param font_size [String] + # # @param font_weight [Float] + # # @param letter_spacing [String] + # # @param line_height [String] end end # @see ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography#p_ class P < ContextDev::Internal::Type::BaseModel + # @!attribute font_fallbacks + # Full ordered font list from resolved computed font-family + # + # @return [Array] + required :font_fallbacks, ContextDev::Internal::Type::ArrayOf[String], api_name: :fontFallbacks + # @!attribute font_family + # Primary face (first family in the computed stack) # - # @return [String, nil] - optional :font_family, String, api_name: :fontFamily + # @return [String] + required :font_family, String, api_name: :fontFamily # @!attribute font_size # - # @return [String, nil] - optional :font_size, String, api_name: :fontSize + # @return [String] + required :font_size, String, api_name: :fontSize # @!attribute font_weight # - # @return [Float, nil] - optional :font_weight, Float, api_name: :fontWeight + # @return [Float] + required :font_weight, Float, api_name: :fontWeight # @!attribute letter_spacing # - # @return [String, nil] - optional :letter_spacing, String, api_name: :letterSpacing + # @return [String] + required :letter_spacing, String, api_name: :letterSpacing # @!attribute line_height # - # @return [String, nil] - optional :line_height, String, api_name: :lineHeight + # @return [String] + required :line_height, String, api_name: :lineHeight - # @!method initialize(font_family: nil, font_size: nil, font_weight: nil, letter_spacing: nil, line_height: nil) - # Paragraph text styles + # @!method initialize(font_fallbacks:, font_family:, font_size:, font_weight:, letter_spacing:, line_height:) + # @param font_fallbacks [Array] Full ordered font list from resolved computed font-family + # + # @param font_family [String] Primary face (first family in the computed stack) # - # @param font_family [String] # @param font_size [String] + # # @param font_weight [Float] + # # @param letter_spacing [String] + # # @param line_height [String] end end diff --git a/lib/context_dev/resources/style.rb b/lib/context_dev/resources/style.rb index 33a2daca..364024b9 100644 --- a/lib/context_dev/resources/style.rb +++ b/lib/context_dev/resources/style.rb @@ -40,14 +40,12 @@ def extract_fonts(params) # Either 'domain' or 'directUrl' must be provided as a query parameter, but not # both. # - # @overload extract_styleguide(direct_url: nil, domain: nil, prioritize: nil, timeout_ms: nil, request_options: {}) + # @overload extract_styleguide(direct_url: nil, domain: nil, timeout_ms: nil, request_options: {}) # # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio # # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The # - # @param prioritize [Symbol, ContextDev::Models::StyleExtractStyleguideParams::Prioritize] Optional parameter to prioritize screenshot capture for styleguide extraction. I - # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index fbda78ec..103fb3e4 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "1.1.0" + VERSION = "1.2.0" end diff --git a/rbi/context_dev/internal/util.rbi b/rbi/context_dev/internal/util.rbi index a1a1b4c8..d8dc8493 100644 --- a/rbi/context_dev/internal/util.rbi +++ b/rbi/context_dev/internal/util.rbi @@ -148,12 +148,20 @@ module ContextDev end end + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp) + class << self # @api private sig { params(uri: URI::Generic).returns(String) } def uri_origin(uri) end + # @api private + sig { params(path: T.any(String, Integer)).returns(String) } + def encode_path(path) + end + # @api private sig { params(path: T.any(String, T::Array[String])).returns(String) } def interpolate_path(path) diff --git a/rbi/context_dev/models/style_extract_styleguide_params.rbi b/rbi/context_dev/models/style_extract_styleguide_params.rbi index b1243946..6b43ec8c 100644 --- a/rbi/context_dev/models/style_extract_styleguide_params.rbi +++ b/rbi/context_dev/models/style_extract_styleguide_params.rbi @@ -30,27 +30,6 @@ module ContextDev sig { params(domain: String).void } attr_writer :domain - # Optional parameter to prioritize screenshot capture for styleguide extraction. - # If 'speed', optimizes for faster capture with basic quality. If 'quality', - # optimizes for higher quality with longer wait times. Defaults to 'quality' if - # not provided. - sig do - returns( - T.nilable( - ContextDev::StyleExtractStyleguideParams::Prioritize::OrSymbol - ) - ) - end - attr_reader :prioritize - - sig do - params( - prioritize: - ContextDev::StyleExtractStyleguideParams::Prioritize::OrSymbol - ).void - end - attr_writer :prioritize - # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -64,8 +43,6 @@ module ContextDev params( direct_url: String, domain: String, - prioritize: - ContextDev::StyleExtractStyleguideParams::Prioritize::OrSymbol, timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -77,11 +54,6 @@ module ContextDev # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The # domain will be automatically normalized and validated. domain: nil, - # Optional parameter to prioritize screenshot capture for styleguide extraction. - # If 'speed', optimizes for faster capture with basic quality. If 'quality', - # optimizes for higher quality with longer wait times. Defaults to 'quality' if - # not provided. - prioritize: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -95,8 +67,6 @@ module ContextDev { direct_url: String, domain: String, - prioritize: - ContextDev::StyleExtractStyleguideParams::Prioritize::OrSymbol, timeout_ms: Integer, request_options: ContextDev::RequestOptions } @@ -104,41 +74,6 @@ module ContextDev end def to_hash end - - # Optional parameter to prioritize screenshot capture for styleguide extraction. - # If 'speed', optimizes for faster capture with basic quality. If 'quality', - # optimizes for higher quality with longer wait times. Defaults to 'quality' if - # not provided. - module Prioritize - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ContextDev::StyleExtractStyleguideParams::Prioritize) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SPEED = - T.let( - :speed, - ContextDev::StyleExtractStyleguideParams::Prioritize::TaggedSymbol - ) - QUALITY = - T.let( - :quality, - ContextDev::StyleExtractStyleguideParams::Prioritize::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::StyleExtractStyleguideParams::Prioritize::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/context_dev/models/style_extract_styleguide_response.rbi b/rbi/context_dev/models/style_extract_styleguide_response.rbi index 56c01994..3078d93b 100644 --- a/rbi/context_dev/models/style_extract_styleguide_response.rbi +++ b/rbi/context_dev/models/style_extract_styleguide_response.rbi @@ -97,9 +97,7 @@ module ContextDev # Primary colors used on the website sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors ) end attr_reader :colors @@ -115,9 +113,7 @@ module ContextDev # UI component styles sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components ) end attr_reader :components @@ -133,9 +129,7 @@ module ContextDev # Spacing system used on the website sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing ) end attr_reader :element_spacing @@ -151,27 +145,15 @@ module ContextDev # The primary color mode of the website design sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::TaggedSymbol ) end - attr_reader :mode - - sig do - params( - mode: - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Mode::OrSymbol - ).void - end - attr_writer :mode + attr_accessor :mode # Shadow styles used on the website sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows ) end attr_reader :shadows @@ -187,9 +169,7 @@ module ContextDev # Typography styles used on the website sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography ) end attr_reader :typography @@ -221,17 +201,17 @@ module ContextDev end def self.new( # Primary colors used on the website - colors: nil, + colors:, # UI component styles - components: nil, + components:, # Spacing system used on the website - element_spacing: nil, + element_spacing:, # The primary color mode of the website design - mode: nil, + mode:, # Shadow styles used on the website - shadows: nil, + shadows:, # Typography styles used on the website - typography: nil + typography: ) end @@ -265,26 +245,17 @@ module ContextDev ) end - # Accent color of the website (hex format) - sig { returns(T.nilable(String)) } - attr_reader :accent - - sig { params(accent: String).void } - attr_writer :accent + # Accent color (hex format) + sig { returns(String) } + attr_accessor :accent - # Background color of the website (hex format) - sig { returns(T.nilable(String)) } - attr_reader :background + # Background color (hex format) + sig { returns(String) } + attr_accessor :background - sig { params(background: String).void } - attr_writer :background - - # Text color of the website (hex format) - sig { returns(T.nilable(String)) } - attr_reader :text - - sig { params(text: String).void } - attr_writer :text + # Text color (hex format) + sig { returns(String) } + attr_accessor :text # Primary colors used on the website sig do @@ -293,12 +264,12 @@ module ContextDev ) end def self.new( - # Accent color of the website (hex format) - accent: nil, - # Background color of the website (hex format) - background: nil, - # Text color of the website (hex format) - text: nil + # Accent color (hex format) + accent:, + # Background color (hex format) + background:, + # Text color (hex format) + text: ) end @@ -323,9 +294,7 @@ module ContextDev # Button component styles sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button ) end attr_reader :button @@ -367,7 +336,7 @@ module ContextDev end def self.new( # Button component styles - button: nil, + button:, # Card component style card: nil ) @@ -395,7 +364,6 @@ module ContextDev ) end - # Link button style sig do returns( T.nilable( @@ -413,7 +381,6 @@ module ContextDev end attr_writer :link - # Primary button style sig do returns( T.nilable( @@ -431,7 +398,6 @@ module ContextDev end attr_writer :primary - # Secondary button style sig do returns( T.nilable( @@ -460,14 +426,7 @@ module ContextDev ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button::Secondary::OrHash ).returns(T.attached_class) end - def self.new( - # Link button style - link: nil, - # Primary button style - primary: nil, - # Secondary button style - secondary: nil - ) + def self.new(link: nil, primary: nil, secondary: nil) end sig do @@ -494,73 +453,75 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :background_color + sig { returns(String) } + attr_accessor :background_color - sig { params(background_color: String).void } - attr_writer :background_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color - sig { returns(T.nilable(String)) } - attr_reader :border_color + sig { returns(String) } + attr_accessor :border_radius - sig { params(border_color: String).void } - attr_writer :border_color + sig { returns(String) } + attr_accessor :border_style - sig { returns(T.nilable(String)) } - attr_reader :border_radius + sig { returns(String) } + attr_accessor :border_width - sig { params(border_radius: String).void } - attr_writer :border_radius + # Computed box-shadow (comma-separated layers when present) + sig { returns(String) } + attr_accessor :box_shadow - sig { returns(T.nilable(String)) } - attr_reader :border_style - - sig { params(border_style: String).void } - attr_writer :border_style - - sig { returns(T.nilable(String)) } - attr_reader :border_width + sig { returns(String) } + attr_accessor :color - sig { params(border_width: String).void } - attr_writer :border_width + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css - sig { returns(T.nilable(String)) } - attr_reader :box_shadow + sig { returns(String) } + attr_accessor :font_size - sig { params(box_shadow: String).void } - attr_writer :box_shadow + sig { returns(Float) } + attr_accessor :font_weight - sig { returns(T.nilable(String)) } - attr_reader :color + # Sampled minimum height of the button box (typically px) + sig { returns(String) } + attr_accessor :min_height - sig { params(color: String).void } - attr_writer :color + # Sampled minimum width of the button box (typically px) + sig { returns(String) } + attr_accessor :min_width - sig { returns(T.nilable(String)) } - attr_reader :font_size + sig { returns(String) } + attr_accessor :padding - sig { params(font_size: String).void } - attr_writer :font_size + sig { returns(String) } + attr_accessor :text_decoration - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + # Full ordered font list from computed font-family + sig { returns(T.nilable(T::Array[String])) } + attr_reader :font_fallbacks - sig { params(font_weight: Float).void } - attr_writer :font_weight + sig { params(font_fallbacks: T::Array[String]).void } + attr_writer :font_fallbacks + # Primary button typeface (first in fontFallbacks) sig { returns(T.nilable(String)) } - attr_reader :padding + attr_reader :font_family - sig { params(padding: String).void } - attr_writer :padding + sig { params(font_family: String).void } + attr_writer :font_family + # Hex color of the underline when it differs from the text color sig { returns(T.nilable(String)) } - attr_reader :text_decoration + attr_reader :text_decoration_color - sig { params(text_decoration: String).void } - attr_writer :text_decoration + sig { params(text_decoration_color: String).void } + attr_writer :text_decoration_color - # Link button style sig do params( background_color: String, @@ -570,24 +531,45 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String ).returns(T.attached_class) end def self.new( - background_color: nil, - border_color: nil, - border_radius: nil, - border_style: nil, - border_width: nil, - box_shadow: nil, - color: nil, - font_size: nil, - font_weight: nil, - padding: nil, - text_decoration: nil + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + # Computed box-shadow (comma-separated layers when present) + box_shadow:, + color:, + # Ready-to-use CSS declaration block for this component style + css:, + font_size:, + font_weight:, + # Sampled minimum height of the button box (typically px) + min_height:, + # Sampled minimum width of the button box (typically px) + min_width:, + padding:, + text_decoration:, + # Full ordered font list from computed font-family + font_fallbacks: nil, + # Primary button typeface (first in fontFallbacks) + font_family: nil, + # Hex color of the underline when it differs from the text color + text_decoration_color: nil ) end @@ -601,10 +583,16 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String } ) end @@ -621,73 +609,75 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :background_color + sig { returns(String) } + attr_accessor :background_color - sig { params(background_color: String).void } - attr_writer :background_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color - sig { returns(T.nilable(String)) } - attr_reader :border_color + sig { returns(String) } + attr_accessor :border_radius - sig { params(border_color: String).void } - attr_writer :border_color + sig { returns(String) } + attr_accessor :border_style - sig { returns(T.nilable(String)) } - attr_reader :border_radius + sig { returns(String) } + attr_accessor :border_width - sig { params(border_radius: String).void } - attr_writer :border_radius + # Computed box-shadow (comma-separated layers when present) + sig { returns(String) } + attr_accessor :box_shadow - sig { returns(T.nilable(String)) } - attr_reader :border_style + sig { returns(String) } + attr_accessor :color - sig { params(border_style: String).void } - attr_writer :border_style + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css - sig { returns(T.nilable(String)) } - attr_reader :border_width + sig { returns(String) } + attr_accessor :font_size - sig { params(border_width: String).void } - attr_writer :border_width + sig { returns(Float) } + attr_accessor :font_weight - sig { returns(T.nilable(String)) } - attr_reader :box_shadow - - sig { params(box_shadow: String).void } - attr_writer :box_shadow - - sig { returns(T.nilable(String)) } - attr_reader :color + # Sampled minimum height of the button box (typically px) + sig { returns(String) } + attr_accessor :min_height - sig { params(color: String).void } - attr_writer :color + # Sampled minimum width of the button box (typically px) + sig { returns(String) } + attr_accessor :min_width - sig { returns(T.nilable(String)) } - attr_reader :font_size + sig { returns(String) } + attr_accessor :padding - sig { params(font_size: String).void } - attr_writer :font_size + sig { returns(String) } + attr_accessor :text_decoration - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + # Full ordered font list from computed font-family + sig { returns(T.nilable(T::Array[String])) } + attr_reader :font_fallbacks - sig { params(font_weight: Float).void } - attr_writer :font_weight + sig { params(font_fallbacks: T::Array[String]).void } + attr_writer :font_fallbacks + # Primary button typeface (first in fontFallbacks) sig { returns(T.nilable(String)) } - attr_reader :padding + attr_reader :font_family - sig { params(padding: String).void } - attr_writer :padding + sig { params(font_family: String).void } + attr_writer :font_family + # Hex color of the underline when it differs from the text color sig { returns(T.nilable(String)) } - attr_reader :text_decoration + attr_reader :text_decoration_color - sig { params(text_decoration: String).void } - attr_writer :text_decoration + sig { params(text_decoration_color: String).void } + attr_writer :text_decoration_color - # Primary button style sig do params( background_color: String, @@ -697,24 +687,45 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String ).returns(T.attached_class) end def self.new( - background_color: nil, - border_color: nil, - border_radius: nil, - border_style: nil, - border_width: nil, - box_shadow: nil, - color: nil, - font_size: nil, - font_weight: nil, - padding: nil, - text_decoration: nil + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + # Computed box-shadow (comma-separated layers when present) + box_shadow:, + color:, + # Ready-to-use CSS declaration block for this component style + css:, + font_size:, + font_weight:, + # Sampled minimum height of the button box (typically px) + min_height:, + # Sampled minimum width of the button box (typically px) + min_width:, + padding:, + text_decoration:, + # Full ordered font list from computed font-family + font_fallbacks: nil, + # Primary button typeface (first in fontFallbacks) + font_family: nil, + # Hex color of the underline when it differs from the text color + text_decoration_color: nil ) end @@ -728,10 +739,16 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String } ) end @@ -748,73 +765,75 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :background_color - - sig { params(background_color: String).void } - attr_writer :background_color + sig { returns(String) } + attr_accessor :background_color - sig { returns(T.nilable(String)) } - attr_reader :border_color + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color - sig { params(border_color: String).void } - attr_writer :border_color + sig { returns(String) } + attr_accessor :border_radius - sig { returns(T.nilable(String)) } - attr_reader :border_radius + sig { returns(String) } + attr_accessor :border_style - sig { params(border_radius: String).void } - attr_writer :border_radius + sig { returns(String) } + attr_accessor :border_width - sig { returns(T.nilable(String)) } - attr_reader :border_style + # Computed box-shadow (comma-separated layers when present) + sig { returns(String) } + attr_accessor :box_shadow - sig { params(border_style: String).void } - attr_writer :border_style + sig { returns(String) } + attr_accessor :color - sig { returns(T.nilable(String)) } - attr_reader :border_width + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css - sig { params(border_width: String).void } - attr_writer :border_width + sig { returns(String) } + attr_accessor :font_size - sig { returns(T.nilable(String)) } - attr_reader :box_shadow + sig { returns(Float) } + attr_accessor :font_weight - sig { params(box_shadow: String).void } - attr_writer :box_shadow + # Sampled minimum height of the button box (typically px) + sig { returns(String) } + attr_accessor :min_height - sig { returns(T.nilable(String)) } - attr_reader :color - - sig { params(color: String).void } - attr_writer :color + # Sampled minimum width of the button box (typically px) + sig { returns(String) } + attr_accessor :min_width - sig { returns(T.nilable(String)) } - attr_reader :font_size + sig { returns(String) } + attr_accessor :padding - sig { params(font_size: String).void } - attr_writer :font_size + sig { returns(String) } + attr_accessor :text_decoration - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + # Full ordered font list from computed font-family + sig { returns(T.nilable(T::Array[String])) } + attr_reader :font_fallbacks - sig { params(font_weight: Float).void } - attr_writer :font_weight + sig { params(font_fallbacks: T::Array[String]).void } + attr_writer :font_fallbacks + # Primary button typeface (first in fontFallbacks) sig { returns(T.nilable(String)) } - attr_reader :padding + attr_reader :font_family - sig { params(padding: String).void } - attr_writer :padding + sig { params(font_family: String).void } + attr_writer :font_family + # Hex color of the underline when it differs from the text color sig { returns(T.nilable(String)) } - attr_reader :text_decoration + attr_reader :text_decoration_color - sig { params(text_decoration: String).void } - attr_writer :text_decoration + sig { params(text_decoration_color: String).void } + attr_writer :text_decoration_color - # Secondary button style sig do params( background_color: String, @@ -824,24 +843,45 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String ).returns(T.attached_class) end def self.new( - background_color: nil, - border_color: nil, - border_radius: nil, - border_style: nil, - border_width: nil, - box_shadow: nil, - color: nil, - font_size: nil, - font_weight: nil, - padding: nil, - text_decoration: nil + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + # Computed box-shadow (comma-separated layers when present) + box_shadow:, + color:, + # Ready-to-use CSS declaration block for this component style + css:, + font_size:, + font_weight:, + # Sampled minimum height of the button box (typically px) + min_height:, + # Sampled minimum width of the button box (typically px) + min_width:, + padding:, + text_decoration:, + # Full ordered font list from computed font-family + font_fallbacks: nil, + # Primary button typeface (first in fontFallbacks) + font_family: nil, + # Hex color of the underline when it differs from the text color + text_decoration_color: nil ) end @@ -855,10 +895,16 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: T::Array[String], + font_family: String, + text_decoration_color: String } ) end @@ -876,53 +922,35 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :background_color - - sig { params(background_color: String).void } - attr_writer :background_color - - sig { returns(T.nilable(String)) } - attr_reader :border_color - - sig { params(border_color: String).void } - attr_writer :border_color - - sig { returns(T.nilable(String)) } - attr_reader :border_radius + sig { returns(String) } + attr_accessor :background_color - sig { params(border_radius: String).void } - attr_writer :border_radius + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + sig { returns(String) } + attr_accessor :border_color - sig { returns(T.nilable(String)) } - attr_reader :border_style + sig { returns(String) } + attr_accessor :border_radius - sig { params(border_style: String).void } - attr_writer :border_style + sig { returns(String) } + attr_accessor :border_style - sig { returns(T.nilable(String)) } - attr_reader :border_width + sig { returns(String) } + attr_accessor :border_width - sig { params(border_width: String).void } - attr_writer :border_width + sig { returns(String) } + attr_accessor :box_shadow - sig { returns(T.nilable(String)) } - attr_reader :box_shadow + # Ready-to-use CSS declaration block for this component style + sig { returns(String) } + attr_accessor :css - sig { params(box_shadow: String).void } - attr_writer :box_shadow + sig { returns(String) } + attr_accessor :padding - sig { returns(T.nilable(String)) } - attr_reader :padding - - sig { params(padding: String).void } - attr_writer :padding - - sig { returns(T.nilable(String)) } - attr_reader :text_color - - sig { params(text_color: String).void } - attr_writer :text_color + sig { returns(String) } + attr_accessor :text_color # Card component style sig do @@ -933,19 +961,24 @@ module ContextDev border_style: String, border_width: String, box_shadow: String, + css: String, padding: String, text_color: String ).returns(T.attached_class) end def self.new( - background_color: nil, - border_color: nil, - border_radius: nil, - border_style: nil, - border_width: nil, - box_shadow: nil, - padding: nil, - text_color: nil + background_color:, + # Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has + # alpha) + border_color:, + border_radius:, + border_style:, + border_width:, + box_shadow:, + # Ready-to-use CSS declaration block for this component style + css:, + padding:, + text_color: ) end @@ -958,6 +991,7 @@ module ContextDev border_style: String, border_width: String, box_shadow: String, + css: String, padding: String, text_color: String } @@ -977,40 +1011,20 @@ module ContextDev ) end - # Large spacing value - sig { returns(T.nilable(String)) } - attr_reader :lg - - sig { params(lg: String).void } - attr_writer :lg - - # Medium spacing value - sig { returns(T.nilable(String)) } - attr_reader :md + sig { returns(String) } + attr_accessor :lg - sig { params(md: String).void } - attr_writer :md + sig { returns(String) } + attr_accessor :md - # Small spacing value - sig { returns(T.nilable(String)) } - attr_reader :sm + sig { returns(String) } + attr_accessor :sm - sig { params(sm: String).void } - attr_writer :sm + sig { returns(String) } + attr_accessor :xl - # Extra large spacing value - sig { returns(T.nilable(String)) } - attr_reader :xl - - sig { params(xl: String).void } - attr_writer :xl - - # Extra small spacing value - sig { returns(T.nilable(String)) } - attr_reader :xs - - sig { params(xs: String).void } - attr_writer :xs + sig { returns(String) } + attr_accessor :xs # Spacing system used on the website sig do @@ -1022,18 +1036,7 @@ module ContextDev xs: String ).returns(T.attached_class) end - def self.new( - # Large spacing value - lg: nil, - # Medium spacing value - md: nil, - # Small spacing value - sm: nil, - # Extra large spacing value - xl: nil, - # Extra small spacing value - xs: nil - ) + def self.new(lg:, md:, sm:, xl:, xs:) end sig do @@ -1089,40 +1092,20 @@ module ContextDev ) end - # Inner shadow value - sig { returns(T.nilable(String)) } - attr_reader :inner - - sig { params(inner: String).void } - attr_writer :inner - - # Large shadow value - sig { returns(T.nilable(String)) } - attr_reader :lg - - sig { params(lg: String).void } - attr_writer :lg - - # Medium shadow value - sig { returns(T.nilable(String)) } - attr_reader :md + sig { returns(String) } + attr_accessor :inner - sig { params(md: String).void } - attr_writer :md + sig { returns(String) } + attr_accessor :lg - # Small shadow value - sig { returns(T.nilable(String)) } - attr_reader :sm + sig { returns(String) } + attr_accessor :md - sig { params(sm: String).void } - attr_writer :sm + sig { returns(String) } + attr_accessor :sm - # Extra large shadow value - sig { returns(T.nilable(String)) } - attr_reader :xl - - sig { params(xl: String).void } - attr_writer :xl + sig { returns(String) } + attr_accessor :xl # Shadow styles used on the website sig do @@ -1134,18 +1117,7 @@ module ContextDev xl: String ).returns(T.attached_class) end - def self.new( - # Inner shadow value - inner: nil, - # Large shadow value - lg: nil, - # Medium shadow value - md: nil, - # Small shadow value - sm: nil, - # Extra large shadow value - xl: nil - ) + def self.new(inner:, lg:, md:, sm:, xl:) end sig do @@ -1169,9 +1141,7 @@ module ContextDev # Heading styles sig do returns( - T.nilable( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings - ) + ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings ) end attr_reader :headings @@ -1184,7 +1154,6 @@ module ContextDev end attr_writer :headings - # Paragraph text styles sig do returns( T.nilable( @@ -1213,8 +1182,7 @@ module ContextDev end def self.new( # Heading styles - headings: nil, - # Paragraph text styles + headings:, p_: nil ) end @@ -1351,38 +1319,29 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :font_family - - sig { params(font_family: String).void } - attr_writer :font_family - - sig { returns(T.nilable(String)) } - attr_reader :font_size - - sig { params(font_size: String).void } - attr_writer :font_size + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family - sig { params(font_weight: Float).void } - attr_writer :font_weight + sig { returns(String) } + attr_accessor :font_size - sig { returns(T.nilable(String)) } - attr_reader :letter_spacing - - sig { params(letter_spacing: String).void } - attr_writer :letter_spacing + sig { returns(Float) } + attr_accessor :font_weight - sig { returns(T.nilable(String)) } - attr_reader :line_height + sig { returns(String) } + attr_accessor :letter_spacing - sig { params(line_height: String).void } - attr_writer :line_height + sig { returns(String) } + attr_accessor :line_height sig do params( + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1391,17 +1350,21 @@ module ContextDev ).returns(T.attached_class) end def self.new( - font_family: nil, - font_size: nil, - font_weight: nil, - letter_spacing: nil, - line_height: nil + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: ) end sig do override.returns( { + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1423,38 +1386,29 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :font_family + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks - sig { params(font_family: String).void } - attr_writer :font_family + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family - sig { returns(T.nilable(String)) } - attr_reader :font_size + sig { returns(String) } + attr_accessor :font_size - sig { params(font_size: String).void } - attr_writer :font_size + sig { returns(Float) } + attr_accessor :font_weight - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + sig { returns(String) } + attr_accessor :letter_spacing - sig { params(font_weight: Float).void } - attr_writer :font_weight - - sig { returns(T.nilable(String)) } - attr_reader :letter_spacing - - sig { params(letter_spacing: String).void } - attr_writer :letter_spacing - - sig { returns(T.nilable(String)) } - attr_reader :line_height - - sig { params(line_height: String).void } - attr_writer :line_height + sig { returns(String) } + attr_accessor :line_height sig do params( + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1463,17 +1417,21 @@ module ContextDev ).returns(T.attached_class) end def self.new( - font_family: nil, - font_size: nil, - font_weight: nil, - letter_spacing: nil, - line_height: nil + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: ) end sig do override.returns( { + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1495,38 +1453,29 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :font_family - - sig { params(font_family: String).void } - attr_writer :font_family - - sig { returns(T.nilable(String)) } - attr_reader :font_size + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks - sig { params(font_size: String).void } - attr_writer :font_size + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + sig { returns(String) } + attr_accessor :font_size - sig { params(font_weight: Float).void } - attr_writer :font_weight + sig { returns(Float) } + attr_accessor :font_weight - sig { returns(T.nilable(String)) } - attr_reader :letter_spacing - - sig { params(letter_spacing: String).void } - attr_writer :letter_spacing - - sig { returns(T.nilable(String)) } - attr_reader :line_height + sig { returns(String) } + attr_accessor :letter_spacing - sig { params(line_height: String).void } - attr_writer :line_height + sig { returns(String) } + attr_accessor :line_height sig do params( + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1535,17 +1484,21 @@ module ContextDev ).returns(T.attached_class) end def self.new( - font_family: nil, - font_size: nil, - font_weight: nil, - letter_spacing: nil, - line_height: nil + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: ) end sig do override.returns( { + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1567,38 +1520,29 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :font_family + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks - sig { params(font_family: String).void } - attr_writer :font_family + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family - sig { returns(T.nilable(String)) } - attr_reader :font_size - - sig { params(font_size: String).void } - attr_writer :font_size + sig { returns(String) } + attr_accessor :font_size - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + sig { returns(Float) } + attr_accessor :font_weight - sig { params(font_weight: Float).void } - attr_writer :font_weight - - sig { returns(T.nilable(String)) } - attr_reader :letter_spacing + sig { returns(String) } + attr_accessor :letter_spacing - sig { params(letter_spacing: String).void } - attr_writer :letter_spacing - - sig { returns(T.nilable(String)) } - attr_reader :line_height - - sig { params(line_height: String).void } - attr_writer :line_height + sig { returns(String) } + attr_accessor :line_height sig do params( + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1607,17 +1551,21 @@ module ContextDev ).returns(T.attached_class) end def self.new( - font_family: nil, - font_size: nil, - font_weight: nil, - letter_spacing: nil, - line_height: nil + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: ) end sig do override.returns( { + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1640,39 +1588,29 @@ module ContextDev ) end - sig { returns(T.nilable(String)) } - attr_reader :font_family - - sig { params(font_family: String).void } - attr_writer :font_family - - sig { returns(T.nilable(String)) } - attr_reader :font_size - - sig { params(font_size: String).void } - attr_writer :font_size - - sig { returns(T.nilable(Float)) } - attr_reader :font_weight + # Full ordered font list from resolved computed font-family + sig { returns(T::Array[String]) } + attr_accessor :font_fallbacks - sig { params(font_weight: Float).void } - attr_writer :font_weight + # Primary face (first family in the computed stack) + sig { returns(String) } + attr_accessor :font_family - sig { returns(T.nilable(String)) } - attr_reader :letter_spacing + sig { returns(String) } + attr_accessor :font_size - sig { params(letter_spacing: String).void } - attr_writer :letter_spacing + sig { returns(Float) } + attr_accessor :font_weight - sig { returns(T.nilable(String)) } - attr_reader :line_height + sig { returns(String) } + attr_accessor :letter_spacing - sig { params(line_height: String).void } - attr_writer :line_height + sig { returns(String) } + attr_accessor :line_height - # Paragraph text styles sig do params( + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -1681,17 +1619,21 @@ module ContextDev ).returns(T.attached_class) end def self.new( - font_family: nil, - font_size: nil, - font_weight: nil, - letter_spacing: nil, - line_height: nil + # Full ordered font list from resolved computed font-family + font_fallbacks:, + # Primary face (first family in the computed stack) + font_family:, + font_size:, + font_weight:, + letter_spacing:, + line_height: ) end sig do override.returns( { + font_fallbacks: T::Array[String], font_family: String, font_size: String, font_weight: Float, diff --git a/rbi/context_dev/resources/style.rbi b/rbi/context_dev/resources/style.rbi index bc221077..f819a058 100644 --- a/rbi/context_dev/resources/style.rbi +++ b/rbi/context_dev/resources/style.rbi @@ -32,8 +32,6 @@ module ContextDev params( direct_url: String, domain: String, - prioritize: - ContextDev::StyleExtractStyleguideParams::Prioritize::OrSymbol, timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::StyleExtractStyleguideResponse) @@ -45,11 +43,6 @@ module ContextDev # Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The # domain will be automatically normalized and validated. domain: nil, - # Optional parameter to prioritize screenshot capture for styleguide extraction. - # If 'speed', optimizes for faster capture with basic quality. If 'quality', - # optimizes for higher quality with longer wait times. Defaults to 'quality' if - # not provided. - prioritize: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/sig/context_dev/internal/util.rbs b/sig/context_dev/internal/util.rbs index 90bcd1b4..0f242a76 100644 --- a/sig/context_dev/internal/util.rbs +++ b/sig/context_dev/internal/util.rbs @@ -45,8 +45,12 @@ module ContextDev -> top? } -> top? + RFC_3986_NOT_PCHARS: Regexp + def self?.uri_origin: (URI::Generic uri) -> String + def self?.encode_path: (String | Integer path) -> String + def self?.interpolate_path: (String | ::Array[String] path) -> String def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] diff --git a/sig/context_dev/models/style_extract_styleguide_params.rbs b/sig/context_dev/models/style_extract_styleguide_params.rbs index c56ddf4e..10140f24 100644 --- a/sig/context_dev/models/style_extract_styleguide_params.rbs +++ b/sig/context_dev/models/style_extract_styleguide_params.rbs @@ -1,12 +1,7 @@ module ContextDev module Models type style_extract_styleguide_params = - { - direct_url: String, - domain: String, - prioritize: ContextDev::Models::StyleExtractStyleguideParams::prioritize, - timeout_ms: Integer - } + { direct_url: String, domain: String, timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters class StyleExtractStyleguideParams < ContextDev::Internal::Type::BaseModel @@ -21,12 +16,6 @@ module ContextDev def domain=: (String) -> String - attr_reader prioritize: ContextDev::Models::StyleExtractStyleguideParams::prioritize? - - def prioritize=: ( - ContextDev::Models::StyleExtractStyleguideParams::prioritize - ) -> ContextDev::Models::StyleExtractStyleguideParams::prioritize - attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -34,7 +23,6 @@ module ContextDev def initialize: ( ?direct_url: String, ?domain: String, - ?prioritize: ContextDev::Models::StyleExtractStyleguideParams::prioritize, ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -42,21 +30,9 @@ module ContextDev def to_hash: -> { direct_url: String, domain: String, - prioritize: ContextDev::Models::StyleExtractStyleguideParams::prioritize, timeout_ms: Integer, request_options: ContextDev::RequestOptions } - - type prioritize = :speed | :quality - - module Prioritize - extend ContextDev::Internal::Type::Enum - - SPEED: :speed - QUALITY: :quality - - def self?.values: -> ::Array[ContextDev::Models::StyleExtractStyleguideParams::prioritize] - end end end end diff --git a/sig/context_dev/models/style_extract_styleguide_response.rbs b/sig/context_dev/models/style_extract_styleguide_response.rbs index 4a72556b..87b08dd5 100644 --- a/sig/context_dev/models/style_extract_styleguide_response.rbs +++ b/sig/context_dev/models/style_extract_styleguide_response.rbs @@ -52,49 +52,25 @@ module ContextDev } class Styleguide < ContextDev::Internal::Type::BaseModel - attr_reader colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors? + attr_accessor colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors - def colors=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors + attr_accessor components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components - attr_reader components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components? + attr_accessor element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing - def components=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components + attr_accessor mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode - attr_reader element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing? + attr_accessor shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows - def element_spacing=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing - - attr_reader mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode? - - def mode=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode - - attr_reader shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows? - - def shadows=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows - - attr_reader typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography? - - def typography=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography + attr_accessor typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography def initialize: ( - ?colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, - ?components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, - ?element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, - ?mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, - ?shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, - ?typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography + colors: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Colors, + components: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components, + element_spacing: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::ElementSpacing, + mode: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::mode, + shadows: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Shadows, + typography: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography ) -> void def to_hash: -> { @@ -109,22 +85,16 @@ module ContextDev type colors = { accent: String, background: String, text: String } class Colors < ContextDev::Internal::Type::BaseModel - attr_reader accent: String? - - def accent=: (String) -> String - - attr_reader background: String? + attr_accessor accent: String - def background=: (String) -> String + attr_accessor background: String - attr_reader text: String? - - def text=: (String) -> String + attr_accessor text: String def initialize: ( - ?accent: String, - ?background: String, - ?text: String + accent: String, + background: String, + text: String ) -> void def to_hash: -> { accent: String, background: String, text: String } @@ -137,11 +107,7 @@ module ContextDev } class Components < ContextDev::Internal::Type::BaseModel - attr_reader button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button? - - def button=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button + attr_accessor button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button attr_reader card: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card? @@ -150,7 +116,7 @@ module ContextDev ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card def initialize: ( - ?button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, + button: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Button, ?card: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Components::Card ) -> void @@ -206,69 +172,77 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String } class Link < ContextDev::Internal::Type::BaseModel - attr_reader background_color: String? - - def background_color=: (String) -> String + attr_accessor background_color: String - attr_reader border_color: String? + attr_accessor border_color: String - def border_color=: (String) -> String + attr_accessor border_radius: String - attr_reader border_radius: String? + attr_accessor border_style: String - def border_radius=: (String) -> String + attr_accessor border_width: String - attr_reader border_style: String? + attr_accessor box_shadow: String - def border_style=: (String) -> String + attr_accessor color: String - attr_reader border_width: String? + attr_accessor css: String - def border_width=: (String) -> String + attr_accessor font_size: String - attr_reader box_shadow: String? + attr_accessor font_weight: Float - def box_shadow=: (String) -> String + attr_accessor min_height: String - attr_reader color: String? + attr_accessor min_width: String - def color=: (String) -> String + attr_accessor padding: String - attr_reader font_size: String? + attr_accessor text_decoration: String - def font_size=: (String) -> String + attr_reader font_fallbacks: ::Array[String]? - attr_reader font_weight: Float? + def font_fallbacks=: (::Array[String]) -> ::Array[String] - def font_weight=: (Float) -> Float - - attr_reader padding: String? + attr_reader font_family: String? - def padding=: (String) -> String + def font_family=: (String) -> String - attr_reader text_decoration: String? + attr_reader text_decoration_color: String? - def text_decoration=: (String) -> String + def text_decoration_color=: (String) -> String def initialize: ( - ?background_color: String, - ?border_color: String, - ?border_radius: String, - ?border_style: String, - ?border_width: String, - ?box_shadow: String, - ?color: String, - ?font_size: String, - ?font_weight: Float, - ?padding: String, - ?text_decoration: String + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + ?font_fallbacks: ::Array[String], + ?font_family: String, + ?text_decoration_color: String ) -> void def to_hash: -> { @@ -279,10 +253,16 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String } end @@ -295,69 +275,77 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String } class Primary < ContextDev::Internal::Type::BaseModel - attr_reader background_color: String? - - def background_color=: (String) -> String + attr_accessor background_color: String - attr_reader border_color: String? + attr_accessor border_color: String - def border_color=: (String) -> String + attr_accessor border_radius: String - attr_reader border_radius: String? + attr_accessor border_style: String - def border_radius=: (String) -> String + attr_accessor border_width: String - attr_reader border_style: String? + attr_accessor box_shadow: String - def border_style=: (String) -> String + attr_accessor color: String - attr_reader border_width: String? + attr_accessor css: String - def border_width=: (String) -> String + attr_accessor font_size: String - attr_reader box_shadow: String? + attr_accessor font_weight: Float - def box_shadow=: (String) -> String + attr_accessor min_height: String - attr_reader color: String? + attr_accessor min_width: String - def color=: (String) -> String + attr_accessor padding: String - attr_reader font_size: String? + attr_accessor text_decoration: String - def font_size=: (String) -> String + attr_reader font_fallbacks: ::Array[String]? - attr_reader font_weight: Float? + def font_fallbacks=: (::Array[String]) -> ::Array[String] - def font_weight=: (Float) -> Float - - attr_reader padding: String? + attr_reader font_family: String? - def padding=: (String) -> String + def font_family=: (String) -> String - attr_reader text_decoration: String? + attr_reader text_decoration_color: String? - def text_decoration=: (String) -> String + def text_decoration_color=: (String) -> String def initialize: ( - ?background_color: String, - ?border_color: String, - ?border_radius: String, - ?border_style: String, - ?border_width: String, - ?box_shadow: String, - ?color: String, - ?font_size: String, - ?font_weight: Float, - ?padding: String, - ?text_decoration: String + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + ?font_fallbacks: ::Array[String], + ?font_family: String, + ?text_decoration_color: String ) -> void def to_hash: -> { @@ -368,10 +356,16 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String } end @@ -384,69 +378,77 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String } class Secondary < ContextDev::Internal::Type::BaseModel - attr_reader background_color: String? - - def background_color=: (String) -> String - - attr_reader border_color: String? + attr_accessor background_color: String - def border_color=: (String) -> String + attr_accessor border_color: String - attr_reader border_radius: String? + attr_accessor border_radius: String - def border_radius=: (String) -> String + attr_accessor border_style: String - attr_reader border_style: String? + attr_accessor border_width: String - def border_style=: (String) -> String + attr_accessor box_shadow: String - attr_reader border_width: String? + attr_accessor color: String - def border_width=: (String) -> String + attr_accessor css: String - attr_reader box_shadow: String? + attr_accessor font_size: String - def box_shadow=: (String) -> String + attr_accessor font_weight: Float - attr_reader color: String? + attr_accessor min_height: String - def color=: (String) -> String + attr_accessor min_width: String - attr_reader font_size: String? + attr_accessor padding: String - def font_size=: (String) -> String + attr_accessor text_decoration: String - attr_reader font_weight: Float? + attr_reader font_fallbacks: ::Array[String]? - def font_weight=: (Float) -> Float + def font_fallbacks=: (::Array[String]) -> ::Array[String] - attr_reader padding: String? + attr_reader font_family: String? - def padding=: (String) -> String + def font_family=: (String) -> String - attr_reader text_decoration: String? + attr_reader text_decoration_color: String? - def text_decoration=: (String) -> String + def text_decoration_color=: (String) -> String def initialize: ( - ?background_color: String, - ?border_color: String, - ?border_radius: String, - ?border_style: String, - ?border_width: String, - ?box_shadow: String, - ?color: String, - ?font_size: String, - ?font_weight: Float, - ?padding: String, - ?text_decoration: String + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + color: String, + css: String, + font_size: String, + font_weight: Float, + min_height: String, + min_width: String, + padding: String, + text_decoration: String, + ?font_fallbacks: ::Array[String], + ?font_family: String, + ?text_decoration_color: String ) -> void def to_hash: -> { @@ -457,10 +459,16 @@ module ContextDev border_width: String, box_shadow: String, color: String, + css: String, font_size: String, font_weight: Float, + min_height: String, + min_width: String, padding: String, - text_decoration: String + text_decoration: String, + font_fallbacks: ::Array[String], + font_family: String, + text_decoration_color: String } end end @@ -473,52 +481,40 @@ module ContextDev border_style: String, border_width: String, box_shadow: String, + css: String, padding: String, text_color: String } class Card < ContextDev::Internal::Type::BaseModel - attr_reader background_color: String? - - def background_color=: (String) -> String - - attr_reader border_color: String? - - def border_color=: (String) -> String + attr_accessor background_color: String - attr_reader border_radius: String? + attr_accessor border_color: String - def border_radius=: (String) -> String + attr_accessor border_radius: String - attr_reader border_style: String? + attr_accessor border_style: String - def border_style=: (String) -> String + attr_accessor border_width: String - attr_reader border_width: String? + attr_accessor box_shadow: String - def border_width=: (String) -> String + attr_accessor css: String - attr_reader box_shadow: String? + attr_accessor padding: String - def box_shadow=: (String) -> String - - attr_reader padding: String? - - def padding=: (String) -> String - - attr_reader text_color: String? - - def text_color=: (String) -> String + attr_accessor text_color: String def initialize: ( - ?background_color: String, - ?border_color: String, - ?border_radius: String, - ?border_style: String, - ?border_width: String, - ?box_shadow: String, - ?padding: String, - ?text_color: String + background_color: String, + border_color: String, + border_radius: String, + border_style: String, + border_width: String, + box_shadow: String, + css: String, + padding: String, + text_color: String ) -> void def to_hash: -> { @@ -528,6 +524,7 @@ module ContextDev border_style: String, border_width: String, box_shadow: String, + css: String, padding: String, text_color: String } @@ -538,32 +535,22 @@ module ContextDev { lg: String, md: String, sm: String, xl: String, xs: String } class ElementSpacing < ContextDev::Internal::Type::BaseModel - attr_reader lg: String? - - def lg=: (String) -> String - - attr_reader md: String? - - def md=: (String) -> String - - attr_reader sm: String? + attr_accessor lg: String - def sm=: (String) -> String + attr_accessor md: String - attr_reader xl: String? + attr_accessor sm: String - def xl=: (String) -> String + attr_accessor xl: String - attr_reader xs: String? - - def xs=: (String) -> String + attr_accessor xs: String def initialize: ( - ?lg: String, - ?md: String, - ?sm: String, - ?xl: String, - ?xs: String + lg: String, + md: String, + sm: String, + xl: String, + xs: String ) -> void def to_hash: -> { @@ -590,32 +577,22 @@ module ContextDev { inner: String, lg: String, md: String, sm: String, xl: String } class Shadows < ContextDev::Internal::Type::BaseModel - attr_reader inner: String? - - def inner=: (String) -> String - - attr_reader lg: String? - - def lg=: (String) -> String - - attr_reader md: String? + attr_accessor inner: String - def md=: (String) -> String + attr_accessor lg: String - attr_reader sm: String? + attr_accessor md: String - def sm=: (String) -> String + attr_accessor sm: String - attr_reader xl: String? - - def xl=: (String) -> String + attr_accessor xl: String def initialize: ( - ?inner: String, - ?lg: String, - ?md: String, - ?sm: String, - ?xl: String + inner: String, + lg: String, + md: String, + sm: String, + xl: String ) -> void def to_hash: -> { @@ -634,11 +611,7 @@ module ContextDev } class Typography < ContextDev::Internal::Type::BaseModel - attr_reader headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings? - - def headings=: ( - ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings - ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings + attr_accessor headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings attr_reader p_: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P? @@ -647,7 +620,7 @@ module ContextDev ) -> ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P def initialize: ( - ?headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, + headings: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::Headings, ?p_: ContextDev::Models::StyleExtractStyleguideResponse::Styleguide::Typography::P ) -> void @@ -705,6 +678,7 @@ module ContextDev type h1 = { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -713,35 +687,29 @@ module ContextDev } class H1 < ContextDev::Internal::Type::BaseModel - attr_reader font_family: String? - - def font_family=: (String) -> String - - attr_reader font_size: String? - - def font_size=: (String) -> String + attr_accessor font_fallbacks: ::Array[String] - attr_reader font_weight: Float? + attr_accessor font_family: String - def font_weight=: (Float) -> Float + attr_accessor font_size: String - attr_reader letter_spacing: String? + attr_accessor font_weight: Float - def letter_spacing=: (String) -> String + attr_accessor letter_spacing: String - attr_reader line_height: String? - - def line_height=: (String) -> String + attr_accessor line_height: String def initialize: ( - ?font_family: String, - ?font_size: String, - ?font_weight: Float, - ?letter_spacing: String, - ?line_height: String + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String ) -> void def to_hash: -> { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -752,6 +720,7 @@ module ContextDev type h2 = { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -760,35 +729,29 @@ module ContextDev } class H2 < ContextDev::Internal::Type::BaseModel - attr_reader font_family: String? - - def font_family=: (String) -> String - - attr_reader font_size: String? - - def font_size=: (String) -> String + attr_accessor font_fallbacks: ::Array[String] - attr_reader font_weight: Float? + attr_accessor font_family: String - def font_weight=: (Float) -> Float + attr_accessor font_size: String - attr_reader letter_spacing: String? + attr_accessor font_weight: Float - def letter_spacing=: (String) -> String + attr_accessor letter_spacing: String - attr_reader line_height: String? - - def line_height=: (String) -> String + attr_accessor line_height: String def initialize: ( - ?font_family: String, - ?font_size: String, - ?font_weight: Float, - ?letter_spacing: String, - ?line_height: String + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String ) -> void def to_hash: -> { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -799,6 +762,7 @@ module ContextDev type h3 = { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -807,35 +771,29 @@ module ContextDev } class H3 < ContextDev::Internal::Type::BaseModel - attr_reader font_family: String? - - def font_family=: (String) -> String + attr_accessor font_fallbacks: ::Array[String] - attr_reader font_size: String? + attr_accessor font_family: String - def font_size=: (String) -> String + attr_accessor font_size: String - attr_reader font_weight: Float? + attr_accessor font_weight: Float - def font_weight=: (Float) -> Float + attr_accessor letter_spacing: String - attr_reader letter_spacing: String? - - def letter_spacing=: (String) -> String - - attr_reader line_height: String? - - def line_height=: (String) -> String + attr_accessor line_height: String def initialize: ( - ?font_family: String, - ?font_size: String, - ?font_weight: Float, - ?letter_spacing: String, - ?line_height: String + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String ) -> void def to_hash: -> { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -846,6 +804,7 @@ module ContextDev type h4 = { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -854,35 +813,29 @@ module ContextDev } class H4 < ContextDev::Internal::Type::BaseModel - attr_reader font_family: String? + attr_accessor font_fallbacks: ::Array[String] - def font_family=: (String) -> String - - attr_reader font_size: String? - - def font_size=: (String) -> String - - attr_reader font_weight: Float? - - def font_weight=: (Float) -> Float + attr_accessor font_family: String - attr_reader letter_spacing: String? + attr_accessor font_size: String - def letter_spacing=: (String) -> String + attr_accessor font_weight: Float - attr_reader line_height: String? + attr_accessor letter_spacing: String - def line_height=: (String) -> String + attr_accessor line_height: String def initialize: ( - ?font_family: String, - ?font_size: String, - ?font_weight: Float, - ?letter_spacing: String, - ?line_height: String + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String ) -> void def to_hash: -> { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -894,6 +847,7 @@ module ContextDev type p_ = { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, @@ -902,35 +856,29 @@ module ContextDev } class P < ContextDev::Internal::Type::BaseModel - attr_reader font_family: String? - - def font_family=: (String) -> String - - attr_reader font_size: String? - - def font_size=: (String) -> String - - attr_reader font_weight: Float? + attr_accessor font_fallbacks: ::Array[String] - def font_weight=: (Float) -> Float + attr_accessor font_family: String - attr_reader letter_spacing: String? + attr_accessor font_size: String - def letter_spacing=: (String) -> String + attr_accessor font_weight: Float - attr_reader line_height: String? + attr_accessor letter_spacing: String - def line_height=: (String) -> String + attr_accessor line_height: String def initialize: ( - ?font_family: String, - ?font_size: String, - ?font_weight: Float, - ?letter_spacing: String, - ?line_height: String + font_fallbacks: ::Array[String], + font_family: String, + font_size: String, + font_weight: Float, + letter_spacing: String, + line_height: String ) -> void def to_hash: -> { + font_fallbacks: ::Array[String], font_family: String, font_size: String, font_weight: Float, diff --git a/sig/context_dev/resources/style.rbs b/sig/context_dev/resources/style.rbs index 0bb5f6d7..76529051 100644 --- a/sig/context_dev/resources/style.rbs +++ b/sig/context_dev/resources/style.rbs @@ -10,7 +10,6 @@ module ContextDev def extract_styleguide: ( ?direct_url: String, ?domain: String, - ?prioritize: ContextDev::Models::StyleExtractStyleguideParams::prioritize, ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::StyleExtractStyleguideResponse