code_before
stringlengths
16
1.81M
edits
stringlengths
4
328k
next_edit
stringlengths
0
76.5k
code_after
stringlengths
3
49.9M
label_window
sequencelengths
4
1.81k
instruction
stringlengths
20
51.9k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
export { KeyCombo, IKeyComboProps } from "./keyCombo"; export { HotkeysTarget, IHotkeysTarget } from "./hotkeysTarget"; export { IKeyCombo, comboMatches, getKeyCombo, getKeyComboString, parseKeyCombo } from "./hotkeyParser"; export { IHotkeysDialogProps, hideHotkeysDialog, setHotkeysDialogProps } from "./hotkeysDialog"; export interface IHotkeysProps extends IProps { /** * In order to make local hotkeys work on elements that are not normally * focusable, such as `<div>`s or `<span>`s, we add a `tabIndex` attribute
</s> remove import * as Errors from "../../common/errors"; </s> add import { ALERT_WARN_CANCEL_PROPS } from "../../common/errors"; </s> remove import { TOASTER_WARN_INLINE } from "../../common/errors"; </s> add import { TOASTER_WARN_INLINE, TOASTER_WARN_LEFT_RIGHT } from "../../common/errors"; </s> remove import * as Errors from "../../src/common/errors"; </s> add
import { HOTKEYS_HOTKEY_CHILDREN } from "../../common/errors";
export { KeyCombo, IKeyComboProps } from "./keyCombo"; export { HotkeysTarget, IHotkeysTarget } from "./hotkeysTarget"; export { IKeyCombo, comboMatches, getKeyCombo, getKeyComboString, parseKeyCombo } from "./hotkeyParser"; export { IHotkeysDialogProps, hideHotkeysDialog, setHotkeysDialogProps } from "./hotkeysDialog"; import { HOTKEYS_HOTKEY_CHILDREN } from "../../common/errors"; export interface IHotkeysProps extends IProps { /** * In order to make local hotkeys work on elements that are not normally * focusable, such as `<div>`s or `<span>`s, we add a `tabIndex` attribute
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/src/components/hotkeys/hotkeys.tsx
} protected validateProps(props: IHotkeysProps & { children: React.ReactNode }) { Children.forEach(props.children, (child) => { if (typeof child !== "object" || !Hotkey.isInstance(child)) { throw new Error("Hotkeys only accepts <Hotkey> children"); } }); } }
</s> remove throw new Error(`Handle requires number for ${prop} prop`); </s> add throw new Error(`[Blueprint] <Handle> requires number value for ${prop} prop`); </s> remove throw new Error(Errors.MENU_CHILDREN_SUBMENU_MUTEX); </s> add console.warn(Errors.MENU_WARN_CHILDREN_SUBMENU_MUTEX); </s> remove throw new Error(Errors.ALERT_CANCEL_PROPS); </s> add console.warn(ALERT_WARN_CANCEL_PROPS); </s> remove throw new Error("Toaster does not support LEFT or RIGHT positions."); </s> add console.warn(TOASTER_WARN_LEFT_RIGHT);
if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN);
} protected validateProps(props: IHotkeysProps & { children: React.ReactNode }) { Children.forEach(props.children, (child) => { if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN); if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN); } }); } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/src/components/hotkeys/hotkeys.tsx
} protected validateProps(props: IMenuItemProps & {children?: React.ReactNode}) { if (props.children != null && props.submenu != null) { throw new Error(Errors.MENU_CHILDREN_SUBMENU_MUTEX); } } private liRefHandler = (r: HTMLElement) => this.liElement = r;
</s> remove throw new Error(Errors.ALERT_CANCEL_PROPS); </s> add console.warn(ALERT_WARN_CANCEL_PROPS); </s> remove const menu = this.renderContextMenu(e); if (menu != null) { e.preventDefault(); ContextMenu.show(menu, { left: e.clientX, top: e.clientY }, onContextMenuClose); </s> add if (isFunction(this.renderContextMenu)) { const menu = this.renderContextMenu(e); if (menu != null) { e.preventDefault(); ContextMenu.show(menu, { left: e.clientX, top: e.clientY }, onContextMenuClose); } </s> remove if (typeof child !== "object" || !Hotkey.isInstance(child)) { throw new Error("Hotkeys only accepts <Hotkey> children"); </s> add if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN); </s> remove throw new Error(`Handle requires number for ${prop} prop`); </s> add throw new Error(`[Blueprint] <Handle> requires number value for ${prop} prop`); </s> remove public static isInstance(element: ReactElement<any>): element is ReactElement<IHotkeyProps> { return element.type === Hotkey; </s> add public static isInstance(element: any): element is ReactElement<IHotkeyProps> { return element != null && (element as JSX.Element).type === Hotkey;
console.warn(Errors.MENU_WARN_CHILDREN_SUBMENU_MUTEX);
} protected validateProps(props: IMenuItemProps & {children?: React.ReactNode}) { if (props.children != null && props.submenu != null) { console.warn(Errors.MENU_WARN_CHILDREN_SUBMENU_MUTEX); } } private liRefHandler = (r: HTMLElement) => this.liElement = r;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/src/components/menu/menuItem.tsx
protected validateProps(props: IHandleProps) { for (const prop of NUMBER_PROPS) { if (typeof (props as any)[prop] !== "number") { throw new Error(`Handle requires number for ${prop} prop`); } } } private endHandleMovement = (event: MouseEvent) => {
</s> remove if (typeof child !== "object" || !Hotkey.isInstance(child)) { throw new Error("Hotkeys only accepts <Hotkey> children"); </s> add if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN); </s> remove throw new Error(Errors.MENU_CHILDREN_SUBMENU_MUTEX); </s> add console.warn(Errors.MENU_WARN_CHILDREN_SUBMENU_MUTEX); </s> remove throw new Error(Errors.ALERT_CANCEL_PROPS); </s> add console.warn(ALERT_WARN_CANCEL_PROPS); </s> remove throw new Error("Toaster does not support LEFT or RIGHT positions."); </s> add console.warn(TOASTER_WARN_LEFT_RIGHT); </s> remove throw new Error("clamp: max cannot be less than min"); </s> add throw new Error(CLAMP_MIN_MAX);
throw new Error(`[Blueprint] <Handle> requires number value for ${prop} prop`);
protected validateProps(props: IHandleProps) { for (const prop of NUMBER_PROPS) { if (typeof (props as any)[prop] !== "number") { throw new Error(`[Blueprint] <Handle> requires number value for ${prop} prop`); } } } private endHandleMovement = (event: MouseEvent) => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/src/components/slider/handle.tsx
import * as ReactDOM from "react-dom"; import { AbstractComponent } from "../../common/abstractComponent"; import * as Classes from "../../common/classes"; import { TOASTER_WARN_INLINE } from "../../common/errors"; import { ESCAPE } from "../../common/keys"; import { Position } from "../../common/position"; import { IProps } from "../../common/props"; import { isNodeEnv, safeInvoke } from "../../common/utils"; import { Overlay } from "../overlay/overlay";
</s> remove import * as Errors from "../../common/errors"; </s> add import { ALERT_WARN_CANCEL_PROPS } from "../../common/errors"; </s> remove import * as Errors from "../../src/common/errors"; </s> add
import { TOASTER_WARN_INLINE, TOASTER_WARN_LEFT_RIGHT } from "../../common/errors";
import * as ReactDOM from "react-dom"; import { AbstractComponent } from "../../common/abstractComponent"; import * as Classes from "../../common/classes"; import { TOASTER_WARN_INLINE, TOASTER_WARN_LEFT_RIGHT } from "../../common/errors"; import { ESCAPE } from "../../common/keys"; import { Position } from "../../common/position"; import { IProps } from "../../common/props"; import { isNodeEnv, safeInvoke } from "../../common/utils"; import { Overlay } from "../overlay/overlay";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/src/components/toast/toaster.tsx
} protected validateProps(props: IToasterProps) { if (props.position === Position.LEFT || props.position === Position.RIGHT) { throw new Error("Toaster does not support LEFT or RIGHT positions."); } } private renderToast(toast: IToastOptions) { return <Toast {...toast} onDismiss={this.getDismissHandler(toast)} />;
</s> remove throw new Error(Errors.ALERT_CANCEL_PROPS); </s> add console.warn(ALERT_WARN_CANCEL_PROPS); </s> remove if (typeof child !== "object" || !Hotkey.isInstance(child)) { throw new Error("Hotkeys only accepts <Hotkey> children"); </s> add if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN); </s> remove public static isInstance(element: ReactElement<any>): element is ReactElement<IHotkeyProps> { return element.type === Hotkey; </s> add public static isInstance(element: any): element is ReactElement<IHotkeyProps> { return element != null && (element as JSX.Element).type === Hotkey; </s> remove // class TypeScriptFail extends React.Component<{}, {}> { </s> add // return class TypeScriptFail extends React.Component<{}, {}> { </s> remove throw new Error(Errors.MENU_CHILDREN_SUBMENU_MUTEX); </s> add console.warn(Errors.MENU_WARN_CHILDREN_SUBMENU_MUTEX);
console.warn(TOASTER_WARN_LEFT_RIGHT);
} protected validateProps(props: IToasterProps) { if (props.position === Position.LEFT || props.position === Position.RIGHT) { console.warn(TOASTER_WARN_LEFT_RIGHT); } } private renderToast(toast: IToastOptions) { return <Toast {...toast} onDismiss={this.getDismissHandler(toast)} />;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/src/components/toast/toaster.tsx
/* -- uncomment this test to confirm compilation failure -- */ // it("TypeScript compilation fails if decorated class does not implement renderContextMenu", () => { // @ContextMenuTarget // class TypeScriptFail extends React.Component<{}, {}> { // public render() { return <article />; } // } // }); }); });
</s> remove throw new Error(`@ContextMenuTarget-decorated class must implement \`renderContextMenu\`. ${constructor}`); </s> add console.warn(CONTEXTMENU_WARN_DECORATOR_NO_METHOD); </s> remove throw new Error("Toaster does not support LEFT or RIGHT positions."); </s> add console.warn(TOASTER_WARN_LEFT_RIGHT); </s> remove public static isInstance(element: ReactElement<any>): element is ReactElement<IHotkeyProps> { return element.type === Hotkey; </s> add public static isInstance(element: any): element is ReactElement<IHotkeyProps> { return element != null && (element as JSX.Element).type === Hotkey; </s> remove if (typeof child !== "object" || !Hotkey.isInstance(child)) { throw new Error("Hotkeys only accepts <Hotkey> children"); </s> add if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN);
// return class TypeScriptFail extends React.Component<{}, {}> {
/* -- uncomment this test to confirm compilation failure -- */ // it("TypeScript compilation fails if decorated class does not implement renderContextMenu", () => { // @ContextMenuTarget // return class TypeScriptFail extends React.Component<{}, {}> { // public render() { return <article />; } // } // }); }); });
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/context-menu/contextMenuTests.tsx
import * as ReactDOM from "react-dom"; import { comboMatches, getKeyCombo, getKeyComboString, hideHotkeysDialog,
</s> remove import * as Errors from "../../src/common/errors"; </s> add </s> remove import { TOASTER_WARN_INLINE } from "../../common/errors"; </s> add import { TOASTER_WARN_INLINE, TOASTER_WARN_LEFT_RIGHT } from "../../common/errors"; </s> remove import * as Errors from "../../common/errors"; </s> add import { ALERT_WARN_CANCEL_PROPS } from "../../common/errors";
import { HOTKEYS_HOTKEY_CHILDREN } from "../../src/common/errors";
import * as ReactDOM from "react-dom"; import { HOTKEYS_HOTKEY_CHILDREN } from "../../src/common/errors"; import { comboMatches, getKeyCombo, getKeyComboString, hideHotkeysDialog,
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/hotkeys/hotkeysTests.tsx
describe("Hotkeys", () => { describe("Local/Global @HotkeysTarget", () => { let localHotkeySpy: Sinon.SinonSpy = null; let globalHotkeySpy: Sinon.SinonSpy = null;
</s> remove it("throws error if given children and submenu", () => { assert.throws(() => shallow( </s> add it("renders children if given children and submenu", () => { const wrapper = shallow( </s> remove ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); </s> add ); const submenu = findSubmenu(wrapper); assert.lengthOf(submenu.props.children, 2); </s> remove <MenuItem text="bar" /> </s> add <MenuItem text="one" /> <MenuItem text="two" /> </s> remove import * as Errors from "../../src/common/errors"; </s> add </s> remove // class TypeScriptFail extends React.Component<{}, {}> { </s> add // return class TypeScriptFail extends React.Component<{}, {}> {
it("throws error if given non-Hotkey child", () => { expect(() => mount(<Hotkeys><div /></Hotkeys>)).to.throw(HOTKEYS_HOTKEY_CHILDREN, "element"); expect(() => mount(<Hotkeys>string contents</Hotkeys>)).to.throw(HOTKEYS_HOTKEY_CHILDREN, "string"); expect(() => mount(<Hotkeys>{undefined}{null}</Hotkeys>)).to.throw(HOTKEYS_HOTKEY_CHILDREN, "undefined"); });
describe("Hotkeys", () => { it("throws error if given non-Hotkey child", () => { expect(() => mount(<Hotkeys><div /></Hotkeys>)).to.throw(HOTKEYS_HOTKEY_CHILDREN, "element"); expect(() => mount(<Hotkeys>string contents</Hotkeys>)).to.throw(HOTKEYS_HOTKEY_CHILDREN, "string"); expect(() => mount(<Hotkeys>{undefined}{null}</Hotkeys>)).to.throw(HOTKEYS_HOTKEY_CHILDREN, "undefined"); }); describe("Local/Global @HotkeysTarget", () => { let localHotkeySpy: Sinon.SinonSpy = null; let globalHotkeySpy: Sinon.SinonSpy = null;
[ "keep", "add", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/hotkeys/hotkeysTests.tsx
import * as React from "react"; import * as TestUtils from "react-addons-test-utils"; import * as ReactDOM from "react-dom"; import * as Errors from "../../src/common/errors"; import { Classes, IMenuItemProps, IMenuProps, Menu, MenuDivider, MenuItem, Popover } from "../../src/index"; import { MenuDividerFactory, MenuFactory, MenuItemFactory } from "../../src/index"; describe("MenuItem", () => { it("React renders MenuItem", () => {
</s> remove import * as Errors from "../../common/errors"; </s> add import { ALERT_WARN_CANCEL_PROPS } from "../../common/errors"; </s> remove import { TOASTER_WARN_INLINE } from "../../common/errors"; </s> add import { TOASTER_WARN_INLINE, TOASTER_WARN_LEFT_RIGHT } from "../../common/errors";
import * as React from "react"; import * as TestUtils from "react-addons-test-utils"; import * as ReactDOM from "react-dom"; import { Classes, IMenuItemProps, IMenuProps, Menu, MenuDivider, MenuItem, Popover } from "../../src/index"; import { MenuDividerFactory, MenuFactory, MenuItemFactory } from "../../src/index"; describe("MenuItem", () => { it("React renders MenuItem", () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/menu/menuTests.tsx
); assert.isTrue(wrapper.find(Popover).prop("isDisabled")); }); it("throws error if given children and submenu", () => { assert.throws(() => shallow( <MenuItem iconName="style" text="Style" submenu={[{text: "foo"}]}> <MenuItem text="bar" /> </MenuItem>, ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); });
</s> remove <MenuItem text="bar" /> </s> add <MenuItem text="one" /> <MenuItem text="two" /> </s> remove ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); </s> add ); const submenu = findSubmenu(wrapper); assert.lengthOf(submenu.props.children, 2); </s> remove // class TypeScriptFail extends React.Component<{}, {}> { </s> add // return class TypeScriptFail extends React.Component<{}, {}> { </s> remove if (typeof child !== "object" || !Hotkey.isInstance(child)) { throw new Error("Hotkeys only accepts <Hotkey> children"); </s> add if (!Hotkey.isInstance(child)) { throw new Error(HOTKEYS_HOTKEY_CHILDREN);
it("renders children if given children and submenu", () => { const wrapper = shallow(
); assert.isTrue(wrapper.find(Popover).prop("isDisabled")); }); it("renders children if given children and submenu", () => { const wrapper = shallow( it("renders children if given children and submenu", () => { const wrapper = shallow( <MenuItem iconName="style" text="Style" submenu={[{text: "foo"}]}> <MenuItem text="bar" /> </MenuItem>, ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); });
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/menu/menuTests.tsx
it("throws error if given children and submenu", () => { assert.throws(() => shallow( <MenuItem iconName="style" text="Style" submenu={[{text: "foo"}]}> <MenuItem text="bar" /> </MenuItem>, ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); }); it("Clicking MenuItem triggers onClick prop", () => {
</s> remove it("throws error if given children and submenu", () => { assert.throws(() => shallow( </s> add it("renders children if given children and submenu", () => { const wrapper = shallow( </s> remove ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); </s> add ); const submenu = findSubmenu(wrapper); assert.lengthOf(submenu.props.children, 2); </s> remove // class TypeScriptFail extends React.Component<{}, {}> { </s> add // return class TypeScriptFail extends React.Component<{}, {}> { </s> remove import * as Errors from "../../src/common/errors"; </s> add
<MenuItem text="one" /> <MenuItem text="two" />
it("throws error if given children and submenu", () => { assert.throws(() => shallow( <MenuItem iconName="style" text="Style" submenu={[{text: "foo"}]}> <MenuItem text="one" /> <MenuItem text="two" /> </MenuItem>, ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); }); it("Clicking MenuItem triggers onClick prop", () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/menu/menuTests.tsx
assert.throws(() => shallow( <MenuItem iconName="style" text="Style" submenu={[{text: "foo"}]}> <MenuItem text="bar" /> </MenuItem>, ), Errors.MENU_CHILDREN_SUBMENU_MUTEX); }); it("Clicking MenuItem triggers onClick prop", () => { const onClick = sinon.spy(); shallow(<MenuItem text="Graph" onClick={onClick} />).find("a").simulate("click");
</s> remove <MenuItem text="bar" /> </s> add <MenuItem text="one" /> <MenuItem text="two" /> </s> remove it("throws error if given children and submenu", () => { assert.throws(() => shallow( </s> add it("renders children if given children and submenu", () => { const wrapper = shallow( </s> remove // class TypeScriptFail extends React.Component<{}, {}> { </s> add // return class TypeScriptFail extends React.Component<{}, {}> { </s> remove import * as Errors from "../../src/common/errors"; </s> add
); const submenu = findSubmenu(wrapper); assert.lengthOf(submenu.props.children, 2);
assert.throws(() => shallow( <MenuItem iconName="style" text="Style" submenu={[{text: "foo"}]}> <MenuItem text="bar" /> </MenuItem>, ); const submenu = findSubmenu(wrapper); assert.lengthOf(submenu.props.children, 2); }); it("Clicking MenuItem triggers onClick prop", () => { const onClick = sinon.spy(); shallow(<MenuItem text="Graph" onClick={onClick} />).find("a").simulate("click");
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
Convert more errors to warnings (#981) * MenuItem warns about children/submenu * ContextMenuTarget only warns if missing method * Toaster, Alert warnings + message language edits * fix Hotkey type guard to first check existence
https://github.com/palantir/blueprint/commit/a8ac6f4f3b7ca45d89fb59ff18900cf05714fba4
packages/core/test/menu/menuTests.tsx
// popover content should ignore pointer events during a popover's exit transition &.pt-popover-leave .pt-popover-content { pointer-events: none; } } .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top;
</s> remove .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top; </s> add // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } </s> remove .pt-popover-target { </s> add .pt-popover-wrapper { </s> remove // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526) // example: <Popover><Tooltip><button /></Tooltip></Popover> > .pt-popover-target { display: inline-block; } </s> add </s> remove .pt-button-group { &.pt-vertical .pt-popover-target { display: block; } &:not(.pt-vertical) { // make all containers float left to ensure proper sizing .pt-popover-target, .pt-tether-target { float: left; } } </s> add .pt-button-group .pt-popover-target { display: block;
// popover content should ignore pointer events during a popover's exit transition &.pt-popover-leave .pt-popover-content { pointer-events: none; } .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
remove pt-popover-target styles to fix input shadow clipping (#2282)
https://github.com/palantir/blueprint/commit/aa231bd21c47ad78f2fd31e2c163a126cc497feb
packages/core/src/components/popover/_popover.scss
pointer-events: none; } } .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top; } .pt-popover-target { display: inline-block; position: relative;
</s> remove } </s> add </s> remove .pt-popover-target { </s> add .pt-popover-wrapper { </s> remove // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526) // example: <Popover><Tooltip><button /></Tooltip></Popover> > .pt-popover-target { display: inline-block; } </s> add </s> remove .pt-button-group { &.pt-vertical .pt-popover-target { display: block; } &:not(.pt-vertical) { // make all containers float left to ensure proper sizing .pt-popover-target, .pt-tether-target { float: left; } } </s> add .pt-button-group .pt-popover-target { display: block;
// Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; }
pointer-events: none; } } // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } } .pt-popover-target { display: inline-block; position: relative;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
remove pt-popover-target styles to fix input shadow clipping (#2282)
https://github.com/palantir/blueprint/commit/aa231bd21c47ad78f2fd31e2c163a126cc497feb
packages/core/src/components/popover/_popover.scss
position: relative; vertical-align: top; } .pt-popover-target { display: inline-block; position: relative; vertical-align: top; // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526)
</s> remove // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526) // example: <Popover><Tooltip><button /></Tooltip></Popover> > .pt-popover-target { display: inline-block; } </s> add </s> remove .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top; </s> add // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } </s> remove } </s> add </s> remove .pt-button-group { &.pt-vertical .pt-popover-target { display: block; } &:not(.pt-vertical) { // make all containers float left to ensure proper sizing .pt-popover-target, .pt-tether-target { float: left; } } </s> add .pt-button-group .pt-popover-target { display: block;
.pt-popover-wrapper {
position: relative; vertical-align: top; } .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top; // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
remove pt-popover-target styles to fix input shadow clipping (#2282)
https://github.com/palantir/blueprint/commit/aa231bd21c47ad78f2fd31e2c163a126cc497feb
packages/core/src/components/popover/_popover.scss
display: inline-block; position: relative; vertical-align: top; // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526) // example: <Popover><Tooltip><button /></Tooltip></Popover> > .pt-popover-target { display: inline-block; } // position the transition container using CSS when it is inline .pt-transition-container { @include popover-inline-position(); }
</s> remove .pt-popover-target { </s> add .pt-popover-wrapper { </s> remove .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top; </s> add // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } </s> remove } </s> add </s> remove .pt-button-group { &.pt-vertical .pt-popover-target { display: block; } &:not(.pt-vertical) { // make all containers float left to ensure proper sizing .pt-popover-target, .pt-tether-target { float: left; } } </s> add .pt-button-group .pt-popover-target { display: block;
display: inline-block; position: relative; vertical-align: top; // position the transition container using CSS when it is inline .pt-transition-container { @include popover-inline-position(); }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
remove pt-popover-target styles to fix input shadow clipping (#2282)
https://github.com/palantir/blueprint/commit/aa231bd21c47ad78f2fd31e2c163a126cc497feb
packages/core/src/components/popover/_popover.scss
} } // fix positioning of popovers inside button groups (lots of extra nested elements) .pt-button-group { &.pt-vertical .pt-popover-target { display: block; } &:not(.pt-vertical) { // make all containers float left to ensure proper sizing .pt-popover-target, .pt-tether-target { float: left; } } }
</s> remove .pt-popover-wrapper { display: inline-block; position: relative; vertical-align: top; </s> add // Popper.js applies this attribute when the target fully leaves boundaries &[data-x-out-of-boundaries] { display: none; } </s> remove // avoid tether positioning bugs when nesting `display: inline` targets (BLUEPRINT-526) // example: <Popover><Tooltip><button /></Tooltip></Popover> > .pt-popover-target { display: inline-block; } </s> add </s> remove } </s> add </s> remove .pt-popover-target { </s> add .pt-popover-wrapper {
.pt-button-group .pt-popover-target { display: block;
} } // fix positioning of popovers inside button groups (lots of extra nested elements) .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; .pt-button-group .pt-popover-target { display: block; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep" ]
remove pt-popover-target styles to fix input shadow clipping (#2282)
https://github.com/palantir/blueprint/commit/aa231bd21c47ad78f2fd31e2c163a126cc497feb
packages/core/src/components/popover/_popover.scss
} flex-direction: $direction; > * { flex: 0 0 auto; } > #{$fill} { flex: 1 1 auto; }
</s> remove flex: 1 1 auto; </s> add flex-grow: 1; flex-shrink: 1; </s> remove margin: 0; </s> add </s> remove width: $content-width; </s> add box-shadow: $pt-elevation-shadow-4; background: $sidebar-background-color; width: 50vw; min-width: $pt-grid-size * 50; max-width: $pt-grid-size * 80; padding: 0; </s> remove .pt-navbar.docs-navbar { box-shadow: $navbar-box-shadow; background-color: $content-background-color; padding-right: $sidebar-padding; padding-left: 0; .pt-navbar-group { padding-left: $pt-grid-size; &-left { // allow extra space for long version strings width: $sidebar-width + ($pt-grid-size * 2); padding-left: 0; } // last child fills remaining space and right-aligns children &-right { flex: 1 1 auto; justify-content: flex-end; } } </s> add @mixin divider-gradient($color, $dark-color) { background-image: linear-gradient(to right, rgba($color, 0) 0%, $color 40%);
flex-grow: 0; flex-shrink: 0;
} flex-direction: $direction; > * { flex-grow: 0; flex-shrink: 0; } > #{$fill} { flex: 1 1 auto; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/core/src/common/_flex.scss
flex: 0 0 auto; } > #{$fill} { flex: 1 1 auto; } @if $margin != none { @include pt-flex-margin($direction, $margin); }
</s> remove flex: 0 0 auto; </s> add flex-grow: 0; flex-shrink: 0; </s> remove margin: 0; </s> add </s> remove .pt-navbar.docs-navbar { box-shadow: $navbar-box-shadow; background-color: $content-background-color; padding-right: $sidebar-padding; padding-left: 0; .pt-navbar-group { padding-left: $pt-grid-size; &-left { // allow extra space for long version strings width: $sidebar-width + ($pt-grid-size * 2); padding-left: 0; } // last child fills remaining space and right-aligns children &-right { flex: 1 1 auto; justify-content: flex-end; } } </s> add @mixin divider-gradient($color, $dark-color) { background-image: linear-gradient(to right, rgba($color, 0) 0%, $color 40%);
flex-grow: 1; flex-shrink: 1;
flex: 0 0 auto; } > #{$fill} { flex-grow: 1; flex-shrink: 1; } @if $margin != none { @include pt-flex-margin($direction, $margin); }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/core/src/common/_flex.scss
Markup: <label class="pt-label {{.modifier}}"> Label A <span class="pt-text-muted">(required)</span> <input class="pt-input" style="width: 200px;" type="text" placeholder="Text input" dir="auto" /> </label> <label class="pt-label {{.modifier}}"> Label B <span class="pt-text-muted">(optional)</span> <div class="pt-input-group">
</s> remove <input class="pt-input" style="width: 200px;" type="text" placeholder="Input group" dir="auto" /> </s> add <input class="pt-input" style="width: 180px;" type="text" placeholder="Input group" dir="auto" /> </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </s> remove <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </s> add </s> remove <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId} activeSectionId={activeSectionId} onItemClick={this.handleNavigation} /> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> </s> add <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> </s> remove <div className="docs-interface-table"> {renderBlock(data.documentation)} <p className="docs-code">= {renderType(data.type)}</p> </div> </s> add {renderBlock(data.documentation)} <div className="docs-type-alias docs-code">{aliases}</div>
<input class="pt-input" style="width: 180px;" type="text" placeholder="Text input" dir="auto" />
Markup: <label class="pt-label {{.modifier}}"> Label A <span class="pt-text-muted">(required)</span> <input class="pt-input" style="width: 180px;" type="text" placeholder="Text input" dir="auto" /> </label> <label class="pt-label {{.modifier}}"> Label B <span class="pt-text-muted">(optional)</span> <div class="pt-input-group">
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/core/src/components/forms/_label.scss
Label B <span class="pt-text-muted">(optional)</span> <div class="pt-input-group"> <span class="pt-icon pt-icon-calendar"></span> <input class="pt-input" style="width: 200px;" type="text" placeholder="Input group" dir="auto" /> </div> </label> .pt-inline - Inline
</s> remove <input class="pt-input" style="width: 200px;" type="text" placeholder="Text input" dir="auto" /> </s> add <input class="pt-input" style="width: 180px;" type="text" placeholder="Text input" dir="auto" /> </s> remove <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </s> add </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </s> remove <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId} activeSectionId={activeSectionId} onItemClick={this.handleNavigation} /> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> </s> add <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> </s> remove <div className="docs-interface-table"> {renderBlock(data.documentation)} <p className="docs-code">= {renderType(data.type)}</p> </div> </s> add {renderBlock(data.documentation)} <div className="docs-type-alias docs-code">{aliases}</div>
<input class="pt-input" style="width: 180px;" type="text" placeholder="Input group" dir="auto" />
Label B <span class="pt-text-muted">(optional)</span> <div class="pt-input-group"> <span class="pt-icon pt-icon-calendar"></span> <input class="pt-input" style="width: 180px;" type="text" placeholder="Input group" dir="auto" /> </div> </label> .pt-inline - Inline
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/core/src/components/forms/_label.scss
* * Licensed under the terms of the LICENSE file distributed with this project. */ import { Icon, Menu, MenuItem, Popover, Position, setHotkeysDialogProps } from "@blueprintjs/core"; import { IPackageInfo } from "@blueprintjs/docs-data"; import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; import * as React from "react"; import { NavbarActions } from "./navbarActions";
</s> remove import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; </s> add import { Banner, Documentation, IDocumentationProps, INavMenuItemProps, NavMenuItem } from "@blueprintjs/docs-theme"; import classNames from "classnames"; import { isPageNode, ITsDocBase } from "documentalist/dist/client"; </s> remove import { Classes, Hotkey, Hotkeys, HotkeysTarget, InputGroup, Keys, Popover, Position, Utils } from "@blueprintjs/core"; import { IconContents } from "@blueprintjs/icons"; </s> add import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select"; </s> remove import { NavbarActions } from "./navbarActions"; </s> add import { NavHeader } from "./navHeader"; import { NavIcon } from "./navIcons"; </s> remove import { Icon } from "@blueprintjs/core"; </s> add import { AnchorButton, Classes, Intent } from "@blueprintjs/core";
import { Classes, setHotkeysDialogProps } from "@blueprintjs/core";
* * Licensed under the terms of the LICENSE file distributed with this project. */ import { Classes, setHotkeysDialogProps } from "@blueprintjs/core"; import { IPackageInfo } from "@blueprintjs/docs-data"; import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; import * as React from "react"; import { NavbarActions } from "./navbarActions";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
*/ import { Icon, Menu, MenuItem, Popover, Position, setHotkeysDialogProps } from "@blueprintjs/core"; import { IPackageInfo } from "@blueprintjs/docs-data"; import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; import * as React from "react"; import { NavbarActions } from "./navbarActions"; const DARK_THEME = "pt-dark"; const LIGHT_THEME = "";
</s> remove import { Icon, Menu, MenuItem, Popover, Position, setHotkeysDialogProps } from "@blueprintjs/core"; </s> add import { Classes, setHotkeysDialogProps } from "@blueprintjs/core"; </s> remove import { NavbarActions } from "./navbarActions"; </s> add import { NavHeader } from "./navHeader"; import { NavIcon } from "./navIcons"; </s> remove import { Classes, Hotkey, Hotkeys, HotkeysTarget, InputGroup, Keys, Popover, Position, Utils } from "@blueprintjs/core"; import { IconContents } from "@blueprintjs/icons"; </s> add import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select";
import { Banner, Documentation, IDocumentationProps, INavMenuItemProps, NavMenuItem } from "@blueprintjs/docs-theme"; import classNames from "classnames"; import { isPageNode, ITsDocBase } from "documentalist/dist/client";
*/ import { Icon, Menu, MenuItem, Popover, Position, setHotkeysDialogProps } from "@blueprintjs/core"; import { IPackageInfo } from "@blueprintjs/docs-data"; import { Banner, Documentation, IDocumentationProps, INavMenuItemProps, NavMenuItem } from "@blueprintjs/docs-theme"; import classNames from "classnames"; import { isPageNode, ITsDocBase } from "documentalist/dist/client"; import { Banner, Documentation, IDocumentationProps, INavMenuItemProps, NavMenuItem } from "@blueprintjs/docs-theme"; import classNames from "classnames"; import { isPageNode, ITsDocBase } from "documentalist/dist/client"; import * as React from "react"; import { NavbarActions } from "./navbarActions"; const DARK_THEME = "pt-dark"; const LIGHT_THEME = "";
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
import { IPackageInfo } from "@blueprintjs/docs-data"; import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; import * as React from "react"; import { NavbarActions } from "./navbarActions"; const DARK_THEME = "pt-dark"; const LIGHT_THEME = ""; const THEME_LOCAL_STORAGE_KEY = "pt-blueprint-theme";
</s> remove import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; </s> add import { Banner, Documentation, IDocumentationProps, INavMenuItemProps, NavMenuItem } from "@blueprintjs/docs-theme"; import classNames from "classnames"; import { isPageNode, ITsDocBase } from "documentalist/dist/client"; </s> remove import { Icon, Menu, MenuItem, Popover, Position, setHotkeysDialogProps } from "@blueprintjs/core"; </s> add import { Classes, setHotkeysDialogProps } from "@blueprintjs/core"; </s> remove import { findDOMNode } from "react-dom"; </s> add
import { NavHeader } from "./navHeader"; import { NavIcon } from "./navIcons";
import { IPackageInfo } from "@blueprintjs/docs-data"; import { Banner, Documentation, IDocumentationProps } from "@blueprintjs/docs-theme"; import { ITsDocBase } from "documentalist/dist/client"; import * as React from "react"; import { NavHeader } from "./navHeader"; import { NavIcon } from "./navIcons"; const DARK_THEME = "pt-dark"; const LIGHT_THEME = ""; const THEME_LOCAL_STORAGE_KEY = "pt-blueprint-theme";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
export class BlueprintDocs extends React.Component<IBlueprintDocsProps, { themeName: string }> { public state = { themeName: getTheme() }; public render() { const navbarLeft = [ <a className="docs-logo" href="/" key="_logo" />, <div className="pt-navbar-heading docs-heading" key="_title"> Blueprint </div>, this.renderVersionsMenu(), ]; const navbarRight = ( <NavbarActions onToggleDark={this.handleToggleDark} releases={this.props.releases} useDarkTheme={this.state.themeName === DARK_THEME} /> );
</s> remove releases={this.props.releases} </s> add </s> remove public static defaultProps = { navbarLeft: "Documentation", }; </s> add </s> remove const examplesOnly = location.search === "?examples"; </s> add const rootClasses = classNames( "docs-root", { "docs-examples-only": location.search === "?examples" }, this.props.className, ); const apiClasses = classNames("docs-api-overlay", this.props.className); </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}>
const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader
export class BlueprintDocs extends React.Component<IBlueprintDocsProps, { themeName: string }> { public state = { themeName: getTheme() }; public render() { const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader onToggleDark={this.handleToggleDark} releases={this.props.releases} useDarkTheme={this.state.themeName === DARK_THEME} /> );
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
]; const navbarRight = ( <NavbarActions onToggleDark={this.handleToggleDark} releases={this.props.releases} useDarkTheme={this.state.themeName === DARK_THEME} /> ); return ( <>
</s> remove const navbarLeft = [ <a className="docs-logo" href="/" key="_logo" />, <div className="pt-navbar-heading docs-heading" key="_title"> Blueprint </div>, this.renderVersionsMenu(), ]; const navbarRight = ( <NavbarActions </s> add const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader </s> remove <> <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> <Documentation {...this.props} className={this.state.themeName} navbarLeft={navbarLeft} navbarRight={navbarRight} onComponentUpdate={this.handleComponentUpdate} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </> </s> add <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </s> remove <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> </s> add <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> </s> remove <div className="pt-text-muted" key="_versions"> v{versions[0].version} </s> add <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )}
]; const navbarRight = ( <NavbarActions onToggleDark={this.handleToggleDark} useDarkTheme={this.state.themeName === DARK_THEME} /> ); return ( <>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
<NavHeader onToggleDark={this.handleToggleDark} useDarkTheme={this.state.themeName === DARK_THEME} /> ); return ( <Documentation
</s> remove releases={this.props.releases} </s> add </s> remove <> <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> <Documentation {...this.props} className={this.state.themeName} navbarLeft={navbarLeft} navbarRight={navbarRight} onComponentUpdate={this.handleComponentUpdate} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </> </s> add <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </s> remove const navbarLeft = [ <a className="docs-logo" href="/" key="_logo" />, <div className="pt-navbar-heading docs-heading" key="_title"> Blueprint </div>, this.renderVersionsMenu(), ]; const navbarRight = ( <NavbarActions </s> add const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader </s> remove <div className="pt-text-muted" key="_versions"> v{versions[0].version} </s> add <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )}
versions={this.props.versions}
<NavHeader onToggleDark={this.handleToggleDark} useDarkTheme={this.state.themeName === DARK_THEME} versions={this.props.versions} /> ); return ( <Documentation
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
useDarkTheme={this.state.themeName === DARK_THEME} /> ); return ( <> <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> <Documentation {...this.props} className={this.state.themeName} navbarLeft={navbarLeft} navbarRight={navbarRight} onComponentUpdate={this.handleComponentUpdate} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </> ); } private renderVersionsMenu() { const { versions } = this.props;
</s> remove const navbarLeft = [ <a className="docs-logo" href="/" key="_logo" />, <div className="pt-navbar-heading docs-heading" key="_title"> Blueprint </div>, this.renderVersionsMenu(), ]; const navbarRight = ( <NavbarActions </s> add const banner = ( <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> ); const header = ( <NavHeader </s> remove private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { </s> add private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); </s> remove releases={this.props.releases} </s> add </s> remove <div className="pt-text-muted" key="_versions"> v{versions[0].version} </s> add <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )}
<Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} />
useDarkTheme={this.state.themeName === DARK_THEME} /> ); return ( <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> ); } private renderVersionsMenu() { const { versions } = this.props;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
</> ); } private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { return ( <div className="pt-text-muted" key="_versions"> v{versions[0].version} </div> );
</s> remove <div className="pt-text-muted" key="_versions"> v{versions[0].version} </s> add <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )} </s> remove <> <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> <Documentation {...this.props} className={this.state.themeName} navbarLeft={navbarLeft} navbarRight={navbarRight} onComponentUpdate={this.handleComponentUpdate} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </> </s> add <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </s> remove const match = /docs\/v([0-9]+)/.exec(location.href); // default to latest release if we can't find a major version in the URL const currentRelease = match == null ? versions[versions.length - 1].version : match[1]; const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />); const menu = <Menu className="docs-version-list">{releaseItems}</Menu>; return ( <Popover content={menu} position={Position.BOTTOM} key="_versions"> <button className="docs-version-selector pt-text-muted"> v{currentRelease} <Icon icon="caret-down" /> </button> </Popover> ); } </s> add if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; </s> remove <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> </s> add <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> </s> remove <div className="docs-interface-table"> {renderBlock(data.documentation)} <p className="docs-code">= {renderType(data.type)}</p> </div> </s> add {renderBlock(data.documentation)} <div className="docs-type-alias docs-code">{aliases}</div>
private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`);
</> ); } private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); return ( <div className="pt-text-muted" key="_versions"> v{versions[0].version} </div> );
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { return ( <div className="pt-text-muted" key="_versions"> v{versions[0].version} </div> ); } const match = /docs\/v([0-9]+)/.exec(location.href);
</s> remove private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { </s> add private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); </s> remove const match = /docs\/v([0-9]+)/.exec(location.href); // default to latest release if we can't find a major version in the URL const currentRelease = match == null ? versions[versions.length - 1].version : match[1]; const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />); const menu = <Menu className="docs-version-list">{releaseItems}</Menu>; return ( <Popover content={menu} position={Position.BOTTOM} key="_versions"> <button className="docs-version-selector pt-text-muted"> v{currentRelease} <Icon icon="caret-down" /> </button> </Popover> ); } </s> add if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; </s> remove <> <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> <Documentation {...this.props} className={this.state.themeName} navbarLeft={navbarLeft} navbarRight={navbarRight} onComponentUpdate={this.handleComponentUpdate} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </> </s> add <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}>
<div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )}
private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { return ( <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )} <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )} </div> ); } const match = /docs\/v([0-9]+)/.exec(location.href);
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
v{versions[0].version} </div> ); } const match = /docs\/v([0-9]+)/.exec(location.href); // default to latest release if we can't find a major version in the URL const currentRelease = match == null ? versions[versions.length - 1].version : match[1]; const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />); const menu = <Menu className="docs-version-list">{releaseItems}</Menu>; return ( <Popover content={menu} position={Position.BOTTOM} key="_versions"> <button className="docs-version-selector pt-text-muted"> v{currentRelease} <Icon icon="caret-down" /> </button> </Popover> ); } private renderViewSourceLinkText(entry: ITsDocBase) { return `@blueprintjs/${entry.fileName.split("/", 2)[1]}`; }
</s> remove <div className="pt-text-muted" key="_versions"> v{versions[0].version} </s> add <div className={classNames("docs-nav-package", props.className)} data-route={props.section.route}> <a className="pt-menu-item" href={props.href} onClick={props.onClick}> <NavIcon route={props.section.route} /> <span>{props.section.title}</span> </a> {pkg && ( <a className={Classes.TEXT_MUTED} href={pkg.url} target="_blank"> <small>{pkg.version}</small> </a> )} </s> remove private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { </s> add private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add
if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; };
v{versions[0].version} </div> ); } if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; }; private renderViewSourceLinkText(entry: ITsDocBase) { return `@blueprintjs/${entry.fileName.split("/", 2)[1]}`; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
}); }; private handleToggleDark = (useDark: boolean) => { const themeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(themeName); setHotkeysDialogProps({ className: this.state.themeName }); this.setState({ themeName }); }; }
</s> remove this.setState({ activePageId, activeSectionId }); </s> add this.setState({ activePageId, activeSectionId, isNavigatorOpen: false }); </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; </s> remove <NavMenuItem className={itemClasses} key={section.route} item={section} isActive={isActive} onClick={props.onItemClick} > {childrenMenu} </NavMenuItem> </s> add <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li>
const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName });
}); }; private handleToggleDark = (useDark: boolean) => { const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName }); const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName }); const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName }); const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName }); }; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/components/blueprintDocs.tsx
@import "styles/examples"; @import "styles/icons"; @import "styles/resources"; @import "styles/sections"; .docs-releases-menu .pt-menu { min-width: 270px;
</s> remove .docs-logo { background-image: url("./assets/blueprint-logo.svg"); } </s> add </s> remove /* All the components that live *inside* the navbar. */ </s> add $nav-divider-offset: $pt-grid-size * 5; </s> remove $nav-item-height: $pt-grid-size * 3; $nav-item-line-height: 16px; $nav-item-padding: $pt-grid-size; </s> add </s> remove .docs-api-dialog { width: auto; height: 80vh; padding: 0; </s> add .docs-api-overlay {
@import "styles/nav";
@import "styles/examples"; @import "styles/icons"; @import "styles/nav"; @import "styles/resources"; @import "styles/sections"; .docs-releases-menu .pt-menu { min-width: 270px;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/index.scss
@import "styles/icons"; @import "styles/resources"; @import "styles/sections"; .docs-logo { background-image: url("./assets/blueprint-logo.svg"); } .docs-releases-menu .pt-menu { min-width: 270px; }
</s> remove /* All the components that live *inside* the navbar. */ </s> add $nav-divider-offset: $pt-grid-size * 5; </s> remove box-shadow: $dark-navbar-box-shadow; background-color: $dark-content-background-color; </s> add background-image: linear-gradient(to right, rgba($dark-color, 0) 0%, $dark-color 40%); </s> remove .pt-menu { max-height: $navigator-height; overflow: auto; </s> add .pt-menu-item small { // center-align text and SVG icons display: flex;
@import "styles/icons"; @import "styles/resources"; @import "styles/sections"; .docs-releases-menu .pt-menu { min-width: 270px; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/index.scss
// override more specific selector above //stylelint-disable declaration-no-important &.docs-clipboard-copied .docs-clipboard-message::after { content: $swatch-copied-message !important; } &.docs-clipboard-copied .docs-clipboard-message[data-copied-message]::after { content: attr(data-copied-message) !important;
</s> remove .docs-nav-expanded > .docs-nav-menu { display: block; </s> add .docs-nav-title { @include pt-flex-container(row); flex-wrap: wrap; align-items: center; </s> remove line-height: $banner-height; </s> add </s> remove .docs-nav-expand-all .docs-nav-menu { // sometimes you need to show all the sections display: block !important; // stylelint-disable-line declaration-no-important </s> add .docs-nav-section { opacity: 0.5; margin-top: $pt-grid-size * 2; margin-bottom: $pt-grid-size; text-transform: uppercase; font-size: small; font-weight: 600; // dedent menu under a section title + .docs-nav-menu { margin-left: 0; } </s> remove // nested menus are hidden by default .docs-nav-menu .docs-nav-menu { display: none; </s> add .docs-nav-menu { .pt-menu-item { padding-right: $pt-grid-size; padding-left: 0; white-space: initial; &:hover, &.pt-active, &.docs-nav-expanded { // bold text instead of background color background-color: transparent !important; // stylelint-disable-line declaration-no-important font-weight: 600; } @each $depth in (1, 2, 3, 4, 5) { &.depth-#{$depth} { padding-left: $nav-item-indent * $depth; } } } .docs-nav-menu { // nested menus are hidden by default display: none; // nested menus indent automatically margin-left: $nav-item-indent; } .docs-nav-expanded + & { display: block; } </s> remove color: $pt-text-color; } .pt-dark &:hover { color: $pt-dark-text-color; } .pt-popover-open & { // make button look hovered when popover is open // stylelint-disable-next-line scss/at-extend-no-missing-placeholder @extend :hover; } } .docs-version-list { min-width: $pt-grid-size * 12; max-height: $pt-grid-size * 20; overflow: auto; } // long selector necessary to override blueprint styles .pt-button-group.pt-minimal .pt-button.docs-dark-switch { @include pt-button-minimal-intent($indigo3, $indigo3, $indigo4); color: $pt-icon-color; .pt-icon { </s> add @include divider-gradient($content-background-color, $dark-content-background-color);
font-family: $pt-font-family;
// override more specific selector above //stylelint-disable declaration-no-important &.docs-clipboard-copied .docs-clipboard-message::after { font-family: $pt-font-family; content: $swatch-copied-message !important; } &.docs-clipboard-copied .docs-clipboard-message[data-copied-message]::after { content: attr(data-copied-message) !important;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/styles/_colors.scss
display: flex; flex-direction: column; align-items: center; border-radius: $pt-border-radius; width: 100% / $icons-per-row - 1%; height: $pt-grid-size * 12; padding: ($pt-grid-size * 2) 0; transition: background-color $hover-transition;
</s> remove width: $content-width; </s> add box-shadow: $pt-elevation-shadow-4; background: $sidebar-background-color; width: 50vw; min-width: $pt-grid-size * 50; max-width: $pt-grid-size * 80; padding: 0; </s> remove .docs-api-dialog { width: auto; height: 80vh; padding: 0; </s> add .docs-api-overlay { </s> remove align-items: flex-end; </s> add align-items: center; </s> remove height: $banner-height; </s> add min-height: $banner-height; padding: $pt-grid-size $pt-grid-size * 2;
width: 100% / $icons-per-row;
display: flex; flex-direction: column; align-items: center; border-radius: $pt-border-radius; width: 100% / $icons-per-row; height: $pt-grid-size * 12; padding: ($pt-grid-size * 2) 0; transition: background-color $hover-transition;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/styles/_icons.scss
#{reference("pt-label")}, #{reference("pt-menu")}, #{reference("pt-select.pt-inline")}, #{reference("pt-skeleton")}, #{reference("pt-tag")} { @include examples-per-row(2); } #{reference-all("pt-input")}, #{reference("pt-button")},
</s> remove .pt-dark & { @include pt-button-minimal-intent($gold4, $gold4, $gold5); color: $pt-dark-icon-color; } </s> add .docs-nav-divider { @include divider-gradient($pt-divider-black, $pt-dark-divider-black); margin-left: -$nav-divider-offset; background-image: linear-gradient(to right, rgba($black, 0) 0%, $pt-divider-black 40%); height: 1px; padding: 0; </s> remove color: $pt-text-color; } .pt-dark &:hover { color: $pt-dark-text-color; } .pt-popover-open & { // make button look hovered when popover is open // stylelint-disable-next-line scss/at-extend-no-missing-placeholder @extend :hover; } } .docs-version-list { min-width: $pt-grid-size * 12; max-height: $pt-grid-size * 20; overflow: auto; } // long selector necessary to override blueprint styles .pt-button-group.pt-minimal .pt-button.docs-dark-switch { @include pt-button-minimal-intent($indigo3, $indigo3, $indigo4); color: $pt-icon-color; .pt-icon { </s> add @include divider-gradient($content-background-color, $dark-content-background-color); </s> remove // center container in window </s> add @include pt-flex-container(row); </s> remove flex: 1 1 auto; </s> add flex-grow: 1; flex-shrink: 1;
#{reference("pt-tag")}, #{reference("pt-tag.pt-minimal")} {
#{reference("pt-label")}, #{reference("pt-menu")}, #{reference("pt-select.pt-inline")}, #{reference("pt-skeleton")}, #{reference("pt-tag")}, #{reference("pt-tag.pt-minimal")} { @include examples-per-row(2); } #{reference-all("pt-input")}, #{reference("pt-button")},
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-app/src/styles/_sections.scss
}, "dependencies": { "@blueprintjs/core": "^2.0.0-rc.3", "classnames": "^2.2", "documentalist": "^1.2.0", "fuzzaldrin-plus": "^0.5.0", "tslib": "^1.9.0"
</s> remove const examplesOnly = location.search === "?examples"; </s> add const rootClasses = classNames( "docs-root", { "docs-examples-only": location.search === "?examples" }, this.props.className, ); const apiClasses = classNames("docs-api-overlay", this.props.className); </s> remove export const TypescriptExample: React.SFC<ITag> = ({ value }, { getDocsData }: IDocumentationContext) => { </s> add export const TypescriptExample: React.SFC<ITag & IProps> = ( { className, value }, { getDocsData }: IDocumentationContext, ) => { </s> remove <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> </s> add <div className={rootClasses}> {this.props.banner} </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} />
"@blueprintjs/select": "^2.0.0-rc.3",
}, "dependencies": { "@blueprintjs/core": "^2.0.0-rc.3", "@blueprintjs/select": "^2.0.0-rc.3", "classnames": "^2.2", "documentalist": "^1.2.0", "fuzzaldrin-plus": "^0.5.0", "tslib": "^1.9.0"
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/package.json
import * as React from "react"; import { ITagRendererMap } from "../tags"; export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { if (block === undefined) { return []; } return block.contents.map((node, i) => { if (typeof node === "string") {
</s> remove return []; </s> add return null; </s> remove return block.contents.map((node, i) => { </s> add const contents = block.contents.map((node, i) => { </s> remove return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; </s> add return <div className={textClassName} key={i} dangerouslySetInnerHTML={{ __html: node }} />; </s> remove import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; </s> add import { eachLayoutNode } from "../common/utils";
export function renderBlock( /** the block to render */ block: IBlock | undefined, /** known tag renderers */ tagRenderers: ITagRendererMap, /** class names to apply to element wrapping string content. */ textClassName?: string, ): JSX.Element | null {
import * as React from "react"; import { ITagRendererMap } from "../tags"; export function renderBlock( /** the block to render */ block: IBlock | undefined, /** known tag renderers */ tagRenderers: ITagRendererMap, /** class names to apply to element wrapping string content. */ textClassName?: string, ): JSX.Element | null { if (block === undefined) { return []; } return block.contents.map((node, i) => { if (typeof node === "string") {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/block.tsx
import { ITagRendererMap } from "../tags"; export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { if (block === undefined) { return []; } return block.contents.map((node, i) => { if (typeof node === "string") { return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; }
</s> remove return block.contents.map((node, i) => { </s> add const contents = block.contents.map((node, i) => { </s> remove return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; </s> add return <div className={textClassName} key={i} dangerouslySetInnerHTML={{ __html: node }} />; </s> remove export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { </s> add export function renderBlock( /** the block to render */ block: IBlock | undefined, /** known tag renderers */ tagRenderers: ITagRendererMap, /** class names to apply to element wrapping string content. */ textClassName?: string, ): JSX.Element | null { </s> remove return <InterfaceTable data={member} title="Props" />; </s> add return <InterfaceTable className={className} data={member} title="Props" />;
return null;
import { ITagRendererMap } from "../tags"; export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { if (block === undefined) { return null; } return block.contents.map((node, i) => { if (typeof node === "string") { return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/block.tsx
export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { if (block === undefined) { return []; } return block.contents.map((node, i) => { if (typeof node === "string") { return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; } try { const renderer = tagRenderers[node.tag];
</s> remove return []; </s> add return null; </s> remove return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; </s> add return <div className={textClassName} key={i} dangerouslySetInnerHTML={{ __html: node }} />; </s> remove export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { </s> add export function renderBlock( /** the block to render */ block: IBlock | undefined, /** known tag renderers */ tagRenderers: ITagRendererMap, /** class names to apply to element wrapping string content. */ textClassName?: string, ): JSX.Element | null { </s> remove return <InterfaceTable data={member} title="Props" />; </s> add return <InterfaceTable className={className} data={member} title="Props" />; </s> remove private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { </s> add private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`);
const contents = block.contents.map((node, i) => {
export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { if (block === undefined) { return []; } const contents = block.contents.map((node, i) => { if (typeof node === "string") { return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; } try { const renderer = tagRenderers[node.tag];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/block.tsx
return []; } return block.contents.map((node, i) => { if (typeof node === "string") { return <div className="docs-section pt-running-text" dangerouslySetInnerHTML={{ __html: node }} key={i} />; } try { const renderer = tagRenderers[node.tag]; if (renderer === undefined) { throw new Error(`Unknown @tag: ${node.tag}`);
</s> remove return block.contents.map((node, i) => { </s> add const contents = block.contents.map((node, i) => { </s> remove return []; </s> add return null; </s> remove return <InterfaceTable data={member} title="Props" />; </s> add return <InterfaceTable className={className} data={member} title="Props" />; </s> remove export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { </s> add export function renderBlock( /** the block to render */ block: IBlock | undefined, /** known tag renderers */ tagRenderers: ITagRendererMap, /** class names to apply to element wrapping string content. */ textClassName?: string, ): JSX.Element | null { </s> remove return <EnumTable data={member} />; </s> add return <EnumTable className={className} data={member} />;
return <div className={textClassName} key={i} dangerouslySetInnerHTML={{ __html: node }} />;
return []; } return block.contents.map((node, i) => { if (typeof node === "string") { return <div className={textClassName} key={i} dangerouslySetInnerHTML={{ __html: node }} />; } try { const renderer = tagRenderers[node.tag]; if (renderer === undefined) { throw new Error(`Unknown @tag: ${node.tag}`);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/block.tsx
import classNames from "classnames"; import { isPageNode, ITsDocBase, linkify } from "documentalist/dist/client"; import * as React from "react"; import { Dialog, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Utils } from "@blueprintjs/core"; import { DocumentationContextTypes, hasTypescriptData, IDocsData, IDocumentationContext } from "../common/context"; import { eachLayoutNode } from "../common/utils"; import { ITagRendererMap, TypescriptExample } from "../tags"; import { renderBlock } from "./block";
</s> remove import { Classes, Hotkey, Hotkeys, HotkeysTarget, InputGroup, Keys, Popover, Position, Utils } from "@blueprintjs/core"; import { IconContents } from "@blueprintjs/icons"; </s> add import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select"; </s> remove import { findDOMNode } from "react-dom"; </s> add
import { Classes, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Overlay, Utils } from "@blueprintjs/core";
import classNames from "classnames"; import { isPageNode, ITsDocBase, linkify } from "documentalist/dist/client"; import * as React from "react"; import { Classes, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Overlay, Utils } from "@blueprintjs/core"; import { DocumentationContextTypes, hasTypescriptData, IDocsData, IDocumentationContext } from "../common/context"; import { eachLayoutNode } from "../common/utils"; import { ITagRendererMap, TypescriptExample } from "../tags"; import { renderBlock } from "./block";
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
import { eachLayoutNode } from "../common/utils"; import { ITagRendererMap, TypescriptExample } from "../tags"; import { renderBlock } from "./block"; import { Navigator } from "./navigator"; import { NavMenu } from "./navMenu"; import { INavMenuItemProps } from "./navMenuItem"; import { Page } from "./page"; import { addScrollbarStyle } from "./scrollbar";
</s> remove import { Dialog, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Utils } from "@blueprintjs/core"; </s> add import { Classes, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Overlay, Utils } from "@blueprintjs/core"; </s> remove import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; </s> add import { eachLayoutNode } from "../common/utils";
import { NavButton } from "./navButton";
import { eachLayoutNode } from "../common/utils"; import { ITagRendererMap, TypescriptExample } from "../tags"; import { renderBlock } from "./block"; import { NavButton } from "./navButton"; import { Navigator } from "./navigator"; import { NavMenu } from "./navMenu"; import { INavMenuItemProps } from "./navMenuItem"; import { Page } from "./page"; import { addScrollbarStyle } from "./scrollbar";
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
import { renderBlock } from "./block"; import { NavButton } from "./navButton"; import { Navigator } from "./navigator"; import { NavMenu } from "./navMenu"; import { Page } from "./page"; import { addScrollbarStyle } from "./scrollbar"; import { ApiLink } from "./typescript/apiLink"; export interface IDocumentationProps extends IProps {
</s> remove import { Dialog, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Utils } from "@blueprintjs/core"; </s> add import { Classes, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Overlay, Utils } from "@blueprintjs/core";
import { INavMenuItemProps } from "./navMenuItem";
import { renderBlock } from "./block"; import { NavButton } from "./navButton"; import { Navigator } from "./navigator"; import { NavMenu } from "./navMenu"; import { INavMenuItemProps } from "./navMenuItem"; import { Page } from "./page"; import { addScrollbarStyle } from "./scrollbar"; import { ApiLink } from "./typescript/apiLink"; export interface IDocumentationProps extends IProps {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
import { NavMenu } from "./navMenu"; import { INavMenuItemProps } from "./navMenuItem"; import { Page } from "./page"; import { ApiLink } from "./typescript/apiLink"; export interface IDocumentationProps extends IProps { /** * An element to place above the documentation, along the top of the viewport. * For best results, use a `Banner` from this package.
</s>
import { addScrollbarStyle } from "./scrollbar";
import { NavMenu } from "./navMenu"; import { INavMenuItemProps } from "./navMenuItem"; import { Page } from "./page"; import { addScrollbarStyle } from "./scrollbar"; import { ApiLink } from "./typescript/apiLink"; export interface IDocumentationProps extends IProps { /** * An element to place above the documentation, along the top of the viewport. * For best results, use a `Banner` from this package.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
import { ApiLink } from "./typescript/apiLink"; export interface IDocumentationProps extends IProps { /** * Default page to render in the absence of a hash route. */ defaultPageId: string; /**
</s> remove /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */ navbarRight?: React.ReactNode; </s> add /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> remove export function renderBlock(block: IBlock | undefined, tagRenderers: ITagRendererMap): JSX.Element[] { </s> add export function renderBlock( /** the block to render */ block: IBlock | undefined, /** known tag renderers */ tagRenderers: ITagRendererMap, /** class names to apply to element wrapping string content. */ textClassName?: string, ): JSX.Element | null {
/** * An element to place above the documentation, along the top of the viewport. * For best results, use a `Banner` from this package. */ banner?: JSX.Element;
import { ApiLink } from "./typescript/apiLink"; export interface IDocumentationProps extends IProps { /** * An element to place above the documentation, along the top of the viewport. * For best results, use a `Banner` from this package. */ banner?: JSX.Element; /** * Default page to render in the absence of a hash route. */ defaultPageId: string; /**
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
* This theme requires the Markdown plugin, and optionally supports Typescript and KSS data. */ docs: IDocsData; /** * Callback invoked whenever the component props or state change (specifically, * called in `componentDidMount` and `componentDidUpdate`). * Use it to run non-React code on the newly rendered sections. */
</s> remove * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" </s> add * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. </s> remove navbarLeft?: React.ReactNode; </s> add renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; </s> remove /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> add </s> remove /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */ navbarRight?: React.ReactNode; </s> add /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap;
/** * Elements to render on the top of the sidebar, above the search box. * This typically contains logo, title and navigation links. * Use `.docs-nav-title` on an element for proper padding relative to other sidebar elements. */ header: React.ReactNode;
* This theme requires the Markdown plugin, and optionally supports Typescript and KSS data. */ docs: IDocsData; /** * Elements to render on the top of the sidebar, above the search box. * This typically contains logo, title and navigation links. * Use `.docs-nav-title` on an element for proper padding relative to other sidebar elements. */ header: React.ReactNode; /** * Callback invoked whenever the component props or state change (specifically, * called in `componentDidMount` and `componentDidUpdate`). * Use it to run non-React code on the newly rendered sections. */
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
* @default "View source" */ renderViewSourceLinkText?: (entry: ITsDocBase) => React.ReactNode; /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" */
</s> remove /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */ navbarRight?: React.ReactNode; </s> add /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> remove * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" </s> add * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. </s> remove navbarLeft?: React.ReactNode; </s> add renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element;
* @default "View source" */ renderViewSourceLinkText?: (entry: ITsDocBase) => React.ReactNode; /** * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" */
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
/** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" */ navbarLeft?: React.ReactNode; /** * Element to render on the right side of the navbar, typically links and actions.
</s> remove /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> add </s> remove /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */ navbarRight?: React.ReactNode; </s> add /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> remove navbarLeft?: React.ReactNode; </s> add renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element;
* Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package.
/** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. */ navbarLeft?: React.ReactNode; /** * Element to render on the right side of the navbar, typically links and actions.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
* Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" */ navbarLeft?: React.ReactNode; /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */
</s> remove * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" </s> add * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. </s> remove /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> add </s> remove /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */ navbarRight?: React.ReactNode; </s> add /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap;
renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element;
* Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" */ renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
* @default "Documentation" */ navbarLeft?: React.ReactNode; /** * Element to render on the right side of the navbar, typically links and actions. * All elements will be wrapped in a single `.pt-navbar-group`. */ navbarRight?: React.ReactNode; } export interface IDocumentationState { activeApiMember: string; activePageId: string;
</s> remove navbarLeft?: React.ReactNode; </s> add renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; </s> remove * Elements to render on the left side of the navbar, typically logo and title. * All elements will be wrapped in a single `.pt-navbar-group`. * @default "Documentation" </s> add * Callback invoked to render the clickable nav menu items. (Nested menu structure is handled by the library.) * The default implementation renders a `NavMenuItem` element, which is exported from this package. </s> remove /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; </s> add
/** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap;
* @default "Documentation" */ navbarLeft?: React.ReactNode; /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; /** Tag renderer functions. Unknown tags will log console errors. */ tagRenderers: ITagRendererMap; } export interface IDocumentationState { activeApiMember: string; activePageId: string;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
activeSectionId: string; isApiBrowserOpen: boolean; } @HotkeysTarget export class Documentation extends React.PureComponent<IDocumentationProps, IDocumentationState> {
</s> remove public static defaultProps = { navbarLeft: "Documentation", }; </s> add </s> remove const MENU_PADDING = 5; // $pt-grid-size / 2; </s> add const NavOmnibar = Omnibar.ofType<INavigationSection>(); </s> remove export interface IInterfaceTableProps { </s> add export interface IInterfaceTableProps extends IProps {
isNavigatorOpen: boolean;
activeSectionId: string; isApiBrowserOpen: boolean; isNavigatorOpen: boolean; } @HotkeysTarget export class Documentation extends React.PureComponent<IDocumentationProps, IDocumentationState> {
[ "keep", "add", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
@HotkeysTarget export class Documentation extends React.PureComponent<IDocumentationProps, IDocumentationState> { public static childContextTypes = DocumentationContextTypes; public static defaultProps = { navbarLeft: "Documentation", }; /** Map of section route to containing page reference. */ private routeToPage: { [route: string]: string }; private contentElement: HTMLElement; private navElement: HTMLElement;
</s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> { </s> remove export interface IEnumTableProps { </s> add export interface IEnumTableProps extends IProps { </s> remove export interface ITypeAliasTableProps { </s> add export interface ITypeAliasTableProps extends IProps { </s> remove private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); </s> add private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null;
@HotkeysTarget export class Documentation extends React.PureComponent<IDocumentationProps, IDocumentationState> { public static childContextTypes = DocumentationContextTypes; /** Map of section route to containing page reference. */ private routeToPage: { [route: string]: string }; private contentElement: HTMLElement; private navElement: HTMLElement;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
activeSectionId: props.defaultPageId, isApiBrowserOpen: false, }; // build up static map of all references to their page, for navigation / routing this.routeToPage = {}; eachLayoutNode(this.props.docs.nav, (node, parents) => {
</s> remove public static defaultProps = { navbarLeft: "Documentation", }; </s> add </s> remove const filterKey = [...path, title].join("/"); </s> add const filterKey = [...path, "`" + title].join("/"); </s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> { </s> remove function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { </s> add function scrollToReference(reference: string, scrollContainer: HTMLElement) {
isNavigatorOpen: false,
activeSectionId: props.defaultPageId, isApiBrowserOpen: false, isNavigatorOpen: false, }; // build up static map of all references to their page, for navigation / routing this.routeToPage = {}; eachLayoutNode(this.props.docs.nav, (node, parents) => {
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
public getChildContext(): IDocumentationContext { const { docs, renderViewSourceLinkText } = this.props; return { getDocsData: () => docs, renderBlock: block => renderBlock(block, this.props.tagRenderers), renderType: hasTypescriptData(docs) ? type => linkify(type, docs.typescript, name => <ApiLink key={name} name={name} />) : type => type, renderViewSourceLinkText: Utils.isFunction(renderViewSourceLinkText) ? renderViewSourceLinkText
</s> remove const themeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(themeName); setHotkeysDialogProps({ className: this.state.themeName }); this.setState({ themeName }); </s> add const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName }); </s> remove export interface IEnumTableProps { </s> add export interface IEnumTableProps extends IProps { </s> remove const activeSectionId = getScrolledReference(100, this.contentElement); </s> add const activeSectionId = getScrolledReference(100, document.documentElement); </s> remove export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; </s> add
renderBlock: block => renderBlock(block, this.props.tagRenderers, Classes.RUNNING_TEXT_SMALL),
public getChildContext(): IDocumentationContext { const { docs, renderViewSourceLinkText } = this.props; return { getDocsData: () => docs, renderBlock: block => renderBlock(block, this.props.tagRenderers, Classes.RUNNING_TEXT_SMALL), renderType: hasTypescriptData(docs) ? type => linkify(type, docs.typescript, name => <ApiLink key={name} name={name} />) : type => type, renderViewSourceLinkText: Utils.isFunction(renderViewSourceLinkText) ? renderViewSourceLinkText
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
public render() { const { activeApiMember, activePageId, activeSectionId, isApiBrowserOpen } = this.state; const { nav, pages } = this.props.docs; const examplesOnly = location.search === "?examples"; return ( <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> <div className="docs-app"> <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div>
</s> remove <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> </s> add <div className={rootClasses}> {this.props.banner} </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}> </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}>
const rootClasses = classNames( "docs-root", { "docs-examples-only": location.search === "?examples" }, this.props.className, ); const apiClasses = classNames("docs-api-overlay", this.props.className);
public render() { const { activeApiMember, activePageId, activeSectionId, isApiBrowserOpen } = this.state; const { nav, pages } = this.props.docs; const rootClasses = classNames( "docs-root", { "docs-examples-only": location.search === "?examples" }, this.props.className, ); const apiClasses = classNames("docs-api-overlay", this.props.className); return ( <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> <div className="docs-app"> <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
const { activeApiMember, activePageId, activeSectionId, isApiBrowserOpen } = this.state; const { nav, pages } = this.props.docs; const examplesOnly = location.search === "?examples"; return ( <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> <div className="docs-app"> <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} />
</s> remove const examplesOnly = location.search === "?examples"; </s> add const rootClasses = classNames( "docs-root", { "docs-examples-only": location.search === "?examples" }, this.props.className, ); const apiClasses = classNames("docs-api-overlay", this.props.className); </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </s> remove <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </s> add </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}> </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}>
<div className={rootClasses}> {this.props.banner}
const { activeApiMember, activePageId, activeSectionId, isApiBrowserOpen } = this.state; const { nav, pages } = this.props.docs; const examplesOnly = location.search === "?examples"; return ( <div className={rootClasses}> {this.props.banner} <div className="docs-app"> <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} />
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
const examplesOnly = location.search === "?examples"; return ( <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> <div className="docs-app"> <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </div> <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </div> <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu
</s> remove <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> </s> add <div className={rootClasses}> {this.props.banner} </s> remove <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </s> add </s> remove const examplesOnly = location.search === "?examples"; </s> add const rootClasses = classNames( "docs-root", { "docs-examples-only": location.search === "?examples" }, this.props.className, ); const apiClasses = classNames("docs-api-overlay", this.props.className); </s> remove <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId} activeSectionId={activeSectionId} onItemClick={this.handleNavigation} /> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> </s> add <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}>
<div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} />
const examplesOnly = location.search === "?examples"; return ( <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> <div className="docs-app"> <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </div> <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </div> <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
<div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </div> <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </div> <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId}
</s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </s> remove <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId} activeSectionId={activeSectionId} onItemClick={this.handleNavigation} /> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> </s> add <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> </s> remove <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> </s> add <div className={rootClasses}> {this.props.banner} </s> remove <div className="docs-interface-table"> {renderBlock(data.documentation)} <p className="docs-code">= {renderType(data.type)}</p> </div> </s> add {renderBlock(data.documentation)} <div className="docs-type-alias docs-code">{aliases}</div>
<div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </div> </div> <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
<Navigator items={nav} onNavigate={this.handleNavigation} /> </div> <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </div> <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId} activeSectionId={activeSectionId} onItemClick={this.handleNavigation} /> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> <Page page={pages[activePageId]} tagRenderers={this.props.tagRenderers} /> </article> <Dialog className="docs-api-dialog" isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Dialog>
</s> remove </article> <Dialog className="docs-api-dialog" isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Dialog> </s> add </main> </s> remove <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </s> add </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} /> </s> remove <div className={classNames("docs-root", { "docs-examples-only": examplesOnly }, this.props.className)}> </s> add <div className={rootClasses}> {this.props.banner}
<main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main">
<Navigator items={nav} onNavigate={this.handleNavigation} /> </div> <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </div> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> <Page page={pages[activePageId]} tagRenderers={this.props.tagRenderers} /> </article> <Dialog className="docs-api-dialog" isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Dialog>
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
/> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> <Page page={pages[activePageId]} tagRenderers={this.props.tagRenderers} /> </article> <Dialog className="docs-api-dialog" isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Dialog> </div> </div> ); }
</s> remove <div className="docs-nav" ref={this.refHandlers.nav}> <NavMenu items={nav} activePageId={activePageId} activeSectionId={activeSectionId} onItemClick={this.handleNavigation} /> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> </s> add <main className="docs-content-wrapper pt-fill" ref={this.refHandlers.content} role="main"> </s> remove <div className="docs-interface-table"> {renderBlock(data.documentation)} <p className="docs-code">= {renderType(data.type)}</p> </div> </s> add {renderBlock(data.documentation)} <div className="docs-type-alias docs-code">{aliases}</div> </s> remove <div className="pt-navbar-group pt-navbar-group-right">{this.props.navbarRight}</div> </s> add </s> remove <div className="pt-navbar docs-navbar docs-flex-row"> <div className="pt-navbar-group pt-navbar-group-left">{this.props.navbarLeft}</div> <div className="pt-navbar-group"> <Navigator items={nav} onNavigate={this.handleNavigation} /> </s> add <div className="docs-nav-wrapper"> <div className="docs-nav" ref={this.refHandlers.nav}> {this.props.header} <div className="docs-nav-divider" /> <NavButton icon="search" hotkey="shift + s" text="Search..." onClick={this.handleOpenNavigator} /> <div className="docs-nav-divider" /> <NavMenu activePageId={activePageId} activeSectionId={activeSectionId} items={nav} level={0} onItemClick={this.handleNavigation} renderNavMenuItem={this.props.renderNavMenuItem} />
</main>
/> </div> <article className="docs-content" ref={this.refHandlers.content} role="main"> <Page page={pages[activePageId]} tagRenderers={this.props.tagRenderers} /> </main> </main> </main> </main> </div> </div> ); }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
</main> </div> </div> ); } public renderHotkeys() { return (
</s> remove </article> <Dialog className="docs-api-dialog" isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Dialog> </s> add </main> </s> remove <div className="docs-interface-table"> {renderBlock(data.documentation)} <p className="docs-code">= {renderType(data.type)}</p> </div> </s> add {renderBlock(data.documentation)} <div className="docs-type-alias docs-code">{aliases}</div> </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}> </s> remove <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> </s> add <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} />
<Overlay className={apiClasses} isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Overlay> <Navigator isOpen={this.state.isNavigatorOpen} items={nav} onClose={this.handleCloseNavigator} />
</main> </div> <Overlay className={apiClasses} isOpen={isApiBrowserOpen} onClose={this.handleApiBrowserClose}> <TypescriptExample tag="typescript" value={activeApiMember} /> </Overlay> <Navigator isOpen={this.state.isNavigatorOpen} items={nav} onClose={this.handleCloseNavigator} /> </div> ); } public renderHotkeys() { return (
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="[" label="Previous section" onKeyDown={this.handlePreviousSection} /> <Hotkey global={true} combo="]" label="Next section" onKeyDown={this.handleNextSection} /> </Hotkeys> );
</s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add </s> remove releases={this.props.releases} </s> add </s> remove <> <Banner href="http://blueprintjs.com/docs/v1/"> This documentation is for Blueprint v2, which is currently under development. Click here to go to the v1 docs. </Banner> <Documentation {...this.props} className={this.state.themeName} navbarLeft={navbarLeft} navbarRight={navbarRight} onComponentUpdate={this.handleComponentUpdate} renderViewSourceLinkText={this.renderViewSourceLinkText} /> </> </s> add <Documentation {...this.props} banner={banner} className={this.state.themeName} header={header} onComponentUpdate={this.handleComponentUpdate} renderNavMenuItem={this.renderNavMenuItem} renderViewSourceLinkText={this.renderViewSourceLinkText} />
<Hotkey global={true} combo="shift+s" label="Open navigator" onKeyDown={this.handleOpenNavigator} preventDefault={true} />
public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift+s" label="Open navigator" onKeyDown={this.handleOpenNavigator} preventDefault={true} /> <Hotkey global={true} combo="[" label="Previous section" onKeyDown={this.handlePreviousSection} /> <Hotkey global={true} combo="]" label="Next section" onKeyDown={this.handleNextSection} /> </Hotkeys> );
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
} public componentWillMount() { this.updateHash(); } public componentDidMount() { // hooray! so you don't have to!
</s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add </s> remove export interface ITypeAliasTableProps { </s> add export interface ITypeAliasTableProps extends IProps { </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}> </s> remove export interface IEnumTableProps { </s> add export interface IEnumTableProps extends IProps { </s> remove <div className="docs-modifiers pt-running-text-small"> </s> add <div className={classNames("docs-modifiers", this.props.className)}>
addScrollbarStyle();
} public componentWillMount() { addScrollbarStyle(); this.updateHash(); } public componentDidMount() { // hooray! so you don't have to!
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
// Don't call componentWillMount since the HotkeysTarget decorator will be invoked on every hashchange. this.updateHash(); }; private handleNavigation = (activeSectionId: string) => { // only update state if this section reference is valid const activePageId = this.routeToPage[activeSectionId]; if (activeSectionId !== undefined && activePageId !== undefined) { this.setState({ activePageId, activeSectionId, isNavigatorOpen: false });
</s> remove this.setState({ activePageId, activeSectionId }); </s> add this.setState({ activePageId, activeSectionId, isNavigatorOpen: false }); </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; </s> remove const activeSectionId = getScrolledReference(100, this.contentElement); </s> add const activeSectionId = getScrolledReference(100, document.documentElement); </s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> { </s> remove const navMenuElement = this.navElement .querySelector(`a[href="#${activeSectionId}"]`) .closest(".docs-menu-item-page"); </s> add const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`);
private handleCloseNavigator = () => this.setState({ isNavigatorOpen: false }); private handleOpenNavigator = () => this.setState({ isNavigatorOpen: true });
// Don't call componentWillMount since the HotkeysTarget decorator will be invoked on every hashchange. this.updateHash(); }; private handleCloseNavigator = () => this.setState({ isNavigatorOpen: false }); private handleOpenNavigator = () => this.setState({ isNavigatorOpen: true }); private handleNavigation = (activeSectionId: string) => { // only update state if this section reference is valid const activePageId = this.routeToPage[activeSectionId]; if (activeSectionId !== undefined && activePageId !== undefined) { this.setState({ activePageId, activeSectionId, isNavigatorOpen: false });
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
private handleNavigation = (activeSectionId: string) => { // only update state if this section reference is valid const activePageId = this.routeToPage[activeSectionId]; if (activeSectionId !== undefined && activePageId !== undefined) { this.setState({ activePageId, activeSectionId }); this.scrollToActiveSection(); } }; private handleNextSection = () => this.shiftSection(1);
</s> remove const activeSectionId = getScrolledReference(100, this.contentElement); </s> add const activeSectionId = getScrolledReference(100, document.documentElement); </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; </s> remove private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); </s> add private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true });
this.setState({ activePageId, activeSectionId, isNavigatorOpen: false });
private handleNavigation = (activeSectionId: string) => { // only update state if this section reference is valid const activePageId = this.routeToPage[activeSectionId]; if (activeSectionId !== undefined && activePageId !== undefined) { this.setState({ activePageId, activeSectionId, isNavigatorOpen: false }); this.scrollToActiveSection(); } }; private handleNextSection = () => this.shiftSection(1);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
private handleNextSection = () => this.shiftSection(1); private handlePreviousSection = () => this.shiftSection(-1); private handleScroll = () => { const activeSectionId = getScrolledReference(100, this.contentElement); if (activeSectionId == null) { return; } // use the longer (deeper) name to avoid jumping up between sections this.setState({ activeSectionId });
</s> remove this.setState({ activePageId, activeSectionId }); </s> add this.setState({ activePageId, activeSectionId, isNavigatorOpen: false }); </s> remove scrollToReference(this.state.activeSectionId, this.contentElement); </s> add scrollToReference(this.state.activeSectionId, document.documentElement); </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); };
const activeSectionId = getScrolledReference(100, document.documentElement);
private handleNextSection = () => this.shiftSection(1); private handlePreviousSection = () => this.shiftSection(-1); private handleScroll = () => { const activeSectionId = getScrolledReference(100, document.documentElement); if (activeSectionId == null) { return; } // use the longer (deeper) name to avoid jumping up between sections this.setState({ activeSectionId });
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
private maybeScrollToActivePageMenuItem() { const { activeSectionId } = this.state; // only scroll nav menu if active item is not visible in viewport. // using activeSectionId so you can see the page title in nav (may not be visible in document). const navMenuElement = this.navElement .querySelector(`a[href="#${activeSectionId}"]`) .closest(".docs-menu-item-page"); const innerBounds = navMenuElement.getBoundingClientRect(); const outerBounds = this.navElement.getBoundingClientRect(); if (innerBounds.top < outerBounds.top || innerBounds.bottom > outerBounds.bottom) { navMenuElement.scrollIntoView(); }
</s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null; </s> remove const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); </s> add const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`); </s> remove const activeSectionId = getScrolledReference(100, this.contentElement); </s> add const activeSectionId = getScrolledReference(100, document.documentElement); </s> remove if (element.offsetTop < scrollParent.scrollTop + offset) { </s> add if (element.offsetTop < scrollContainer.scrollTop + offset) { </s> remove this.setState({ activePageId, activeSectionId }); </s> add this.setState({ activePageId, activeSectionId, isNavigatorOpen: false });
const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`);
private maybeScrollToActivePageMenuItem() { const { activeSectionId } = this.state; // only scroll nav menu if active item is not visible in viewport. // using activeSectionId so you can see the page title in nav (may not be visible in document). const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`); const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`); const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`); const innerBounds = navMenuElement.getBoundingClientRect(); const outerBounds = this.navElement.getBoundingClientRect(); if (innerBounds.top < outerBounds.top || innerBounds.bottom > outerBounds.bottom) { navMenuElement.scrollIntoView(); }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
} private scrollToActiveSection() { if (this.contentElement != null) { scrollToReference(this.state.activeSectionId, this.contentElement); } } private shiftSection(direction: 1 | -1) { // use the current hash instead of `this.state.activeSectionId` to avoid cases where the
</s> remove const activeSectionId = getScrolledReference(100, this.contentElement); </s> add const activeSectionId = getScrolledReference(100, document.documentElement); </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove }; </s> add </s> remove <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> </s> add <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} />
scrollToReference(this.state.activeSectionId, document.documentElement);
} private scrollToActiveSection() { if (this.contentElement != null) { scrollToReference(this.state.activeSectionId, document.documentElement); } } private shiftSection(direction: 1 | -1) { // use the current hash instead of `this.state.activeSectionId` to avoid cases where the
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
/** * Returns the reference of the closest section within `offset` pixels of the top of the viewport. */ function getScrolledReference(offset: number, container: HTMLElement, scrollParent = document.documentElement) { const headings = Array.from(container.querySelectorAll(".docs-title")); while (headings.length > 0) { // iterating in reverse order (popping from end / bottom of page) // so the first element below the threshold is the one we want. const element = headings.pop() as HTMLElement; if (element.offsetTop < scrollParent.scrollTop + offset) {
</s> remove if (element.offsetTop < scrollParent.scrollTop + offset) { </s> add if (element.offsetTop < scrollContainer.scrollTop + offset) { </s> remove * Scroll the scrollParent such that the reference heading appears at the top of the viewport. </s> add * Scroll the scroll container such that the reference heading appears at the top of the viewport. </s> remove function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { </s> add function scrollToReference(reference: string, scrollContainer: HTMLElement) { </s> remove const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); </s> add const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`);
function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title"));
/** * Returns the reference of the closest section within `offset` pixels of the top of the viewport. */ function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title")); function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title")); while (headings.length > 0) { // iterating in reverse order (popping from end / bottom of page) // so the first element below the threshold is the one we want. const element = headings.pop() as HTMLElement; if (element.offsetTop < scrollParent.scrollTop + offset) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
while (headings.length > 0) { // iterating in reverse order (popping from end / bottom of page) // so the first element below the threshold is the one we want. const element = headings.pop() as HTMLElement; if (element.offsetTop < scrollParent.scrollTop + offset) { // relying on DOM structure to get reference return element.querySelector("[data-route]").getAttribute("data-route"); } } return undefined;
</s> remove function getScrolledReference(offset: number, container: HTMLElement, scrollParent = document.documentElement) { const headings = Array.from(container.querySelectorAll(".docs-title")); </s> add function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title")); </s> remove * Scroll the scrollParent such that the reference heading appears at the top of the viewport. </s> add * Scroll the scroll container such that the reference heading appears at the top of the viewport. </s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null; </s> remove const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); </s> add const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`); </s> remove const navMenuElement = this.navElement .querySelector(`a[href="#${activeSectionId}"]`) .closest(".docs-menu-item-page"); </s> add const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`);
if (element.offsetTop < scrollContainer.scrollTop + offset) {
while (headings.length > 0) { // iterating in reverse order (popping from end / bottom of page) // so the first element below the threshold is the one we want. const element = headings.pop() as HTMLElement; if (element.offsetTop < scrollContainer.scrollTop + offset) { // relying on DOM structure to get reference return element.querySelector("[data-route]").getAttribute("data-route"); } } return undefined;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
return undefined; } /** * Scroll the scrollParent such that the reference heading appears at the top of the viewport. */ function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { // without rAF, on initial load this would scroll to the bottom because the CSS had not been applied. // with rAF, CSS is applied before updating scroll positions so all elements are in their correct places. requestAnimationFrame(() => {
</s> remove function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { </s> add function scrollToReference(reference: string, scrollContainer: HTMLElement) { </s> remove const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); </s> add const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`); </s> remove function getScrolledReference(offset: number, container: HTMLElement, scrollParent = document.documentElement) { const headings = Array.from(container.querySelectorAll(".docs-title")); </s> add function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title")); </s> remove if (element.offsetTop < scrollParent.scrollTop + offset) { </s> add if (element.offsetTop < scrollContainer.scrollTop + offset) {
* Scroll the scroll container such that the reference heading appears at the top of the viewport.
return undefined; } /** * Scroll the scroll container such that the reference heading appears at the top of the viewport. */ function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { // without rAF, on initial load this would scroll to the bottom because the CSS had not been applied. // with rAF, CSS is applied before updating scroll positions so all elements are in their correct places. requestAnimationFrame(() => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
/** * Scroll the scrollParent such that the reference heading appears at the top of the viewport. */ function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { // without rAF, on initial load this would scroll to the bottom because the CSS had not been applied. // with rAF, CSS is applied before updating scroll positions so all elements are in their correct places. requestAnimationFrame(() => { const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); if (headingAnchor != null && headingAnchor.parentElement != null) {
</s> remove * Scroll the scrollParent such that the reference heading appears at the top of the viewport. </s> add * Scroll the scroll container such that the reference heading appears at the top of the viewport. </s> remove const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); </s> add const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`); </s> remove function getScrolledReference(offset: number, container: HTMLElement, scrollParent = document.documentElement) { const headings = Array.from(container.querySelectorAll(".docs-title")); </s> add function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title")); </s> remove scrollParent.scrollTop = scrollOffset; </s> add scrollContainer.scrollTop = scrollOffset; </s> remove const navMenuElement = this.navElement .querySelector(`a[href="#${activeSectionId}"]`) .closest(".docs-menu-item-page"); </s> add const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`);
function scrollToReference(reference: string, scrollContainer: HTMLElement) {
/** * Scroll the scrollParent such that the reference heading appears at the top of the viewport. */ function scrollToReference(reference: string, scrollContainer: HTMLElement) { // without rAF, on initial load this would scroll to the bottom because the CSS had not been applied. // with rAF, CSS is applied before updating scroll positions so all elements are in their correct places. requestAnimationFrame(() => { const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); if (headingAnchor != null && headingAnchor.parentElement != null) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { // without rAF, on initial load this would scroll to the bottom because the CSS had not been applied. // with rAF, CSS is applied before updating scroll positions so all elements are in their correct places. requestAnimationFrame(() => { const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); if (headingAnchor != null && headingAnchor.parentElement != null) { const scrollOffset = headingAnchor.parentElement!.offsetTop + headingAnchor.offsetTop; scrollParent.scrollTop = scrollOffset; } });
</s> remove function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { </s> add function scrollToReference(reference: string, scrollContainer: HTMLElement) { </s> remove * Scroll the scrollParent such that the reference heading appears at the top of the viewport. </s> add * Scroll the scroll container such that the reference heading appears at the top of the viewport. </s> remove scrollParent.scrollTop = scrollOffset; </s> add scrollContainer.scrollTop = scrollOffset; </s> remove function getScrolledReference(offset: number, container: HTMLElement, scrollParent = document.documentElement) { const headings = Array.from(container.querySelectorAll(".docs-title")); </s> add function getScrolledReference(offset: number, scrollContainer: HTMLElement) { const headings = Array.from(scrollContainer.querySelectorAll(".docs-title")); </s> remove const navMenuElement = this.navElement .querySelector(`a[href="#${activeSectionId}"]`) .closest(".docs-menu-item-page"); </s> add const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`);
const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`);
function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { // without rAF, on initial load this would scroll to the bottom because the CSS had not been applied. // with rAF, CSS is applied before updating scroll positions so all elements are in their correct places. requestAnimationFrame(() => { const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`); if (headingAnchor != null && headingAnchor.parentElement != null) { const scrollOffset = headingAnchor.parentElement!.offsetTop + headingAnchor.offsetTop; scrollParent.scrollTop = scrollOffset; } });
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
requestAnimationFrame(() => { const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); if (headingAnchor != null && headingAnchor.parentElement != null) { const scrollOffset = headingAnchor.parentElement!.offsetTop + headingAnchor.offsetTop; scrollParent.scrollTop = scrollOffset; } }); }
</s> remove const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); </s> add const headingAnchor = queryHTMLElement(scrollContainer, `a[data-route="${reference}"]`); </s> remove function scrollToReference(reference: string, container: HTMLElement, scrollParent = document.documentElement) { </s> add function scrollToReference(reference: string, scrollContainer: HTMLElement) { </s> remove }; </s> add </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null;
scrollContainer.scrollTop = scrollOffset;
requestAnimationFrame(() => { const headingAnchor = queryHTMLElement(container, `a[data-route="${reference}"]`); if (headingAnchor != null && headingAnchor.parentElement != null) { const scrollOffset = headingAnchor.parentElement!.offsetTop + headingAnchor.offsetTop; scrollContainer.scrollTop = scrollOffset; } }); }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/documentation.tsx
import classNames from "classnames"; import * as React from "react"; import { IHeadingNode, IPageNode, isPageNode } from "documentalist/dist/client"; export interface INavMenuProps extends IProps { activePageId: string; activeSectionId: string; level: number; onItemClick: (reference: string) => void;
</s> remove import { findDOMNode } from "react-dom"; </s> add </s> remove onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; </s> add onClose: () => void; </s> remove import { Icon } from "@blueprintjs/core"; </s> add import { AnchorButton, Classes, Intent } from "@blueprintjs/core";
import { INavMenuItemProps, NavMenuItem } from "./navMenuItem";
import classNames from "classnames"; import * as React from "react"; import { IHeadingNode, IPageNode, isPageNode } from "documentalist/dist/client"; import { INavMenuItemProps, NavMenuItem } from "./navMenuItem"; export interface INavMenuProps extends IProps { activePageId: string; activeSectionId: string; level: number; onItemClick: (reference: string) => void;
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
export interface INavMenuProps extends IProps { activePageId: string; activeSectionId: string; onItemClick: (reference: string) => void; items: Array<IPageNode | IHeadingNode>; renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; } export const NavMenu: React.SFC<INavMenuProps> = props => {
</s> remove onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; </s> add onClose: () => void; </s> remove export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; </s> add
level: number;
export interface INavMenuProps extends IProps { activePageId: string; activeSectionId: string; level: number; onItemClick: (reference: string) => void; items: Array<IPageNode | IHeadingNode>; renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; } export const NavMenu: React.SFC<INavMenuProps> = props => {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
level: number; onItemClick: (reference: string) => void; items: Array<IPageNode | IHeadingNode>; } export const NavMenu: React.SFC<INavMenuProps> = props => { const { renderNavMenuItem = NavMenuItem } = props; const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route;
</s> remove export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; </s> add </s> remove onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; </s> add onClose: () => void;
renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element;
level: number; onItemClick: (reference: string) => void; items: Array<IPageNode | IHeadingNode>; renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; } export const NavMenu: React.SFC<INavMenuProps> = props => { const { renderNavMenuItem = NavMenuItem } = props; const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
onItemClick: (reference: string) => void; items: Array<IPageNode | IHeadingNode>; } export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; export const NavMenu: React.SFC<INavMenuProps> = props => { const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route; const isExpanded = isActive || isParentOfRoute(section.route, props.activeSectionId); // active section gets selected styles, expanded section shows its children
</s> remove const itemClasses = classNames({ "docs-nav-expanded": isExpanded }); const childrenMenu = isPageNode(section) ? <NavMenu {...props} items={section.children} /> : undefined; </s> add const itemClasses = classNames(`depth-${section.level - props.level - 1}`, { "docs-nav-expanded": isExpanded, [Classes.ACTIVE]: isActive, }); const item = renderNavMenuItem({ className: itemClasses, href: "#" + section.route, isActive, isExpanded, onClick: () => props.onItemClick(section.route), section, }); </s> remove <NavMenuItem className={itemClasses} key={section.route} item={section} isActive={isActive} onClick={props.onItemClick} > {childrenMenu} </NavMenuItem> </s> add <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li>
onItemClick: (reference: string) => void; items: Array<IPageNode | IHeadingNode>; } export const NavMenu: React.SFC<INavMenuProps> = props => { const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route; const isExpanded = isActive || isParentOfRoute(section.route, props.activeSectionId); // active section gets selected styles, expanded section shows its children
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; } export const NavMenu: React.SFC<INavMenuProps> = props => { const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route; const isExpanded = isActive || isParentOfRoute(section.route, props.activeSectionId); // active section gets selected styles, expanded section shows its children
</s> remove const itemClasses = classNames({ "docs-nav-expanded": isExpanded }); const childrenMenu = isPageNode(section) ? <NavMenu {...props} items={section.children} /> : undefined; </s> add const itemClasses = classNames(`depth-${section.level - props.level - 1}`, { "docs-nav-expanded": isExpanded, [Classes.ACTIVE]: isActive, }); const item = renderNavMenuItem({ className: itemClasses, href: "#" + section.route, isActive, isExpanded, onClick: () => props.onItemClick(section.route), section, }); </s> remove export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; </s> add </s> remove <NavMenuItem className={itemClasses} key={section.route} item={section} isActive={isActive} onClick={props.onItemClick} > {childrenMenu} </NavMenuItem> </s> add <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li>
const { renderNavMenuItem = NavMenuItem } = props;
renderNavMenuItem?: (props: INavMenuItemProps) => JSX.Element; } export const NavMenu: React.SFC<INavMenuProps> = props => { const { renderNavMenuItem = NavMenuItem } = props; const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route; const isExpanded = isActive || isParentOfRoute(section.route, props.activeSectionId); // active section gets selected styles, expanded section shows its children
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route; const isExpanded = isActive || isParentOfRoute(section.route, props.activeSectionId); // active section gets selected styles, expanded section shows its children const itemClasses = classNames({ "docs-nav-expanded": isExpanded }); const childrenMenu = isPageNode(section) ? <NavMenu {...props} items={section.children} /> : undefined; return ( <NavMenuItem className={itemClasses} key={section.route} item={section}
</s> remove <NavMenuItem className={itemClasses} key={section.route} item={section} isActive={isActive} onClick={props.onItemClick} > {childrenMenu} </NavMenuItem> </s> add <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> </s> remove export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; </s> add </s> remove const match = /docs\/v([0-9]+)/.exec(location.href); // default to latest release if we can't find a major version in the URL const currentRelease = match == null ? versions[versions.length - 1].version : match[1]; const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />); const menu = <Menu className="docs-version-list">{releaseItems}</Menu>; return ( <Popover content={menu} position={Position.BOTTOM} key="_versions"> <button className="docs-version-selector pt-text-muted"> v{currentRelease} <Icon icon="caret-down" /> </button> </Popover> ); } </s> add if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; };
const itemClasses = classNames(`depth-${section.level - props.level - 1}`, { "docs-nav-expanded": isExpanded, [Classes.ACTIVE]: isActive, }); const item = renderNavMenuItem({ className: itemClasses, href: "#" + section.route, isActive, isExpanded, onClick: () => props.onItemClick(section.route), section, });
const menu = props.items.map(section => { const isActive = props.activeSectionId === section.route; const isExpanded = isActive || isParentOfRoute(section.route, props.activeSectionId); // active section gets selected styles, expanded section shows its children const itemClasses = classNames(`depth-${section.level - props.level - 1}`, { "docs-nav-expanded": isExpanded, [Classes.ACTIVE]: isActive, }); const item = renderNavMenuItem({ className: itemClasses, href: "#" + section.route, isActive, isExpanded, onClick: () => props.onItemClick(section.route), section, }); const itemClasses = classNames(`depth-${section.level - props.level - 1}`, { "docs-nav-expanded": isExpanded, [Classes.ACTIVE]: isActive, }); const item = renderNavMenuItem({ className: itemClasses, href: "#" + section.route, isActive, isExpanded, onClick: () => props.onItemClick(section.route), section, }); return ( <NavMenuItem className={itemClasses} key={section.route} item={section}
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
// active section gets selected styles, expanded section shows its children const itemClasses = classNames({ "docs-nav-expanded": isExpanded }); const childrenMenu = isPageNode(section) ? <NavMenu {...props} items={section.children} /> : undefined; return ( <NavMenuItem className={itemClasses} key={section.route} item={section} isActive={isActive} onClick={props.onItemClick} > {childrenMenu} </NavMenuItem> ); }); const classes = classNames("docs-nav-menu", "pt-list-unstyled", props.className); return <ul className={classes}>{menu}</ul>; };
</s> remove const itemClasses = classNames({ "docs-nav-expanded": isExpanded }); const childrenMenu = isPageNode(section) ? <NavMenu {...props} items={section.children} /> : undefined; </s> add const itemClasses = classNames(`depth-${section.level - props.level - 1}`, { "docs-nav-expanded": isExpanded, [Classes.ACTIVE]: isActive, }); const item = renderNavMenuItem({ className: itemClasses, href: "#" + section.route, isActive, isExpanded, onClick: () => props.onItemClick(section.route), section, }); </s> remove export interface INavMenuItemProps extends IProps { item: IPageNode | IHeadingNode; isActive: boolean; onClick: (reference: string) => void; } // tslint:disable-next-line:max-line-length export const NavMenuItem: React.SFC<INavMenuItemProps & { children?: React.ReactNode }> = props => { const { item } = props; const classes = classNames( "docs-menu-item", `docs-menu-item-${isPageNode(item) ? "page" : "heading"}`, `depth-${item.level}`, props.className, ); const itemClasses = classNames(Classes.MENU_ITEM, { [Classes.ACTIVE]: props.isActive, [Classes.INTENT_PRIMARY]: props.isActive, }); const handleClick = () => props.onClick(item.route); return ( <li className={classes} key={item.route}> <a className={itemClasses} href={"#" + item.route} onClick={handleClick}> {item.title} </a> {props.children} </li> ); }; NavMenuItem.displayName = "Docs2.NavMenuItem"; </s> add </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove const match = /docs\/v([0-9]+)/.exec(location.href); // default to latest release if we can't find a major version in the URL const currentRelease = match == null ? versions[versions.length - 1].version : match[1]; const releaseItems = versions.map((rel, i) => <MenuItem key={i} href={rel.url} text={rel.version} />); const menu = <Menu className="docs-version-list">{releaseItems}</Menu>; return ( <Popover content={menu} position={Position.BOTTOM} key="_versions"> <button className="docs-version-selector pt-text-muted"> v{currentRelease} <Icon icon="caret-down" /> </button> </Popover> ); } </s> add if (props.section.title === "Components") { // non-interactive header that expands its menu return <div className="docs-nav-section docs-nav-expanded">{props.section.title}</div>; } return <NavMenuItem {...props} />; };
<li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li>
// active section gets selected styles, expanded section shows its children const itemClasses = classNames({ "docs-nav-expanded": isExpanded }); const childrenMenu = isPageNode(section) ? <NavMenu {...props} items={section.children} /> : undefined; return ( <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> <li key={section.route}> {item} {isPageNode(section) ? <NavMenu {...props} level={section.level} items={section.children} /> : null} </li> ); }); const classes = classNames("docs-nav-menu", "pt-list-unstyled", props.className); return <ul className={classes}>{menu}</ul>; };
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navMenu.tsx
* * Licensed under the terms of the LICENSE file distributed with this project. */ import { Classes, Hotkey, Hotkeys, HotkeysTarget, InputGroup, Keys, Popover, Position, Utils } from "@blueprintjs/core"; import { IconContents } from "@blueprintjs/icons"; import classNames from "classnames"; import { IHeadingNode, IPageNode } from "documentalist/dist/client"; import { filter } from "fuzzaldrin-plus"; import * as React from "react";
</s> remove import { Icon, Menu, MenuItem, Popover, Position, setHotkeysDialogProps } from "@blueprintjs/core"; </s> add import { Classes, setHotkeysDialogProps } from "@blueprintjs/core"; </s> remove import { Classes, Intent, Tag } from "@blueprintjs/core"; </s> add import { Classes, Intent, IProps, Tag } from "@blueprintjs/core"; </s> remove import { Icon } from "@blueprintjs/core"; </s> add import { AnchorButton, Classes, Intent } from "@blueprintjs/core"; </s> remove import { Dialog, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Utils } from "@blueprintjs/core"; </s> add import { Classes, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Overlay, Utils } from "@blueprintjs/core";
import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select";
* * Licensed under the terms of the LICENSE file distributed with this project. */ import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select"; import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select"; import classNames from "classnames"; import { IHeadingNode, IPageNode } from "documentalist/dist/client"; import { filter } from "fuzzaldrin-plus"; import * as React from "react";
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
import classNames from "classnames"; import { IHeadingNode, IPageNode } from "documentalist/dist/client"; import { filter } from "fuzzaldrin-plus"; import * as React from "react"; import { findDOMNode } from "react-dom"; import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; export interface INavigatorProps {
</s> remove import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; </s> add import { eachLayoutNode } from "../common/utils"; </s> remove import { Classes, Hotkey, Hotkeys, HotkeysTarget, InputGroup, Keys, Popover, Position, Utils } from "@blueprintjs/core"; import { IconContents } from "@blueprintjs/icons"; </s> add import { Classes, Icon, MenuItem } from "@blueprintjs/core"; import { ItemListPredicate, ItemRenderer, Omnibar } from "@blueprintjs/select"; </s> remove import { Dialog, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Utils } from "@blueprintjs/core"; </s> add import { Classes, FocusStyleManager, Hotkey, Hotkeys, HotkeysTarget, IProps, Overlay, Utils } from "@blueprintjs/core";
import classNames from "classnames"; import { IHeadingNode, IPageNode } from "documentalist/dist/client"; import { filter } from "fuzzaldrin-plus"; import * as React from "react"; import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; export interface INavigatorProps {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
import { filter } from "fuzzaldrin-plus"; import * as React from "react"; import { findDOMNode } from "react-dom"; import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; export interface INavigatorProps { items: Array<IPageNode | IHeadingNode>; onNavigate: (id: string) => void; }
</s> remove import { findDOMNode } from "react-dom"; </s> add </s> remove onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; </s> add onClose: () => void;
import { eachLayoutNode } from "../common/utils";
import { filter } from "fuzzaldrin-plus"; import * as React from "react"; import { findDOMNode } from "react-dom"; import { eachLayoutNode } from "../common/utils"; import { eachLayoutNode } from "../common/utils"; export interface INavigatorProps { items: Array<IPageNode | IHeadingNode>; onNavigate: (id: string) => void; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
import { eachLayoutNode } from "../common/utils"; export interface INavigatorProps { items: Array<IPageNode | IHeadingNode>; onClose: () => void; } export interface INavigationSection {
</s> remove onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; </s> add onClose: () => void; </s> remove import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; </s> add import { eachLayoutNode } from "../common/utils"; </s> remove import { findDOMNode } from "react-dom"; </s> add
isOpen: boolean;
import { eachLayoutNode } from "../common/utils"; export interface INavigatorProps { isOpen: boolean; items: Array<IPageNode | IHeadingNode>; onClose: () => void; } export interface INavigationSection {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
import { handleStringChange } from "./baseExample"; export interface INavigatorProps { items: Array<IPageNode | IHeadingNode>; onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; } export interface INavigationSection { filterKey: string; path: string[];
</s> remove import { createKeyEventHandler, eachLayoutNode } from "../common/utils"; import { handleStringChange } from "./baseExample"; </s> add import { eachLayoutNode } from "../common/utils"; </s> remove export interface IInterfaceTableProps { </s> add export interface IInterfaceTableProps extends IProps {
onClose: () => void;
import { handleStringChange } from "./baseExample"; export interface INavigatorProps { items: Array<IPageNode | IHeadingNode>; onClose: () => void; onClose: () => void; onClose: () => void; onClose: () => void; onClose: () => void; onClose: () => void; onClose: () => void; } export interface INavigationSection { filterKey: string; path: string[];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
route: string; title: string; } const MENU_PADDING = 5; // $pt-grid-size / 2; @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [],
</s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> { </s> remove export interface IInterfaceTableProps { </s> add export interface IInterfaceTableProps extends IProps { </s> remove onNavigate: (id: string) => void; } export interface INavigatorState { matches: INavigationSection[]; query: string; selectedIndex: number; </s> add onClose: () => void;
const NavOmnibar = Omnibar.ofType<INavigationSection>();
route: string; title: string; } const NavOmnibar = Omnibar.ofType<INavigationSection>(); @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [],
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
} const MENU_PADDING = 5; // $pt-grid-size / 2; @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); private sections: INavigationSection[]; /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change.
</s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add </s> remove const MENU_PADDING = 5; // $pt-grid-size / 2; </s> add const NavOmnibar = Omnibar.ofType<INavigationSection>(); </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; </s> remove public static defaultProps = { navbarLeft: "Documentation", }; </s> add </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> );
export class Navigator extends React.PureComponent<INavigatorProps> {
} const MENU_PADDING = 5; // $pt-grid-size / 2; export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { export class Navigator extends React.PureComponent<INavigatorProps> { private sections: INavigationSection[]; /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
// tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); private sections: INavigationSection[]; /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } public componentDidMount() { this.sections = []; eachLayoutNode(this.props.items, (node, parents) => { const { route, title } = node; const path = parents.map(p => p.title).reverse();
</s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> { </s> remove const filterKey = [...path, title].join("/"); </s> add const filterKey = [...path, "`" + title].join("/"); </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null; </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true });
// tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); private sections: INavigationSection[]; public componentDidMount() { this.sections = []; eachLayoutNode(this.props.items, (node, parents) => { const { route, title } = node; const path = parents.map(p => p.title).reverse();
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
this.sections = []; eachLayoutNode(this.props.items, (node, parents) => { const { route, title } = node; const path = parents.map(p => p.title).reverse(); const filterKey = [...path, title].join("/"); this.sections.push({ filterKey, path, route, title }); }); } public componentDidUpdate() {
</s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add </s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null; </s> remove scrollParent.scrollTop = scrollOffset; </s> add scrollContainer.scrollTop = scrollOffset; </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove const themeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(themeName); setHotkeysDialogProps({ className: this.state.themeName }); this.setState({ themeName }); </s> add const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName });
const filterKey = [...path, "`" + title].join("/");
this.sections = []; eachLayoutNode(this.props.items, (node, parents) => { const { route, title } = node; const path = parents.map(p => p.title).reverse(); const filterKey = [...path, "`" + title].join("/"); this.sections.push({ filterKey, path, route, title }); }); } public componentDidUpdate() {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
this.sections.push({ filterKey, path, route, title }); }); } public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; } return ( <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div>
</s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove const filterKey = [...path, title].join("/"); </s> add const filterKey = [...path, "`" + title].join("/"); </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; </s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add </s> remove const navMenuElement = this.navElement .querySelector(`a[href="#${activeSectionId}"]`) .closest(".docs-menu-item-page"); </s> add const navMenuElement = this.navElement.querySelector(`a[href="#${activeSectionId}"]`);
public render() { if (!this.sections) { return null;
this.sections.push({ filterKey, path, route, title }); }); } public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; public render() { if (!this.sections) { return null; } return ( <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div>
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
</a>, ]; } return ( <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> ); } private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) {
</s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null; </s> remove private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { </s> add private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); </s> remove }; </s> add </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> );
<NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} />
</a>, ]; } return ( <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> ); } private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
</div> ); } private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); }
</s> remove private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); </s> add private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; </s> remove }; </s> add </s> remove <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> </s> add <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> </s> remove private renderVersionsMenu() { const { versions } = this.props; if (versions.length === 1) { </s> add private renderNavMenuItem = (props: INavMenuItemProps) => { if (isPageNode(props.section) && props.section.level === 1) { const pkg = this.props.releases.find(p => p.name === `@blueprintjs/${props.section.route}`); </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> );
private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true });
</div> ); } private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
this.inputRef.focus(); } }; private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); } }; private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement;
</s> remove }; </s> add </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove const themeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(themeName); setHotkeysDialogProps({ className: this.state.themeName }); this.setState({ themeName }); </s> add const nextThemeName = useDark ? DARK_THEME : LIGHT_THEME; setTheme(nextThemeName); setHotkeysDialogProps({ className: nextThemeName }); this.setState({ themeName: nextThemeName }); </s> remove this.setState({ activePageId, activeSectionId }); </s> add this.setState({ activePageId, activeSectionId, isNavigatorOpen: false });
private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null;
this.inputRef.focus(); } }; private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; } }; private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); } }; private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el);
</s> remove private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); </s> add private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove <div className={Classes.MENU} ref={this.refHandlers.menu}> {items} </div> </s> add <NavOmnibar className="docs-navigator-menu" itemListPredicate={this.filterMatches} isOpen={this.props.isOpen} items={this.sections} itemRenderer={this.renderItem} onItemSelect={this.handleItemSelect} onClose={this.props.onClose} resetOnSelect={true} /> </s> remove /** * flag indicating that we should check whether selected item is in viewport after rendering, * typically because of keyboard change. */ private shouldCheckSelectedInViewport: boolean; private handleQueryChange = handleStringChange(this.resetState); private handleKeyDown = createKeyEventHandler({ [Keys.ARROW_DOWN]: this.selectNext(), [Keys.ARROW_UP]: this.selectNext(-1), [Keys.ENTER]: () => { const activeItem = findDOMNode(this).querySelector( `.${Classes.MENU_ITEM}.${Classes.ACTIVE}`, ) as HTMLElement; if (activeItem != null) { activeItem.click(); } }, }); public render() { return ( <Popover autoFocus={false} enforceFocus={false} className="docs-navigator" content={this.renderPopover()} onInteraction={this.handlePopoverInteraction} isOpen={this.state.query.length > 0} minimal={true} position={Position.BOTTOM_LEFT} usePortal={false} > <InputGroup autoComplete="off" autoFocus={true} inputRef={this.refHandlers.input} leftIcon="search" onChange={this.handleQueryChange} onKeyDown={this.handleKeyDown} placeholder="Search..." type="search" value={this.state.query} /> </Popover> ); } public renderHotkeys() { return ( <Hotkeys> <Hotkey global={true} combo="shift + s" label="Focus documentation search box" onKeyDown={this.handleFocusSearch} /> </Hotkeys> ); } </s> add
private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); } private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
this.resetState(); } }; private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } }; private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update.
</s> remove }; </s> add </s> remove private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } </s> add // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; </s> remove private handlePopoverInteraction = (nextOpenState: boolean) => { if (!nextOpenState) { this.resetState(); </s> add private renderItem: ItemRenderer<INavigationSection> = (section, props) => { if (!props.modifiers.matchesPredicate) { return null; </s> remove private handleFocusSearch = (e: KeyboardEvent) => { if (this.inputRef != null) { e.preventDefault(); this.inputRef.focus(); } }; </s> add private filterMatches: ItemListPredicate<INavigationSection> = (query, items) => filter(items, query, { key: "filterKey", isPath: true }); </s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> {
const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> );
this.resetState(); } }; const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); }; private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update.
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx
this.setState({ ...this.state, selectedIndex }); } }; private selectNext(direction = 1) { return () => { // indicate that the selected item may need to be scrolled into view after update. // this is not possible with mouse hover cuz you can't hover on something off screen. this.shouldCheckSelectedInViewport = true; const { matches, selectedIndex } = this.state; this.setState({ ...this.state, selectedIndex: Utils.clamp(selectedIndex + direction, 0, matches.length - 1), }); }; } }
</s> remove private handleResultHover = (e: React.MouseEvent<HTMLAnchorElement>) => { const el = e.currentTarget as HTMLElement; if (el.parentElement != null) { const selectedIndex: number = Array.prototype.indexOf.call(el.parentElement.children, el); this.setState({ ...this.state, selectedIndex }); } </s> add const classes = classNames({ [Classes.ACTIVE]: props.modifiers.active, [Classes.INTENT_PRIMARY]: props.modifiers.active, }); // insert caret-right between each path element const pathElements = section.path.reduce<React.ReactChild[]>((elems, el) => { elems.push(el, <Icon icon="caret-right" />); return elems; }, []); pathElements.pop(); const text = ( <> <div>{section.title}</div> <small className={Classes.TEXT_MUTED}>{pathElements}</small> </> ); return ( <MenuItem className={classes} href={"#" + section.route} key={section.route} multiline={true} onClick={props.handleClick} text={text} /> ); </s> remove public componentDidUpdate() { if (this.shouldCheckSelectedInViewport && this.menuRef != null) { const selectedElement = this.menuRef.querySelector(`.${Classes.INTENT_PRIMARY}`) as HTMLElement; const { offsetTop: selectedTop, offsetHeight: selectedHeight } = selectedElement; const { scrollTop: menuScrollTop, clientHeight: menuHeight } = this.menuRef; if (selectedTop + selectedHeight > menuScrollTop + menuHeight) { // offscreen bottom: scroll such that one full item is visible above + menu padding this.menuRef.scrollTop = selectedTop - selectedHeight - MENU_PADDING; } else if (selectedTop < menuScrollTop) { // offscreen top: scroll such that one full item is visible below + menu padding this.menuRef.scrollTop = selectedTop - menuHeight + selectedHeight * 2 + MENU_PADDING; } // reset the flag this.shouldCheckSelectedInViewport = false; } } private getMatches(query: string) { return filter(this.sections, query, { key: "filterKey" }); } private renderPopover() { const { matches, selectedIndex } = this.state; let items = matches.map((section, index) => { const isSelected = index === selectedIndex; const classes = classNames(Classes.MENU_ITEM, Classes.POPOVER_DISMISS, { [Classes.ACTIVE]: isSelected, [Classes.INTENT_PRIMARY]: isSelected, }); const headerHtml = { __html: section.title }; // add $icons16-family to font stack to support mixing icons with regular text! const pathHtml = { __html: section.path.join(IconContents.CARET_RIGHT) }; return ( <a className={classes} href={"#" + section.route} key={section.route} onMouseEnter={this.handleResultHover} > <small className="docs-result-path pt-text-muted" dangerouslySetInnerHTML={pathHtml} /> <div dangerouslySetInnerHTML={headerHtml} /> </a> ); }); if (items.length === 0) { items = [ <a className={classNames(Classes.MENU_ITEM, Classes.DISABLED)} key="none"> No results. Press <code>esc</code> to reset. </a>, ]; </s> add public render() { if (!this.sections) { return null; </s> remove @HotkeysTarget export class Navigator extends React.PureComponent<INavigatorProps, INavigatorState> { public state: INavigatorState = { matches: [], query: "", selectedIndex: 0, }; private inputRef: HTMLElement; private menuRef: HTMLElement; private refHandlers = { input: (ref: HTMLElement) => (this.inputRef = ref), menu: (ref: HTMLElement) => (this.menuRef = ref), }; // this guy must be defined before he's used in handleQueryChange // and it just makes sense to be up here with state init // tslint:disable:member-ordering private resetState = (query = "") => this.setState({ matches: this.getMatches(query), query, selectedIndex: 0 }); </s> add export class Navigator extends React.PureComponent<INavigatorProps> { </s> remove this.setState({ activePageId, activeSectionId }); </s> add this.setState({ activePageId, activeSectionId, isNavigatorOpen: false });
// updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); };
this.setState({ ...this.state, selectedIndex }); } }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; // updating location.hash will trigger hashchange event, which Documentation will receive and use to navigate. private handleItemSelect = (item: INavigationSection) => { location.hash = item.route; this.props.onClose(); }; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep" ]
[2.0] docs site redesign! (#2243) * new docs design * add icons for icons and select * move Banner into docs-theme * fix logo/title alignment * NavbarActions uses ButtonGroup * replace navbarLeft/Right props with one title prop * nav styles * refactor Navigator to use Omnibar, separate NavigatorTrigger SFC * add select dependency * add renderNavMenuItem prop to Documentation refactor NavMenu & NavMenuItem accordingly * refactor NavMenu styles and pull NavMenuItem to separate file * custom nav menu items in BlueprintDocs * rename JS table page * update timezone icon, mute pkg version link * big refactors to docs-theme flex layout with contrasting background on sidebar, cool nav buttons, lots of padding cleanup * NavbarActions => NavHeader, new style * tweak spacing variables * improve pkg icon colors * navigator styles * prevent body scrolling * prevent nav wrapper from scrolling horizontally * delete unnecessary SVG assets * update timezone icon * fill-rule -> fillRule * more squared off padding for the content * API dialog is now a an overlay * fix alignment of interface description and first th/td * tweak dark props overlay shadow * Documentation banner prop, simplify banner styles * start fixing TypeAliasTable * dark theme on API overlay * fix type alias style * navigator changes hash * fix package name alignment in modifiers table * remove outline on content wrapper (because of tabIndex) * fix running-text issues with optional className in renderBlock * versions menu in navHeader * delete unused navbar styles, move some to docs-app * KeyCombo minimal modifiers renders short hotkey, use it in NavButton * fix padding on docs-section in interface table * fix padding of interface docs * renderBlock wraps all contents in a single element * fix Color aliases table, remove huge unused comment * use interactive tags for View Source links * move documentation scroll handler to fix scrollspy * small fixes: examples alignment, renderBlock key, banner height * fix the running-text problems once and for all! apply the class to direct parent of rendered markdown (ie, "running text") * docs-flex layout uses pt-flex-container, fix banner height * switch View Source link to minimal button (clickable) * fix icons list width * :star2: Components becomes non-interactive header that expands its menu! * switch back to body scroll container layout * prevent page shift when Overlay open: inject some styles to add padding equal to scrollbar width when Overlay open * restore scroll spy * new Logo component rendering logo SVG inline * refactor logo styles, delete old SVG files * small navigator style fixes close navigator when an item is selected, in case it's the current section * fix docs-nav height with banner * fix sidebar width, remove left padding * fix api overlay desc size make sure the interface description doesn't shrink in api overlay * make copy to clipboard tick consistent everywhere
https://github.com/palantir/blueprint/commit/aa7c73670a867f3244f4001d83436244f4a0afc1
packages/docs-theme/src/components/navigator.tsx