Skip to content

Commit

Permalink
修复英文原文显示问题,修正warning告示类型id
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianshanyao committed May 5, 2024
1 parent 05dafc5 commit e4270fe
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## getTopmostBlock

:::warn 警告
:::warning 警告
本页内容暂未经过严格测试,暂时仅用于测试本站新功能:**活塞盒**,请谨慎参考。
:::

Expand Down
16 changes: 9 additions & 7 deletions docs/changelog_source/preview/1.21/0/24/tech.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import TechSapiExp from './tech_sapi_exp.mdx';
import TechSapiStableDiff from './tech_sapi_stable_diff.md';
import TechSapiExpDiff from './tech_sapi_exp_diff.md';
import Switcher from '../../../../../components/TechChangelogSwitcher.mdx';
import {HiddenSourceText} from '../../../../../../src/components/controls/HiddenSourceText'
import {SingleItem} from '../../../../../../src/components/controls/list/SingleItem'



Expand All @@ -14,7 +16,7 @@ import Switcher from '../../../../../components/TechChangelogSwitcher.mdx';

- 更改了群系文档,使其通过不同的系统生成,这将导致文档布局和元素的顺序发生变化
<HiddenSourceText>
<li>Changed Biome documentation to generate with a different system, which will cause the layout and order of those documentation elements to change</li>
<SingleItem>Changed Biome documentation to generate with a different system, which will cause the layout and order of those documentation elements to change</SingleItem>
</HiddenSourceText>


Expand All @@ -29,22 +31,22 @@ import Switcher from '../../../../../components/TechChangelogSwitcher.mdx';

- 添加了 `addTable` API
<HiddenSourceText>
<li>Added <code>addTable</code> API</li>
<SingleItem>Added <code>addTable</code> API</SingleItem>
</HiddenSourceText>

- 修复了 `addImage` 接口的GIF资产支持
<HiddenSourceText>
<li>Fixed GIF asset support for <code>addImage</code> API</li>
<SingleItem>Fixed GIF asset support for <code>addImage</code> API</SingleItem>
</HiddenSourceText>

- 修复了视口随着UI或字体缩放异常的问题
<HiddenSourceText>
<li>Fixed a bug where the viewport did not scale properly with changes in UI or font scaling</li>
<SingleItem>Fixed a bug where the viewport did not scale properly with changes in UI or font scaling</SingleItem>
</HiddenSourceText>

- 解决了工具提示定位和内容尺寸的问题
<HiddenSourceText>
<li>Resolved tooltip positioning and content size issues</li>
<SingleItem>Resolved tooltip positioning and content size issues</SingleItem>
</HiddenSourceText>

## 常规
Expand All @@ -54,7 +56,7 @@ import Switcher from '../../../../../components/TechChangelogSwitcher.mdx';

- 实验性自由相机已被弃用。随着新功能的逐步解锁,自由摄像机预设的后续优化将会在新增的实验性设置中呈现。欲查看示例,请参阅摄像机命令的相关文档
<HiddenSourceText>
<li>The Free camera experiment has been deprecated and the toggle removed as this feature has shipped. Future improvements to the free camera preset will be found in new experimental toggles as those capabilities become available. Samples can be found in the document for the camera command.</li>
<SingleItem>The Free camera experiment has been deprecated and the toggle removed as this feature has shipped. Future improvements to the free camera preset will be found in new experimental toggles as those capabilities become available. Samples can be found in the document for the camera command.</SingleItem>
</HiddenSourceText>

## 物品
Expand All @@ -64,7 +66,7 @@ import Switcher from '../../../../../components/TechChangelogSwitcher.mdx';

- 修复了方块和物品注册为同一个id时,方块被“选取”会返回一个null物品的问题
<HiddenSourceText>
<li>Fixed a bug where, if a block and item are registered with the same identifier, the block returns a null item when 'picked'</li>
<SingleItem>Fixed a bug where, if a block and item are registered with the same identifier, the block returns a null item when 'picked'</SingleItem>
</HiddenSourceText>


