Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 103 additions & 103 deletions AGENTS.md

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions documentation/ag-grid-docs/src/components/docs/utils/pageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface Example {
internalFramework: InternalFramework;
pageName: string;
exampleName: string;
supportedFrameworks?: InternalFramework[];
}

type DocExamplePages = Awaited<ReturnType<typeof getDocsExamplePages>>;
Expand All @@ -23,6 +24,7 @@ type DocExamplePage = DocExamplePages[number]['params'] & {
hasSimpleHtml?: boolean;
scriptNonce?: string;
sourceFileList?: string[];
supportedFrameworks?: InternalFramework[];
};
type DocFrameworkExamples = Record<InternalFramework, DocExamplePage>;

Expand Down Expand Up @@ -84,19 +86,17 @@ async function getDocsExampleNameParts({ pages }: { pages: DocsPage[] }): Promis
: internalFrameworkExamples;

return filteredInternalFrameworkExamples
.flatMap((example) => {
const frameworkSupported =
example.supportedFrameworks === undefined || example.supportedFrameworks.has(example.internalFramework);

if (!frameworkSupported) {
return undefined;
}

return {
...example,
};
.filter((example) => {
return (
example.supportedFrameworks === undefined || example.supportedFrameworks.has(example.internalFramework)
);
})
.filter((e) => e !== undefined) as Example[];
.map(({ internalFramework, pageName, exampleName, supportedFrameworks }) => ({
internalFramework,
pageName,
exampleName,
supportedFrameworks: supportedFrameworks ? Array.from(supportedFrameworks) : undefined,
}));
}

export async function getDocsExamplePages({ pages }: { pages: DocsPage[] }) {
Expand All @@ -122,7 +122,7 @@ function allPropertiesAreTruthy(entries: [string, DocExamplePage][], property: k
function flattenDocsExampleContents(data: Record<string, DocFrameworkExamples>) {
return Object.values(data).map((frameworkExamples) => {
const frameworkEntries = Object.entries(frameworkExamples);
const [_, { pageName, exampleName, sourceFileList, scriptNonce }] = frameworkEntries[0];
const [_, { pageName, exampleName, sourceFileList, scriptNonce, supportedFrameworks }] = frameworkEntries[0];
const isEnterprise = allPropertiesAreTruthy(frameworkEntries, 'isEnterprise');
const isIntegratedCharts = allPropertiesAreTruthy(frameworkEntries, 'isIntegratedCharts');
const isLocale = allPropertiesAreTruthy(frameworkEntries, 'isLocale');
Expand All @@ -140,19 +140,18 @@ function flattenDocsExampleContents(data: Record<string, DocFrameworkExamples>)
hasExampleConsoleLog,
hasSimpleHtml,
scriptNonce,
supportedFrameworks,
frameworkExamples,
};
});
}

export async function getDocsExampleContents({ pages }: { pages: DocsPage[] }) {
const examples = await getDocsExamplePages({
pages,
});
const examples = await getDocsExampleNameParts({ pages });

const exampleContents: Record<string, DocFrameworkExamples> = {};
const examplePromises = examples.map(async (example) => {
const { internalFramework, pageName, exampleName } = example.params;
const { internalFramework, pageName, exampleName, supportedFrameworks } = example;
const key = `${pageName}-${exampleName}`;
if (!exampleContents[key]) {
exampleContents[key] = {} as DocFrameworkExamples;
Expand All @@ -173,7 +172,10 @@ export async function getDocsExampleContents({ pages }: { pages: DocsPage[] }) {
hasSimpleHtml: contents?.hasSimpleHtml,
sourceFileList: contents?.sourceFileList,
scriptNonce: contents?.scriptNonce,
...example.params,
internalFramework,
pageName,
exampleName,
supportedFrameworks,
};
});
await Promise.all(examplePromises);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
gap: 8px;
align-items: center;
}

.select {
width: 160px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const FrameworkSelectorInsideDocs = ({ path, currentFramework, menuItems
isPopper
options={frameworkOptions}
value={frameworkOption}
className={styles.select}
onChange={(newValue) => handleFrameworkChange(newValue.value as Framework)}
renderItem={(o) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@
bottom: 0;
width: 1px;
background-color: var(--color-util-brand-200);
transition:
width $transition-default-timing,
background-color $transition-default-timing;
transition: background-color $transition-default-timing;
}

// Dark mode: use primary border colour for inactive line
Expand All @@ -108,7 +106,7 @@

// Active items: show full 2px line using pseudo-element
&:has(:global(.active))::before {
width: 2px;
width: 1px;
background-color: var(--active-border);
}
}
Expand All @@ -118,7 +116,7 @@
background-color: var(--active-background);

&::before {
width: 2px;
width: 1px;
background-color: var(--active-border);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Icon } from '@ag-website-shared/components/icon/Icon';
import { navigate, scrollIntoViewById } from '@ag-website-shared/utils/navigation';
import { useScrollSpy } from '@components/pages-navigation/hooks/useScrollSpy';
import { addNonBreakingSpaceBetweenLastWords } from '@utils/addNonBreakingSpaceBetweenLastWords';
import type { MarkdownHeading } from 'astro';

import BackToTopIcon from '../../../images/back-to-top-icon.svg?react';
import styles from './SideNavigation.module.scss';

interface Props {
Expand Down Expand Up @@ -52,7 +52,7 @@ export function SideNavigation({ headings, delayedScrollSpy }: Props) {
navigate({ search: window.location.search, hash: 'top' });
}}
>
<BackToTopIcon className={styles.backToTopIcon} />
<Icon name="backToTop" svgClasses={styles.backToTopIcon} />
Back to top
</a>
</div>
Expand Down
30 changes: 15 additions & 15 deletions documentation/ag-grid-docs/src/pages/debug/docs-examples.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import { getCollection } from 'astro:content';
import DebugLayout from '@layouts/DebugLayout.astro';
import { getDocsExampleContents } from '@components/docs/utils/pageData';

import { DocsExamples } from '@ag-website-shared/components/docs-examples/components/DocsExamples';
import {
DocsExamples,
type ExampleProperty,
} from '@ag-website-shared/components/docs-examples/components/DocsExamples';

const pages = await getCollection('docs');
const exampleContents = await getDocsExampleContents({ pages });
const properties: ExampleProperty[] = [
'sourceFileList',
'isEnterprise',
'isIntegratedCharts',
'isLocale',
'hasExampleConsoleLog',
'hasSimpleHtml',
'scriptNonce',
'supportedFrameworks',
];
---

<DebugLayout title={`Debug: Docs Example Pages`}>
<h1>Docs Example Pages</h1>
<DocsExamples
library="grid"
client:load
exampleContents={exampleContents}
properties={[
'sourceFileList',
'isEnterprise',
'isIntegratedCharts',
'isLocale',
'hasExampleConsoleLog',
'hasSimpleHtml',
'scriptNonce',
]}
/>
<DocsExamples library="grid" client:load exampleContents={exampleContents} properties={properties} />
</DebugLayout>
2 changes: 1 addition & 1 deletion documentation/ag-grid-docs/src/types/ag-grid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type Framework = 'javascript' | 'react' | 'angular' | 'vue';

export type InternalFramework = 'vanilla' | 'typescript' | 'reactFunctional' | 'reactFunctionalTs' | 'angular' | 'vue3';

export type Library = 'charts' | 'grid' | 'dash';
export type Library = 'charts' | 'grid' | 'studio';

export interface MenuSection {
title?: string;
Expand Down
2 changes: 2 additions & 0 deletions external/ag-shared/.claude-settings.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
"enabledPlugins": {
"ag-core@ag-dev": true,
"ag-prodeng@ag-dev": true,
"ag-eng@ag-dev": true,
"ag-product@ag-dev": true,
"${PRODUCT}@ag-dev": true,
"codex@openai-codex": true,
"skill-creator@claude-plugins-official": true
Expand Down
4 changes: 2 additions & 2 deletions external/ag-shared/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/ag-grid/ag-shared.git
branch = latest
commit = d6f93e4d145bf572ede20199bcaf1094aef3cf2c
parent = 4d1c1c36341f1ce9d9b1494b38bc5c89bff0ef94
commit = 4b9d55be168c53e75143e99ec39208099f76f939
parent = 184ce2a211eb430bf97890502d19d421042bf551
method = rebase
cmdver = 0.4.9
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export type ExampleProperty =
| 'hasExampleConsoleLog'
| 'hasExampleControls'
| 'hasSimpleHtml'
| 'scriptNonce';
| 'scriptNonce'
| 'supportedFrameworks';

export interface Props {
library: Library;
Expand Down Expand Up @@ -67,6 +68,14 @@ const URL_MAPPING: Record<
production: ({ pageName, exampleName }) =>
`https://www.ag-grid.com/charts/javascript/${pageName}/#example-${exampleName}`,
},
studio: {
local: ({ pageName, exampleName }) =>
`https://localhost:4620/studio/javascript/${pageName}/#example-${exampleName}`,
staging: ({ pageName, exampleName }) =>
`https://studio-staging.ag-grid.com/javascript/${pageName}/#example-${exampleName}`,
production: ({ pageName, exampleName }) =>
`https://www.ag-grid.com/studio/javascript/${pageName}/#example-${exampleName}`,
},
};

const ALL_PROPERTIES: (ColDef & {
Expand Down Expand Up @@ -134,6 +143,23 @@ const ALL_PROPERTIES: (ColDef & {
enableRowGroup: true,
minWidth: 115,
},
{
field: 'supportedFrameworks',
headerName: 'Supported Frameworks',
enableRowGroup: true,
filter: 'agSetColumnFilter',
minWidth: 200,
valueFormatter: ({ value, node }) => {
if (node?.group) {
return '';
}
if (!value) {
return 'all';
}

return Array.isArray(value) ? value.join(', ') : value;
},
},
];

export const DocsExamples: FunctionComponent<Props> = ({ library, properties = [], exampleContents }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export function LinkCellRenderer({ colDef, data }) {
return;
}
const internalFramework = colDef.colId;
const { pageName, exampleName } = data;
const { pageName, exampleName, supportedFrameworks } = data;
if (supportedFrameworks && !supportedFrameworks.includes(internalFramework)) {
return null;
}
const titlePrefix = `${pageName} > ${exampleName} > ${internalFramework}`;

return (
Expand Down
2 changes: 2 additions & 0 deletions external/ag-website-shared/src/components/icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BackToTopIcon from '@ag-website-shared/images/inline-svgs/back-to-top-icon.svg?react';
import BoldChevronDown from '@ag-website-shared/images/inline-svgs/bold-chevron-down.svg?react';
import BoldChevronLeft from '@ag-website-shared/images/inline-svgs/bold-chevron-left.svg?react';
import BoldChevronRight from '@ag-website-shared/images/inline-svgs/bold-chevron-right.svg?react';
Expand Down Expand Up @@ -95,6 +96,7 @@ const CHARTS_ICON_MAP = {
};

export const ICON_MAP = {
backToTop: BackToTopIcon,
info: CarbonIcon.Information,
warning: CarbonIcon.WarningAlt,
creditCard: CarbonIcon.Purchase,
Expand Down
4 changes: 3 additions & 1 deletion external/ag-website-shared/src/components/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type SelectProps<O> = {
isPopper?: boolean;
isLarge?: boolean;
constrainHeight?: boolean;
className?: string;
};

export function Select<O>({
Expand All @@ -35,6 +36,7 @@ export function Select<O>({
isPopper,
isLarge,
constrainHeight,
className,
}: SelectProps<O>) {
const getOptionContent = useCallback((option: O) => {
const key = getKey(option) ?? '';
Expand Down Expand Up @@ -81,7 +83,7 @@ export function Select<O>({
<RadixSelect.Trigger
tabIndex={0}
aria-label={triggerAriaLabel}
className={classnames(styles.trigger, { [styles.large]: isLarge })}
className={classnames(styles.trigger, { [styles.large]: isLarge }, className)}
>
<RadixSelect.Value placeholder={placeholder}>{getOptionContent(value).optionContent}</RadixSelect.Value>
<RadixSelect.Icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ export const TrialLicenceFormAllFields: FunctionComponent = ({ submitUrl }: Prop
return (
<form id={ZI_FORM_ID} noValidate className={styles.trialForm} onSubmit={handleFormSubmit}>
<div className={styles.inputs}>
<input placeholder="Company" type="hidden" id="company" name="company" />
<div className={classnames('input-field')}>
<label htmlFor="company">Company (optional)</label>
<input placeholder="Company" type="text" id="company" name="company" />
</div>

<div className={classnames('input-field', styles.emailField, { 'input-error': emailError })}>
<label htmlFor="email">Email</label>
Expand Down