Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
69b6154
BP: Duotone: Limit SVG filter output to used filters #49103
MaggieCabrera Jun 15, 2023
26ee6d3
wrong place for the included file
MaggieCabrera Jun 15, 2023
4615585
BP: Duotone: Remove Safari rerender hack (#49232)
MaggieCabrera Jun 15, 2023
984486c
BP: Replace regex with tag processor for duotone class render #49212
MaggieCabrera Jun 15, 2023
72f6355
BP: Duotone: Pass filters to the Post Editor #49239
MaggieCabrera Jun 15, 2023
cb980d0
BP: Port colord to PHP #49700
MaggieCabrera Jun 15, 2023
b6f01c6
BP:Deprecate remaining global duotone functions
MaggieCabrera Jun 15, 2023
035a100
BP - partially: Selectors API: Fix for global styles hook, style vari…
MaggieCabrera Jun 15, 2023
83e3c2a
BP - partially: Selectors API: Make duotone selectors fallback and be…
MaggieCabrera Jun 15, 2023
3777e20
BP: Group duotone outputs and refactor rendering #49705
MaggieCabrera Jun 15, 2023
3471457
BP: Polish duotone rendering code #49706
MaggieCabrera Jun 15, 2023
e82e5da
BP: Better error message when theme.json styles use a duotone preset …
MaggieCabrera Jun 15, 2023
89d1c7a
BP: Clarify error message if duotone color values is incorrect #51397
MaggieCabrera Jun 15, 2023
8efbc43
run linter
MaggieCabrera Jun 15, 2023
8dc7158
Add duotone hooks
Jun 15, 2023
9774f6c
Fix comments to reference core versions of functions
Jun 15, 2023
ee7741c
Fix more comments to reference core versions of functions
Jun 15, 2023
4d1d9aa
Use core versions of classes/functions
Jun 15, 2023
9ebb0d3
Remove gutenberg translation domains
Jun 15, 2023
2a90a43
added docs or fixed them
MaggieCabrera Jun 16, 2023
2fd1bf9
Fixed more docblocks
MaggieCabrera Jun 21, 2023
d2306db
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
fb75344
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
f78d01b
Update tests/phpunit/tests/block-supports/duotone.php
MaggieCabrera Jun 26, 2023
7106f33
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
4530c53
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
071e093
fix docblocks for tests
MaggieCabrera Jun 26, 2023
eb1c12e
fix multiline comments
MaggieCabrera Jun 26, 2023
956e65c
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
6dad8db
fix colord functions docblocks
MaggieCabrera Jun 26, 2023
f1c26ea
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
49f0630
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
7d296b4
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
e18f0ae
moved deprecated functions to the correct file
MaggieCabrera Jun 26, 2023
ae122da
Mark private and new deprecated methods as internal
ajlende Jun 26, 2023
6a91d93
Format line wrapping in comment
ajlende Jun 26, 2023
5141c6a
Update deprecated function docblock link and order
ajlende Jun 26, 2023
ec248c2
Fix trailing space
ajlende Jun 26, 2023
375ce41
Add more description to the WP_Duotone methods
ajlende Jun 26, 2023
895363a
Deprecate wp_global_styles_render_svg_filters and wp_get_global_style…
ajlende Jun 27, 2023
5347e2c
Remove tests for deprecated functions
ajlende Jun 27, 2023
1476cff
Move newly deprecated functions to deprecated.php
ajlende Jun 27, 2023
d74a917
Add changelog to PRESETS_METADATA
ajlende Jun 27, 2023
710858d
Add @since 6.3.0 to all duotone methods
ajlende Jun 27, 2023
a114db1
Mark class WP_Duotone as @access private
ajlende Jun 27, 2023
105bd9e
Fix theme json test string
tellthemachines Jun 28, 2023
2541786
Fix lint error
tellthemachines Jun 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix colord functions docblocks
  • Loading branch information
MaggieCabrera authored and tellthemachines committed Jun 29, 2023
commit 6dad8db896f332ef680594b184c9fb894fc04837
51 changes: 25 additions & 26 deletions src/wp-includes/class-wp-duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ private static function colord_clamp( $number, $min = 0, $max = 1 ) {
}

/**
* Direct port of colord's clampHue function.
* Processes and clamps a degree (angle) value properly.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/helpers.ts#L32
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/helpers.ts#L32 Sourced from colord.
*
* @param float $degrees The hue to clamp.
* @return float The clamped hue.
Expand All @@ -156,9 +156,9 @@ private static function colord_clamp_hue( $degrees ) {
}

/**
* Direct port of colord's parseHue function.
* Converts a hue value to degrees from 0 to 360 inclusive.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/helpers.ts#L40
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/helpers.ts#L40 Sourced from colord.
*
* @param float $value The hue value to parse.
* @param string $unit The unit of the hue value.
Expand All @@ -180,9 +180,9 @@ private static function colord_parse_hue( $value, $unit = 'deg' ) {
}

/**
* Direct port of colord's parseHex function.
* Parses any valid Hex3, Hex4, Hex6 or Hex8 string and converts it to an RGBA object
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hex.ts#L8
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hex.ts#L8 Sourced from colord.
*
* @param string $hex The hex string to parse.
* @return array|null An array of RGBA values or null if the hex string is invalid.
Expand Down Expand Up @@ -222,9 +222,9 @@ private static function colord_parse_hex( $hex ) {
}

/**
* Direct port of colord's clampRgba function.
* Clamps an array of RGBA values.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/rgb.ts#L5
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/rgb.ts#L5 Sourced from colord.
*
* @param array $rgba The RGBA array to clamp.
* @return array The clamped RGBA array.
Expand All @@ -239,9 +239,9 @@ private static function colord_clamp_rgba( $rgba ) {
}

/**
* Direct port of colord's parseRgbaString function.
* Parses a valid RGB[A] CSS color function/string
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/rgbString.ts#L18
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/rgbString.ts#L18 Sourced from colord.
*
* @param string $input The RGBA string to parse.
* @return array|null An array of RGBA values or null if the RGB string is invalid.
Expand Down Expand Up @@ -292,9 +292,9 @@ private static function colord_parse_rgba_string( $input ) {
}

/**
* Direct port of colord's clampHsla function.
* Clamps an array of HSLA values.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsl.ts#L6
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsl.ts#L6 Sourced from colord.
*
* @param array $hsla The HSLA array to clamp.
* @return array The clamped HSLA array.
Expand All @@ -309,9 +309,9 @@ private static function colord_clamp_hsla( $hsla ) {
}

/**
* Direct port of colord's hsvaToRgba function.
* Converts an HSVA array to RGBA.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsv.ts#L52
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsv.ts#L52 Sourced from colord.
*
* @param array $hsva The HSVA array to convert.
* @return array The RGBA array.
Expand All @@ -337,9 +337,9 @@ private static function colord_hsva_to_rgba( $hsva ) {
}

/**
* Direct port of colord's hslaToHsva function.
* Converts an HSLA array to HSVA.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsl.ts#L33
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsl.ts#L33 Sourced from colord.
*
* @param array $hsla The HSLA array to convert.
* @return array The HSVA array.
Expand All @@ -361,9 +361,9 @@ private static function colord_hsla_to_hsva( $hsla ) {
}

/**
* Direct port of colord's hslaToRgba function.
* Converts an HSLA array to RGBA.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsl.ts#L55
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hsl.ts#L55 Sourced from colord.
*
* @param array $hsla The HSLA array to convert.
* @return array The RGBA array.
Expand All @@ -373,9 +373,9 @@ private static function colord_hsla_to_rgba( $hsla ) {
}

/**
* Direct port of colord's parseHslaString function.
* Parses a valid HSL[A] CSS color function/string.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hslString.ts#L17
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/colorModels/hslString.ts#L17 Sourced from colord.
*
* @param string $input The HSLA string to parse.
* @return array|null An array of RGBA values or null if the RGB string is invalid.
Expand All @@ -401,7 +401,7 @@ private static function colord_parse_hsla_string( $input ) {
return null;
}

/*
/*
* For some reason, preg_match doesn't include empty matches at the end
* of the array, so we add them manually to make things easier later.
*/
Expand All @@ -424,10 +424,9 @@ private static function colord_parse_hsla_string( $input ) {
}

/**
* Direct port of colord's parse function simplified for our use case. This
* version only supports string parsing and only returns RGBA values.
* Tries to convert an incoming string into RGBA values.
*
* @see https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/parse.ts#L37
* @link https://github.com/omgovich/colord/blob/3f859e03b0ca622eb15480f611371a0f15c9427f/src/parse.ts#L37 Sourced from colord.
*
* @param string $input The string to parse.
* @return array|null An array of RGBA values or null if the string is invalid.
Expand Down Expand Up @@ -783,7 +782,7 @@ private static function get_selector( $block_name ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_name );

if ( $block_type && property_exists( $block_type, 'supports' ) ) {
/*
/*
* Backwards compatibility with `supports.color.__experimentalDuotone`
* is provided via the `block_type_metadata_settings` filter. If
* `supports.filter.duotone` has not been set and the experimental
Expand All @@ -795,7 +794,7 @@ private static function get_selector( $block_name ) {
return null;
}

/*
/*
* If the experimental duotone support was set, that value is to be
* treated as a selector and requires scoping.
*/
Expand Down