Skip to content

Commit

Permalink
Merge pull request #10 from Integreat/HEADROOM-4-UpgradePackages
Browse files Browse the repository at this point in the history
HEADROOM-4: Upgrade packages
  • Loading branch information
michael-markl authored Apr 27, 2020
2 parents 7075f32 + 36badcb commit bddfb6f
Show file tree
Hide file tree
Showing 16 changed files with 5,963 additions and 5,479 deletions.
7 changes: 0 additions & 7 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const useHMR = !!global.HMR // HotModuleReplacement
const config = {
presets: [
'@babel/preset-env',
Expand All @@ -20,10 +19,4 @@ const config = {
]
}

if (useHMR) {
config.babelrc = false
config.cacheDirectory = useHMR
config.plugins.unshift('react-hot-loader/babel')
}

module.exports = config
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ render () {

Go to [https://integreat.github.io/react-sticky-headroom/](https://integreat.github.io/react-sticky-headroom/) to view a demo:

[![demo gif](demo.gif)](https://www.npmjs.com/package/@integreat-app/react-sticky-headroom)
[![Demo](https://raw.githubusercontent.com/Integreat/react-sticky-headroom/master/demo.gif)](https://integreat.github.io/react-sticky-headroom/)


## API
Expand Down
2 changes: 1 addition & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Demo extends React.Component<{}, { stickyTop: number }> {
<h5>Submenu is always there for you, so keep on scrolling!</h5>
</Header>
</ReactStickyHeadroom>
<h2>You can look at the underlying code <a href='https://github.com/Integreat/react-sticky-headroom/tree/master/demo/Demo.js'>here</a>.</h2>
<h2>You can look at the underlying code <a href='https://github.com/Integreat/react-sticky-headroom/tree/master/demo/demo.js'>here</a>.</h2>
<h3>Look at all these cities grouped by their countries:</h3>
{Object.keys(CITIES).map(key =>
<div key={key}>
Expand Down
21 changes: 10 additions & 11 deletions docs/demo.js

Large diffs are not rendered by default.

133 changes: 71 additions & 62 deletions flow-typed/npm/enzyme_v3.x.x.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,66 @@
// flow-typed signature: f6bad512110ebc6da85b1ddda297fe3d
// flow-typed version: f04d291d8b/enzyme_v3.x.x/flow_>=v0.53.x
// flow-typed signature: 20e2bb4e722c2a79e4e0f178491bf6cc
// flow-typed version: 1f669c8dd2/enzyme_v3.x.x/flow_>=v0.104.x

declare module "enzyme" {
declare type PredicateFunction<T: Wrapper<*>> = (
wrapper: T,
index: number
) => boolean;
declare type UntypedSelector = string | {[key: string]: number|string|boolean};
declare type UntypedSelector = string | { [key: string]: number|string|boolean, ... };
declare type EnzymeSelector = UntypedSelector | React$ElementType;

// CheerioWrapper is a type alias for an actual cheerio instance
// TODO: Reference correct type from cheerio's type declarations
declare type CheerioWrapper = any;

declare class Wrapper<RootComponent> {
at(index: number): this,
childAt(index: number): this,
children(selector?: UntypedSelector): this,
children<T: React$ElementType>(selector: T): ReactWrapper<T>,
closest(selector: UntypedSelector): this,
closest<T: React$ElementType>(selector: T): ReactWrapper<T>,
contains(nodes: React$Element<any> | $ReadOnlyArray<React$Element<any>>): boolean,
containsAllMatchingElements(nodes: $ReadOnlyArray<React$Element<any>>): boolean,
containsAnyMatchingElements(nodes: $ReadOnlyArray<React$Element<any>>): boolean,
containsMatchingElement(node: React$Element<any>): boolean,
context(key?: string): any,
debug(options?: Object): string,
dive(option?: { context?: Object, ... }): this,
equals(node: React$Element<any>): boolean,
find(selector: UntypedSelector): this,
find<T: React$ElementType>(selector: T): ReactWrapper<T>,
findWhere(predicate: PredicateFunction<this>): this,
every(selector: EnzymeSelector): boolean,
everyWhere(predicate: PredicateFunction<this>): boolean,
exists(selector?: EnzymeSelector): boolean,
filter(selector: UntypedSelector): this,
filter<T: React$ElementType>(selector: T): ReactWrapper<T>,
filterWhere(predicate: PredicateFunction<this>): this,
hostNodes(): this,
contains(nodes: React$Node): boolean,
containsMatchingElement(node: React$Node): boolean,
containsAllMatchingElements(nodes: React$Node): boolean,
containsAnyMatchingElements(nodes: React$Node): boolean,
dive(option?: { context?: Object }): this,
exists(selector?: EnzymeSelector): boolean,
isEmptyRender(): boolean,
matchesElement(node: React$Node): boolean,
find(selector: UntypedSelector): this,
find<T: React$ElementType>(selector: T): ReactWrapper<T>,
findWhere(predicate: PredicateFunction<this>): this,
first(): this,
forEach(fn: (node: this, index: number) => mixed): this,
get<T = any>(index: number): React$Element<T>,
getDOMNode(): HTMLElement | HTMLInputElement,
hasClass(className: string): boolean,
hostNodes(): this,
html(): string,
instance(): React$ElementRef<RootComponent>,
invoke(propName: string): (...args: $ReadOnlyArray<any>) => mixed,
is(selector: EnzymeSelector): boolean,
isEmpty(): boolean,
isEmptyRender(): boolean,
key(): string,
last(): this,
length: number,
map<T>(fn: (node: this, index: number) => T): Array<T>,
matchesElement(node: React$Element<any>): boolean,
name(): string,
not(selector: EnzymeSelector): this,
children(selector?: UntypedSelector): this,
children<T: React$ElementType>(selector: T): ReactWrapper<T>,
childAt(index: number): this,
parent(): this,
parents(selector?: UntypedSelector): this,
parents<T: React$ElementType>(selector: T): ReactWrapper<T>,
parent(): this,
closest(selector: UntypedSelector): this,
closest<T: React$ElementType>(selector: T): ReactWrapper<T>,
render(): CheerioWrapper,
renderProp(propName: string): (...args: Array<any>) => this,
unmount(): this,
text(): string,
html(): string,
get(index: number): React$Node,
getDOMNode(): HTMLElement | HTMLInputElement,
at(index: number): this,
first(): this,
last(): this,
state(key?: string): any,
context(key?: string): any,
props(): Object,
prop(key: string): any,
key(): string,
simulate(event: string, ...args: Array<any>): this,
simulateError(error: Error): this,
slice(begin?: number, end?: number): this,
setState(state: {}, callback?: () => void): this,
setProps(props: {}, callback?: () => void): this,
setContext(context: Object): this,
instance(): React$ElementRef<RootComponent>,
update(): this,
debug(options?: Object): string,
type(): string | Function | null,
name(): string,
forEach(fn: (node: this, index: number) => mixed): this,
map<T>(fn: (node: this, index: number) => T): Array<T>,
props(): Object,
reduce<T>(
fn: (value: T, node: this, index: number) => T,
initialValue?: T
Expand All @@ -78,11 +69,21 @@ declare module "enzyme" {
fn: (value: T, node: this, index: number) => T,
initialValue?: T
): Array<T>,
render(): CheerioWrapper,
renderProp(propName: string): (...args: Array<any>) => this,
setContext(context: Object): this,
setProps(props: {...}, callback?: () => void): this,
setState(state: {...}, callback?: () => void): this,
simulate(event: string, ...args: Array<any>): this,
simulateError(error: Error): this,
slice(begin?: number, end?: number): this,
some(selector: EnzymeSelector): boolean,
someWhere(predicate: PredicateFunction<this>): boolean,
every(selector: EnzymeSelector): boolean,
everyWhere(predicate: PredicateFunction<this>): boolean,
length: number
state(key?: string): any,
text(): string,
type(): string | Function | null,
unmount(): this,
update(): this,
}

declare class ReactWrapper<T> extends Wrapper<T> {
Expand All @@ -98,38 +99,46 @@ declare module "enzyme" {
root: any,
options?: ?Object
): ShallowWrapper<T>,
equals(node: React$Node): boolean,
shallow(options?: { context?: Object }): ShallowWrapper<T>,
getElement(): React$Node,
getElements(): Array<React$Node>
shallow(options?: { context?: Object, ... }): ShallowWrapper<T>,
getElement<T = any>(): React$Element<T>,
getElements<T = any>(): Array<React$Element<T>>
}

declare function shallow<T>(
node: React$Element<T>,
options?: { context?: Object, disableLifecycleMethods?: boolean }
options?: {
context?: Object,
disableLifecycleMethods?: boolean,
...
}
): ShallowWrapper<T>;

declare function mount<T>(
node: React$Element<T>,
options?: {
context?: Object,
attachTo?: HTMLElement,
childContextTypes?: Object
childContextTypes?: Object,
...
}
): ReactWrapper<T>;
declare function render<T>(
node: React$Element<T>,
options?: { context?: Object }

declare function render(
node: React$Node,
options?: { context?: Object, ... }
): CheerioWrapper;

declare module.exports: {
configure(options: {
Adapter?: any,
disableLifecycleMethods?: boolean
disableLifecycleMethods?: boolean,
...
}): void,
render: typeof render,
mount: typeof mount,
shallow: typeof shallow,
ShallowWrapper: typeof ShallowWrapper,
ReactWrapper: typeof ReactWrapper
ReactWrapper: typeof ReactWrapper,
...
};
}
4 changes: 2 additions & 2 deletions flow-typed/npm/flow-bin_v0.x.x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583
// flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x
// flow-typed signature: 28fdff7f110e1c75efab63ff205dda30
// flow-typed version: c6154227d1/flow-bin_v0.x.x/flow_>=v0.104.x

declare module "flow-bin" {
declare module.exports: string;
Expand Down
Loading

0 comments on commit bddfb6f

Please sign in to comment.