Skip to content
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

[DO NOT MERGE] [New docs] Release candidate #8099

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
59 changes: 59 additions & 0 deletions .yarn/patches/infima-npm-0.2.0-alpha.44-145834fad0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
diff --git a/dist/css/default/default.css b/dist/css/default/default.css
index 66dd808169d8697ca5de07ba260c9ee01338d855..df63274cf24a6176a66c05557aa14314b776178a 100644
--- a/dist/css/default/default.css
+++ b/dist/css/default/default.css
@@ -1165,54 +1165,6 @@ ol ol ol {
list-style-type: lower-alpha;
}

-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-table {
- border-collapse: collapse;
- display: block;
- margin-bottom: var(--ifm-spacing-vertical);
- overflow: auto;
-}
-
-table thead tr {
- border-bottom: 2px solid var(--ifm-table-border-color);
- }
-
-table thead {
- background-color: var(--ifm-table-stripe-background);
- }
-
-table tr {
- background-color: var(--ifm-table-background);
- border-top: var(--ifm-table-border-width) solid
- var(--ifm-table-border-color);
- }
-
-table tr:nth-child(2n) {
- background-color: var(--ifm-table-stripe-background);
- }
-
-table th,
- table td {
- border: var(--ifm-table-border-width) solid var(--ifm-table-border-color);
- padding: var(--ifm-table-cell-padding);
- }
-
-table th {
- background-color: var(--ifm-table-head-background);
- color: var(--ifm-table-head-color);
- font-weight: var(--ifm-table-head-font-weight);
- }
-
-table td {
- color: var(--ifm-table-cell-color);
- }
-
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@babel/core": "^7.21.8",
"jsdom": "24.1.0",
"@types/jsdom@npm:^20.0.0": "patch:@types/jsdom@npm%3A20.0.1#~/.yarn/patches/@types-jsdom-npm-20.0.1-5bb899e006.patch",
"infima@npm:0.2.0-alpha.43": "patch:infima@npm%3A0.2.0-alpha.43#~/.yarn/patches/infima-npm-0.2.0-alpha.43-8d3b77b44d.patch"
"infima@npm:0.2.0-alpha.43": "patch:infima@npm%3A0.2.0-alpha.43#~/.yarn/patches/infima-npm-0.2.0-alpha.43-8d3b77b44d.patch",
"infima@npm:0.2.0-alpha.44": "patch:infima@npm%3A0.2.0-alpha.44#~/.yarn/patches/infima-npm-0.2.0-alpha.44-145834fad0.patch"
},
"packageManager": "[email protected]"
}
4 changes: 3 additions & 1 deletion packages/docusaurus-theme/src/components/demo/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import {
UseEuiTheme,
} from '@elastic/eui';
import { css } from '@emotion/react';
import { demoDefaultScope } from '@theme/Demo/default_scope';
import { DemoContext, DemoContextObject } from './context';
import { DemoEditor } from './editor';
import { DemoPreview } from './preview';
import { DemoSource } from './source';
import { demoDefaultScope } from './scope';
import { originalScope } from './scope';
import { DemoActionsBar } from './actions_bar';
import { demoCodeTransformer } from './code_transformer';
import { DemoPreviewProps } from './preview/preview';
Expand Down Expand Up @@ -81,6 +82,7 @@ export const Demo = ({

const finalScope = useMemo(
() => ({
...originalScope,
...demoDefaultScope,
...scope,
}),
Expand Down
21 changes: 1 addition & 20 deletions packages/docusaurus-theme/src/components/demo/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,8 @@
*/

import React from 'react';
import * as EUI from '@elastic/eui';
import * as EmotionReact from '@emotion/react';

/**
* A custom client-side require() alternative to inform users it's not available
* in our demo environment
*/
const clientSideRequire = () => {
throw new Error('require() is not accessible in the interactive demo environment! All EUI and React exports are available in the global scope for you to use without the need to import them.');
}

export const demoDefaultScope: Record<string, unknown> = {
// React
export const originalScope: Record<string, unknown> = {
React,
...React,

// EUI exports
...EUI,

// Emotion
...EmotionReact,

require: clientSideRequire,
};
1 change: 1 addition & 0 deletions packages/docusaurus-theme/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

export { createDemo } from './demo';
export { Guideline, GuidelineText } from './guideline';
export { AppThemeContext } from './theme_context';
19 changes: 19 additions & 0 deletions packages/docusaurus-theme/src/theme/Demo/default_scope.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

/**
* A custom client-side require() alternative to inform users it's not available
* in our demo environment
*/
const clientSideRequire = () => {
throw new Error('require() is not accessible in the interactive demo environment! All EUI and React exports are available in the global scope for you to use without the need to import them.');
}

export const demoDefaultScope = {
require: clientSideRequire,
};
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function DocItemContent({ children }: Props): JSX.Element {
const styles = useEuiMemoizedStyles(getContentStyles);

return (
<div className={clsx(ThemeClassNames.docs.docMarkdown)}>
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
{syntheticTitle && (
<>
<header css={styles.header}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { css } from '@emotion/react';

const getOrderedListStyles = ({ euiTheme }: UseEuiTheme) => css`
margin-inline-start: ${euiTheme.size.l};
list-style: decimal;
`;

export const OrderedList = ({ children, ...restProps }: HTMLAttributes<HTMLUListElement>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { css } from '@emotion/react';

const getUnorderedListStyles = ({ euiTheme }: UseEuiTheme) => css`
margin-inline-start: ${euiTheme.size.l};
list-style: disc;
`;

export const UnorderedList = ({ children, ...restProps }: HTMLAttributes<HTMLUListElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-theme/src/theme/MDXContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { WrapperProps } from '@docusaurus/types';
type Props = WrapperProps<typeof MDXContentType>;

const MDXContent = (props: Props): JSX.Element => (
<div data-search-children="">
<div data-search-children={true}>
<OriginalMDXContent {...props} />
</div>
);
Expand Down
4 changes: 4 additions & 0 deletions packages/docusaurus-theme/src/theme/reset.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const getResetStyles = (theme: UseEuiTheme) => {
margin: 0;
}

ul, ol {
list-style: none;
}

* {
${euiFocusRing(theme, 'outset', { color: euiTheme.colors.primary })};
}
Expand Down
6 changes: 6 additions & 0 deletions packages/docusaurus-theme/src/theme/theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,9 @@ declare module '@theme/Heading' {

export default function Heading(props: Props): JSX.Element;
}

declare module '@theme/Demo/default_scope' {
export type ScopeType = Record<string, unknown>;

export const demoDefaultScope: ScopeType;
}
Loading
Loading