A shooting at a Fourth of July celebration in the US city of New York wounded eight victims, four of whom are children.