Palestinian factions have come to an agreement on a new ceasefire plan, aiming to halt the violence and bring about lasting peace in the region.