update: renaming stuff from react to "revue"

This commit is contained in:
Braks
2021-07-10 18:33:38 +02:00
parent 4661b685ad
commit 881655d483
35 changed files with 139 additions and 7009 deletions
@@ -45,7 +45,7 @@ const Background = defineComponent({
// when there are multiple flows on a page we need to make sure that every background gets its own pattern.
const patternId = `pattern-${Math.floor(Math.random() * 100000)}`;
const bgClasses = ['react-flow__background'];
const bgClasses = ['revue-flow__background'];
const scaledGap = computed(() => props.gap && props.gap * transform.value[2]);
const xOffset = computed(() => scaledGap.value && transform.value[0] % scaledGap.value);
const yOffset = computed(() => scaledGap.value && transform.value[1] % scaledGap.value);
+6 -6
View File
@@ -31,7 +31,7 @@ export const ControlButton = defineComponent({
},
setup(props, { slots }) {
return () => (
<button class={['react-flow__controls-button']} {...props}>
<button class={['revue-flow__controls-button']} {...props}>
{slots.default ? slots.default() : ''}
</button>
);
@@ -92,7 +92,7 @@ const Controls = defineComponent({
});
const isInteractive = pinia.nodesDraggable && pinia.nodesConnectable && pinia.elementsSelectable;
const mapClasses = ['react-flow__controls'];
const mapClasses = ['revue-flow__controls'];
const onZoomInHandler = () => {
zoomHelper.value.zoomIn?.();
@@ -122,21 +122,21 @@ const Controls = defineComponent({
<div class={mapClasses}>
{props.showZoom && (
<>
<ControlButton onClick={onZoomInHandler} class="react-flow__controls-zoomin">
<ControlButton onClick={onZoomInHandler} class="revue-flow__controls-zoomin">
<img src={'../../../assets/icons/plus.svg'} alt="Plus" />
</ControlButton>
<ControlButton onClick={onZoomOutHandler} class="react-flow__controls-zoomout">
<ControlButton onClick={onZoomOutHandler} class="revue-flow__controls-zoomout">
<img src={'../../../assets/icons/minus.svg'} alt="Minus" />
</ControlButton>
</>
)}
{props.showFitView && (
<ControlButton class="react-flow__controls-fitview" onClick={onFitViewHandler}>
<ControlButton class="revue-flow__controls-fitview" onClick={onFitViewHandler}>
<img src={'../../../assets/icons/fitview.svg'} alt="FitView" />
</ControlButton>
)}
{props.showInteractive && (
<ControlButton class="react-flow__controls-interactive" onClick={onInteractiveChangeHandler}>
<ControlButton class="revue-flow__controls-interactive" onClick={onInteractiveChangeHandler}>
{isInteractive ? (
<img src={'../../../assets/icons/unlock.svg'} alt="Unlock" />
) : (
@@ -67,7 +67,7 @@ const MiniMapNode = defineComponent({
return () => (
<rect
class={['react-flow__minimap-node']}
class={['revue-flow__minimap-node']}
x={props.x}
y={props.y}
rx={props.borderRadius}
+2 -2
View File
@@ -58,7 +58,7 @@ const MiniMap = defineComponent({
const pinia = store();
const transform = computed(() => pinia.transform);
const mapClasses = ['react-flow__minimap'];
const mapClasses = ['revue-flow__minimap'];
const elementWidth = computed(() => (attrs.style?.width || defaultWidth)! as number);
const elementHeight = computed(() => (attrs.style?.height || defaultHeight)! as number);
const nodeColorFunc = (props.nodeColor instanceof Function ? props.nodeColor : () => props.nodeColor) as StringFunc;
@@ -115,7 +115,7 @@ const MiniMap = defineComponent({
/>
))}
<path
class="react-flow__minimap-mask"
class="revue-flow__minimap-mask"
d={`M${x.value - offset.value},${y.value - offset.value}h${width.value + offset.value * 2}v${
height.value + offset.value * 2
}h${-width.value - offset.value * 2}z
+2 -2
View File
@@ -1,5 +1,5 @@
// These components are not used by React Flow directly
// but the user can add them as children of a React Flow component
// These components are not used by revue Flow directly
// but the user can add them as children of a revue Flow component
export { default as MiniMap } from './MiniMap';
export { default as Controls, ControlButton } from './Controls';