Expand Down
20 changes: 6 additions & 14 deletions docs/changelog_source/preview/1.21/0/24/tech_sapi_exp.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
import {HiddenSourceText} from '../../../../../../src/components/controls/HiddenSourceText'
import GetTopmostBlock from './piston/sapi/_getTopmostBlock.mdx'
import {SingleItem} from '../../../../../../src/components/controls/list/SingleItem'

- 修复了在不蹲下的情况下无法在带有自定义组件的方块上放置方块的问题
<HiddenSourceText>
<li>Fixed issue where block with custom components could not have a block placed onto them without crouching</li>
<SingleItem>Fixed issue where block with custom components could not have a block placed onto them without crouching</SingleItem>
</HiddenSourceText>

- 添加了新接口 `VectorXZ`
<HiddenSourceText>
<li>Added new interface <code>VectorXZ</code></li>
<SingleItem>Added new interface <code>VectorXZ</code></SingleItem>
</HiddenSourceText>

- 添加了新方法 <PistonToggle content={<GetTopmostBlock/>}/> `getTopmostBlock` ,此方法将从世界顶部向下执行射线检测,尝试寻找首个固体方块
<HiddenSourceText>
<li>
Added method <code>getTopmostBlock</code> which will perform a raycast from the top of the world downwards, trying
to find the first solid block
</li>
<SingleItem>Added method <code>getTopmostBlock</code> which will perform a raycast from the top of the world downwards, trying to find the first solid block</SingleItem>
</HiddenSourceText>

- 添加了新方法 `getBlockAbove` ,此方法将从指定位置执行射线检测,尝试寻找其上方的首个固体方块
<HiddenSourceText>
<li>
Added method <code>getBlockAbove</code> which will perform a raycast from a given position, trying to find the
first solid block above
</li>
<SingleItem>Added method <code>getBlockAbove</code> which will perform a raycast from a given position, trying to find the first solid block above</SingleItem>
</HiddenSourceText>

- 添加了新方法 `getBlockBelow` ,此方法将从指定位置执行射线检测,尝试寻找其下方的首个固体方块
<HiddenSourceText>
<li>
Added method <code>getBlockBelow</code> which will perform a raycast from a given position, trying to find the
first solid block below
</li>
<SingleItem>Added method <code>getBlockBelow</code> which will perform a raycast from a given position, trying to find the first solid block below</SingleItem>
</HiddenSourceText>
10 changes: 5 additions & 5 deletions docs/changelog_source/preview/1.21/0/24/tech_sapi_stable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import {HiddenSourceText} from '../../../../../../src/components/controls/Hidden

-`entity``beta` 移动到了 `1.11.0`
<HiddenSourceText>
<li>Moved <code>entity</code> from <code>beta</code>to <code>1.11.0</code></li>
<SingleItem>Moved <code>entity</code> from <code>beta</code>to <code>1.11.0</code></SingleItem>
</HiddenSourceText>

-`EntityTameMountComponent``tame` 方法从 `beta` 移动到了 `1.11.0`
<HiddenSourceText>
<li>Moved <code>EntityTameMountComponent</code> and method <code>tame</code> from <code>beta</code> to <code>1.11.0</code></li>
<SingleItem>Moved <code>EntityTameMountComponent</code> and method <code>tame</code> from <code>beta</code> to <code>1.11.0</code></SingleItem>
</HiddenSourceText>

-`EntityAddRiderComponent``beta` 移动到了 `1.11.0`
<HiddenSourceText>
<li>Moved <code>EntityAddRiderComponent</code> from <code>beta</code> to <code>1.11.0</code></li>
<SingleItem>Moved <code>EntityAddRiderComponent</code> from <code>beta</code> to <code>1.11.0</code></SingleItem>
</HiddenSourceText>

