-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【グリッドカラムカード 】ツールバーからのリンク指定機能にnoreferrer、nofollow、link descriptionオプションを追加 #2427
Merged
goutetsuguma
merged 20 commits into
develop
from
feature/gridcolcard/empty-atag-accessibility
Feb 17, 2025
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
19e2dbd
feature: アクセシビリティ関連の修正
akito-38 203f8df
lint
akito-38 39e7d24
Correct deprecated file.
akito-38 d569eeb
リンクを張ってないカードの対応
akito-38 2e55b5c
fix deprecated
mthaichi 8a88e1b
includes関数でエラーが出ないよう修正
akito-38 152358a
lint
akito-38 8595ba7
初期値修正
akito-38 0f25b9a
Merge branch 'develop' into feature/gridcolcard/empty-atag-accessibility
mtdkei 980ce70
deprecate修正
akito-38 c388ef1
e2eテスト用ファイル追加
akito-38 9fbe908
e2eテスト用ファイル修正
akito-38 f1baa8a
Merge branch 'develop' into feature/gridcolcard/empty-atag-accessibility
mtdkei a01244b
Merge branch 'develop' into feature/gridcolcard/empty-atag-accessibility
b113116
fix:「ブロック名 + link」でなくて「ブロック名 」になっていたのを修正
akito-38 ca8d9ec
Fix: screen-reader-textを削除
akito-38 043b99e
lint
akito-38 6234fab
fix:バージョン番号修正
akito-38 abadbd9
Merge branch 'develop' into feature/gridcolcard/empty-atag-accessibility
goutetsuguma c9507a1
fix:readme修正
akito-38 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
src/blocks/_pro/gridcolcard-item/deprecated/1.95.0/save.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
import { isHexColor } from '@vkblocks/utils/is-hex-color'; | ||
import { isGradientStyle } from '@vkblocks/utils/is-gradient-style'; | ||
|
||
import classnames from 'classnames'; | ||
|
||
export default function save(props) { | ||
const { attributes } = props; | ||
const { | ||
backgroundColor, | ||
textColor, | ||
headerDisplay, | ||
footerDisplay, | ||
containerSpace, | ||
borderRadius, | ||
border, | ||
borderColor, | ||
borderWidth, | ||
backgroundGradient, | ||
url, | ||
urlOpenType, | ||
} = attributes; | ||
|
||
// カラーパレットに対応 | ||
const containerClasses = classnames('vk_gridcolcard_item', { | ||
[`vk_gridcolcard_item-noHeader`]: headerDisplay === 'delete', | ||
[`vk_gridcolcard_item-noFooter`]: footerDisplay === 'delete', | ||
[`has-background`]: !!backgroundColor, | ||
[`has-border-color`]: !!border, | ||
[`has-${backgroundColor}-background-color`]: | ||
!!backgroundColor && !isHexColor(backgroundColor), | ||
[`has-${backgroundGradient}-gradient-background`]: | ||
!!backgroundGradient && !isGradientStyle(backgroundGradient), | ||
[`has-${borderColor}-border-color`]: | ||
!!border && !!borderColor && !isHexColor(borderColor), | ||
}); | ||
|
||
const innerClasses = classnames('vk_gridcolcard_item_container', { | ||
[`has-text-color`]: !!textColor, | ||
[`has-${textColor}-color`]: !!textColor && !isHexColor(textColor), | ||
}); | ||
|
||
const style = { | ||
backgroundColor: null, | ||
border: null, | ||
}; | ||
if (borderRadius) { | ||
style.borderRadius = `${borderRadius}`; | ||
} | ||
|
||
// 背景色 | ||
if (backgroundColor && isHexColor(backgroundColor)) { | ||
// custom color | ||
style.backgroundColor = `${backgroundColor}`; | ||
} | ||
|
||
// 背景グラデーション | ||
if (backgroundGradient && isGradientStyle(backgroundGradient)) { | ||
// custom color | ||
style.background = `${backgroundGradient}`; | ||
} | ||
|
||
// 線の色と太さ | ||
if (border) { | ||
style.borderWidth = borderWidth; | ||
if (isHexColor(borderColor)) { | ||
// custom color | ||
style.borderColor = `${borderColor}`; | ||
} | ||
} | ||
|
||
// 文字色 | ||
const textColorCustom = | ||
textColor && isHexColor(textColor) ? textColor : null; | ||
|
||
const blockProps = useBlockProps.save({ | ||
className: classnames(containerClasses, { | ||
'vk_gridcolcard_item-noHeader': headerDisplay === 'delete', | ||
'vk_gridcolcard_item-noFooter': footerDisplay === 'delete', | ||
[`vk_gridcolcard_item-header-${headerDisplay}`]: | ||
headerDisplay !== 'delete', | ||
[`vk_gridcolcard_item-footer-${footerDisplay}`]: | ||
footerDisplay !== 'delete', | ||
}), | ||
style, | ||
}); | ||
|
||
const TagName = url ? 'a' : 'div'; | ||
|
||
return ( | ||
<div {...blockProps}> | ||
<TagName | ||
className={innerClasses} | ||
style={{ | ||
paddingTop: containerSpace.top, | ||
paddingBottom: containerSpace.bottom, | ||
paddingLeft: containerSpace.left, | ||
paddingRight: containerSpace.right, | ||
color: textColorCustom, | ||
}} | ||
href={url} | ||
target={urlOpenType ? '_blank' : undefined} | ||
rel={urlOpenType ? 'noopener noreferrer' : undefined} | ||
> | ||
<InnerBlocks.Content /> | ||
</TagName> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akito-38
すみません、マージしようと思ったのですが、readme.txt を改めてみたところ、今回の修正されたブロックはグリッドカードブロックのようなので、「readme の and link description options を削除」するのは、112行目の
の行の「and link description options 」なのかなと思いましたがいかがでしょうか。
お手数ですが、ご確認いただけますと幸いです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@goutetsuguma
すみません。ご指摘ありがとうございます。
修正しましたので、確認お願いいたします。