In world affairs, headlines over the past week continued to be dominated largely by the Middle East. But the worst of the immediate crisis there was clearly over, and it is possible now to look at some other matters of first importance.
Chief among the others is the parlous state of the NATO alliance. British Foreign Secretary Francis Pym put a startling context on this by saying as he was leaving London for New York and Washington:
''We must be sure that the disaster in Poland does not become a disaster for the West.''
When Mr. Pym got to New York, he said that the West European allies could not usefully discuss with Washington the heated issue of the gas pipeline from Siberia, so great are the unresolved differences. US Secretary of State George Shultz met with Mr. Pym, and separately with top French and West German officials - and did not even discuss the pipeline. There is a total impasse.
President Reagan has obviously dug in his heels on the matter, refusing to give up his sanctions against the Soviet Union, including the attempt to block the pipeline even though the House of Representatives in Washington nearly passed a bill canceling the sanctions on the very day Mr. Shultz sat down for his own first meeting as secretary of state with Soviet Foreign Minister Andrei Gromyko.
It seems likely that the bill will be passed eventually. There is strong Republican support behind it, largely from the Midwest, where the sanctions policy threatens to suspend profitable contracts for pipeline equipment and machinery. These add to unemployment, already serious throughout that part of the country.
The Shultz-Gromyko meeting was important in two respects. It revived the dialogue between Washington and Moscow. The foreign policy managers of the two superpowers can still meet and talk together for three hours, as they did on Tuesday at the United States Mission offices at the United Nations. But the fact that Mr. Shultz spent those three hours with Mr. Gromyko tells us more about pressure on Washington from the NATO allies than it does about the possibility of useful business between Washington and Moscow.
The meeting took place not because Mr. Reagan is ready or willing to do serious business with the Soviets, but because the NATO allies are unhappy about the tension in US-Soviet relations. The allies have virtually demanded a resumption of dialogue in the hope that the talking may keep matters from getting any worse.
The essential fact behind all of the above is that the European allies want a revival of East-West detente and are themselves practicing a policy of detente while Mr. Reagan is still trying to pressure Moscow by sanctions into easing up on Poland and Afghanistan.
The sanctions policy cannot be effective without the cooperation of the European allies. They refuse to support the policy. Hence the sanctions are toothless against Moscow, but are driving an ever deeper wedge between the US and its European allies.
The past week also saw China softening its tone toward Moscow. There is as yet no visible reason to think that China might renew its former alliance with the Soviets. China continues to speak out against what it calls the ''hegemonistic'' behavior of the Soviets. But it is softening its strictures on Moscow. It is practicing an active diplomacy these days of making friends with large numbers of smaller countries, including the British.
British Prime Minister Margaret Thatcher has become the first British prime minister ever to visit Peking. She brought back from there friendly hints that the Chinese are trying to find some way to allow Hong Kong to survive as a capitalist enclave on China's flank after the British lease expires 15 years from now on Hong Kong's hinterland. The matter isn't settled yet, or official. But the overtones were friendly - for the merchants of Hong Kong.
In the Middle East the worst was clearly over - at least for the moment. Israeli forces withdrew from west Beirut, thus allowing US, French, and Italian forces to take over. Palestinian survivors of the massacre started rebuilding their lives. Israeli Prime Minister Menachem Begin bowed to enormous domestic and outside pressure and agreed to an independent investigation of the massacre.
The investigation is expected to lead to the resignation of Israel Defense Minister Ariel Sharon and perhaps of Mr. Begin as well. The reaction against the consequences of the Begin-Sharon invasion of Lebanon has been so widespread and insistent that Mr. Begin could not launch another military offensive in the foreseeable future. His hard-line policy has been discredited. His troops are coming back out of Lebanon now.
Mr. Reagan has set the total withdrawal of all Israeli forces, and Syrian as well, from Lebanon as his next objective in the Mideast. At his press conference Tuesday he said he expected to keep US troops in Lebanon until the Lebanese government and its army were in full control over the whole country. He did not specifically say, but did imply, that the US marines with their French and Italian allies would stay until both Israeli and Syrian troops were out.
This means that the invasion of Lebanon, which had blocked the ''new start'' toward peace, has been largely cleared away.