Skip to content

Commit

Permalink
Merge branch 'patternfly:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wise-king-sullyman authored Oct 10, 2023
2 parents da01c42 + 8696649 commit 20e4c5a
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 123 deletions.
6 changes: 3 additions & 3 deletions packages/demo-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"serve:demo-app": "node scripts/serve"
},
"dependencies": {
"@patternfly/react-core": "^5.0.0",
"@patternfly/react-icons": "^5.0.0",
"@patternfly/react-styles": "^5.0.0",
"@patternfly/react-core": "^5.1.1",
"@patternfly/react-icons": "^5.1.1",
"@patternfly/react-styles": "^5.1.1",
"react": "^18",
"react-dom": "^18",
"react-router": "^5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/demo-app-ts/src/utils/useTopologyOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export const useTopologyOptions = (
const saveModel = () => {
setSavedModel(controller.toModel());
setModelSaved(true);
window.setTimeout(() => {
setTimeout(() => {
setModelSaved(false);
}, 2000);
};
Expand Down
14 changes: 7 additions & 7 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"tag": "prerelease"
},
"dependencies": {
"@patternfly/react-core": "^5.0.0",
"@patternfly/react-icons": "^5.0.0",
"@patternfly/react-styles": "^5.0.0",
"@patternfly/react-core": "^5.1.1",
"@patternfly/react-icons": "^5.1.1",
"@patternfly/react-styles": "^5.1.1",
"@types/d3": "^7.4.0",
"@types/d3-force": "^1.2.1",
"@types/dagre": "0.7.42",
Expand All @@ -56,11 +56,11 @@
"react-dom": "^17 || ^18"
},
"devDependencies": {
"@patternfly/documentation-framework": "^5.0.15",
"@patternfly/patternfly": "^5.0.0",
"@patternfly/documentation-framework": "^5.2.15",
"@patternfly/patternfly": "^5.1.0",
"@patternfly/patternfly-a11y": "^4.3.1",
"@patternfly/react-code-editor": "^5.0.0",
"@patternfly/react-table": "^5.0.0",
"@patternfly/react-code-editor": "^5.1.1",
"@patternfly/react-table": "^5.1.1",
"@types/lodash": "^4.14.191",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/behavior/useDndDrag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const useDndDrag = <
React.useEffect(
() => () => {
if (canUseDOM) {
d3.select(window.document).on(createKeyHandlerId(), null);
d3.select(document).on(createKeyHandlerId(), null);
}
if (dndManager.isDragging() && dndManager.getSourceId() === monitor.getHandlerId()) {
dndManager.endDrag();
Expand Down
7 changes: 0 additions & 7 deletions packages/module/src/components/SVGArrowMarker.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import * as React from 'react';
import SVGDefs from './defs/SVGDefs';

declare const global: any;

// workaround to pass docs building
if (!global.SVGElement) {
global.SVGElement = global.Element;
}

interface SVGArrowMarkerProps {
id: string;
nodeSize: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports[`TopologyControlBar should accept button options correctly 1`] = `
style="display: contents;"
>
<button
aria-describedby="pf-tooltip-11"
aria-disabled="false"
class="pf-v5-c-button pf-m-tertiary pf-topology-control-bar__button"
data-ouia-component-id="OUIA-Generated-Button-tertiary-6"
Expand Down Expand Up @@ -119,14 +120,6 @@ exports[`TopologyControlBar should accept button options correctly 1`] = `
</div>
</div>
</div>
<div
class="pf-v5-c-toolbar__expandable-content"
id="pf-topology-control-bar-1-expandable-content-1"
>
<div
class="pf-v5-c-toolbar__group"
/>
</div>
</div>
<div
class="pf-v5-c-toolbar__content pf-m-hidden"
Expand Down Expand Up @@ -166,6 +159,7 @@ exports[`TopologyControlBar should display the default controls correctly 1`] =
style="display: contents;"
>
<button
aria-describedby="pf-tooltip-5"
aria-disabled="false"
class="pf-v5-c-button pf-m-tertiary pf-topology-control-bar__button"
data-ouia-component-id="OUIA-Generated-Button-tertiary-1"
Expand Down Expand Up @@ -320,14 +314,6 @@ exports[`TopologyControlBar should display the default controls correctly 1`] =
</div>
</div>
</div>
<div
class="pf-v5-c-toolbar__expandable-content"
id="pf-topology-control-bar-0-expandable-content-0"
>
<div
class="pf-v5-c-toolbar__group"
/>
</div>
</div>
<div
class="pf-v5-c-toolbar__content pf-m-hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ exports[`TopologyView should display topology correctly 1`] = `
/>
</div>
</div>
<div
class="pf-v5-c-toolbar__expandable-content"
id="pf-topology-view-0-expandable-content-0"
>
<div
class="pf-v5-c-toolbar__group"
/>
</div>
</div>
<div
class="pf-v5-c-toolbar__content"
Expand All @@ -70,14 +62,6 @@ exports[`TopologyView should display topology correctly 1`] = `
/>
</div>
</div>
<div
class="pf-v5-c-toolbar__expandable-content"
id="pf-topology-view-0-expandable-content-1"
>
<div
class="pf-v5-c-toolbar__group"
/>
</div>
</div>
<hr
class="pf-v5-c-divider"
Expand Down
8 changes: 4 additions & 4 deletions packages/module/src/components/nodes/DefaultNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const DefaultNodeInner: React.FunctionComponent<DefaultNodeInnerProps> = observe
setNodeScale(1);
nodeScaled.current = false;
if (animationRef.current) {
window.cancelAnimationFrame(animationRef.current);
cancelAnimationFrame(animationRef.current);
animationRef.current = 0;
}
} else {
Expand All @@ -278,7 +278,7 @@ const DefaultNodeInner: React.FunctionComponent<DefaultNodeInnerProps> = observe
const nextScale = Math.min(scale + scaleDelta * scalePercent, scaleGoal.current);
setNodeScale(nextScale);
if (nextScale < scaleGoal.current) {
animationRef.current = window.requestAnimationFrame(bumpScale);
animationRef.current = requestAnimationFrame(bumpScale);
} else {
nodeScaled.current = true;
animationRef.current = 0;
Expand All @@ -288,12 +288,12 @@ const DefaultNodeInner: React.FunctionComponent<DefaultNodeInnerProps> = observe
if (nodeScaled.current) {
setNodeScale(scaleGoal.current);
} else if (!animationRef.current) {
animationRef.current = window.requestAnimationFrame(bumpScale);
animationRef.current = requestAnimationFrame(bumpScale);
}
}
return () => {
if (animationRef.current) {
window.cancelAnimationFrame(animationRef.current);
cancelAnimationFrame(animationRef.current);
animationRef.current = 0;
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/components/svg/SvgDropShadowFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const SvgDropShadowFilter: React.FunctionComponent<SvgDropShadowFilterProps> = (
floodColor = globalBlack1000.value,
floodOpacity = 0.2
}) => {
if (window.navigator.userAgent.includes('Edge')) {
if (navigator.userAgent.includes('Edge')) {
// feDropShadow is not supported by Edge
return (
<SVGDefs id={id}>
Expand Down
8 changes: 4 additions & 4 deletions packages/module/src/hooks/useScaleNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const useScaleNode = (scaleNode: boolean, scale: number, scaleUpTime: number = 2
setNodeScale(1);
nodeScaled.current = false;
if (animationRef.current) {
window.cancelAnimationFrame(animationRef.current);
cancelAnimationFrame(animationRef.current);
animationRef.current = 0;
}
} else {
Expand All @@ -24,7 +24,7 @@ const useScaleNode = (scaleNode: boolean, scale: number, scaleUpTime: number = 2
const nextScale = Math.min(scale + scaleDelta * scalePercent, scaleGoal.current);
setNodeScale(nextScale);
if (nextScale < scaleGoal.current) {
animationRef.current = window.requestAnimationFrame(bumpScale);
animationRef.current = requestAnimationFrame(bumpScale);
} else {
nodeScaled.current = true;
animationRef.current = 0;
Expand All @@ -34,12 +34,12 @@ const useScaleNode = (scaleNode: boolean, scale: number, scaleUpTime: number = 2
if (nodeScaled.current) {
setNodeScale(scaleGoal.current);
} else if (!animationRef.current) {
animationRef.current = window.requestAnimationFrame(bumpScale);
animationRef.current = requestAnimationFrame(bumpScale);
}
}
return () => {
if (animationRef.current) {
window.cancelAnimationFrame(animationRef.current);
cancelAnimationFrame(animationRef.current);
animationRef.current = 0;
}
};
Expand Down
4 changes: 2 additions & 2 deletions packages/module/src/layouts/BaseLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class BaseLayout implements Layout {
private stopListening(): void {
const controller = this.graph.getController();
if (this.scheduleHandle) {
window.cancelAnimationFrame(this.scheduleHandle);
cancelAnimationFrame(this.scheduleHandle);
}
if (controller) {
controller.removeEventListener(ADD_CHILD_EVENT, this.handleChildAdded);
Expand Down Expand Up @@ -234,7 +234,7 @@ export class BaseLayout implements Layout {

private scheduleLayout = (): void => {
if (!this.scheduleHandle) {
this.scheduleHandle = window.requestAnimationFrame(() => {
this.scheduleHandle = requestAnimationFrame(() => {
delete this.scheduleHandle;
try {
this.runLayout(false, this.scheduleRestart);
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/utils/svg-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PointTuple } from '../types';
* @param id
*/
export function createSvgIdUrl(id: string): string {
return `url(${`${window.location.pathname}${window.location.search}`}#${id})`;
return `url(${`${location.pathname}${location.search}`}#${id})`;
}

export type HullPaddingGetter = (point: PointTuple) => number;
Expand Down
6 changes: 3 additions & 3 deletions packages/module/src/utils/useHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const useHover = <T extends Element>(
);

// The unset handle needs to be referred by listeners in different closures.
const unsetHandle = React.useRef<number>();
const unsetHandle = React.useRef<any>();

const callbackRef = useCallbackRef(
React.useCallback(
Expand All @@ -31,7 +31,7 @@ const useHover = <T extends Element>(
clearTimeout(delayHandle);

if (delay != null) {
delayHandle = window.setTimeout(() => {
delayHandle = setTimeout(() => {
clearTimeout(unsetHandle.current);
setHover(newState);
}, delay);
Expand Down Expand Up @@ -60,7 +60,7 @@ const useHover = <T extends Element>(
// This can happen with layers. Rendering a node to a new layer will unmount the old node
// and remount a new node at the same location. This will prevent flickering and getting
// stuck in a hover state.
unsetHandle.current = window.setTimeout(() => {
unsetHandle.current = setTimeout(() => {
if (mountRef.current) {
setHover(false);
}
Expand Down
Loading

0 comments on commit 20e4c5a

Please sign in to comment.