-`Seat``beta` 移动到了 `1.11.0`
<HiddenSourceText>
<li>Moved <code>Seat</code> from <code>beta</code> to <code>1.11.0</code></li>
<SingleItem>Moved <code>Seat</code> from <code>beta</code> to <code>1.11.0</code></SingleItem>
</HiddenSourceText>

-`EntityRidingComponent``beta` 移动到了 `1.11.0`
<HiddenSourceText>
<li>Moved <code>EntityRidingComponent</code> from <code>beta</code> to <code>1.11.0</code></li>
<SingleItem>Moved <code>EntityRidingComponent</code> from <code>beta</code> to <code>1.11.0</code></SingleItem>
</HiddenSourceText>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## getTopmostBlock

:::warn Warning
:::warning Warning
The content on this page has not undergone rigorous testing and is presently intended solely for trialing the website's new feature: Piston Box.
Please exercise caution when referencing this information.
:::
Expand Down
3 changes: 2 additions & 1 deletion src/components/controls/Hidden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {usePageEventListener} from '@site/src/hooks/usePageEventListener'

interface HiddenProps {
children: React.ReactNode;
className?: string;
}

export function Hidden(props: HiddenProps) {
Expand All @@ -24,7 +25,7 @@ export function Hidden(props: HiddenProps) {
}, []);

return (
<div style={{display: isHidden ? 'none' : 'flex'}}>
<div className={props.className} style={{display: isHidden ? 'none' : 'flex'}}>
{props.children}
</div>
)
Expand Down
17 changes: 17 additions & 0 deletions src/components/controls/list/SingleItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'

export interface SingleItemProps {
children: React.ReactNode;
// default: false
keepMargin?: boolean;
}

export function SingleItem(props: SingleItemProps) {
const keepMargin = props.keepMargin ?? false;

return (
<ul className={keepMargin ? "" : "hidden-source-text"}>
<li>{props.children}</li>
</ul>
);
}
9 changes: 7 additions & 2 deletions src/css/article.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
--ifm-code-border-radius: 0.5rem;
--ifm-button-border-width: 2px;
--ifm-container-width-xl: 72vw;
/*--ifm-heading-margin-top: 0.83rem;*/
/*--ifm-heading-margin-bottom: 0;*/
--bedoc-section-bg: var(--ifm-background-color);
--bedoc-exp-title-background-color: var(--bedoc-title-background-color);
--bedoc-exp-title-color: var(--bedoc-title-color);
Expand Down Expand Up @@ -164,8 +166,10 @@ li > p {
margin-block-end: unset;
}

ul {
margin-bottom: var(--ifm-list-margin) !important;
.hidden-source-text {
/*padding-inline-start: 1rem;*/
margin-top: calc(-1 * var(--ifm-list-margin));
/*margin-bottom: var(--ifm-list-margin);*/
}

/**更新日志总标题**/
Expand Down Expand Up @@ -295,6 +299,7 @@ img[loading='lazy'] {
/*margin-left: 4px;*/
/*margin-right: 4px;*/
}

.piston-toggle-rect-outline {
border: 2px solid var(--bedoc-piston-toggle-outline-color);
transform: rotate(45deg);
Expand Down
4 changes: 3 additions & 1 deletion src/theme/MDXComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {NavHiddenSwitcher} from '@site/src/components/controls/navigation/NavHid
import {HoverOverlayPanel} from '@site/src/components/controls/overlay/HoverOverlayPanel'
import {ClickOverplayPanel} from '@site/src/components/controls/overlay/ClickOverplayPanel'
import {PistonToggle} from '@site/src/components/controls/piston/PistonToggle'
import {SingleItem} from '@site/src/components/controls/list/SingleItem'

export default {
// Re-use the default mapping
Expand All @@ -15,5 +16,6 @@ export default {
NavHiddenSwitcher,
HoverOverlayPanel,
ClickOverplayPanel,
PistonToggle
PistonToggle,
SingleItem
};

0 comments on commit e4270fe

Please sign in to comment.